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

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

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

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

#include <cuda.h>
#include <cuda_runtime.h>
#include <nvrtc.h>

#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_nvrtc_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_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_ptx_to(struct futhark_context_config *cfg,
                                        const char *path);
void futhark_context_config_load_ptx_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);
void futhark_context_free(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
                                              CUdeviceptr 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);
CUdeviceptr 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_cuda

#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>


#include <cuda.h>
#include <cuda_runtime.h>
#include <nvrtc.h>


// 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 mainziid_counter_mem_realtype_237256[1];
static int32_t mainziid_counter_mem_realtype_237290[1];
static int32_t mainziid_counter_mem_realtype_237338[1];
static int32_t mainzicounter_mem_realtype_237577[10240];
static int32_t mainzicounter_mem_realtype_237614[10240];
static int32_t mainzicounter_mem_realtype_237730[10240];
static int32_t mainzicounter_mem_realtype_237784[10240];
static int32_t mainzicounter_mem_realtype_237924[10240];
static int32_t mainzicounter_mem_realtype_237992[10240];
static int32_t mainzicounter_mem_realtype_238116[10240];
static int32_t mainziid_counter_mem_realtype_238128[1];
static int32_t mainzicounter_mem_realtype_238153[10240];
static int32_t mainziid_counter_mem_realtype_238165[1];
static int32_t mainzicounter_mem_realtype_238190[10240];
static int32_t mainziid_counter_mem_realtype_238202[1];
static int32_t mainzicounter_mem_realtype_238246[10240];
static int32_t mainzicounter_mem_realtype_238276[10240];
static int32_t mainzicounter_mem_realtype_238332[10240];
static int32_t mainzicounter_mem_realtype_238379[10240];
static int32_t mainzicounter_mem_realtype_238447[10240];
static int32_t mainzicounter_mem_realtype_238508[10240];
static int32_t mainzicounter_mem_realtype_238666[10240];
static int32_t mainzicounter_mem_realtype_238700[10240];
static int32_t mainzicounter_mem_realtype_238781[10240];
static int32_t mainzicounter_mem_realtype_238832[10240];
static int32_t mainzicounter_mem_realtype_238925[10240];
static int32_t mainzicounter_mem_realtype_238990[10240];
static int32_t mainziid_counter_mem_realtype_239212[1];
static int32_t mainzicounter_mem_realtype_239258[10240];
struct memblock_device {
    int *references;
    CUdeviceptr mem;
    int64_t size;
    const char *desc;
};
struct memblock {
    int *references;
    unsigned char *mem;
    int64_t size;
    const char *desc;
};
#include <cuda.h>
#include <nvrtc.h>
typedef CUdeviceptr 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 cuda.h.

#define CUDA_SUCCEED_FATAL(x) cuda_api_succeed_fatal(x, #x, __FILE__, __LINE__)
#define CUDA_SUCCEED_NONFATAL(x) cuda_api_succeed_nonfatal(x, #x, __FILE__, __LINE__)
#define NVRTC_SUCCEED_FATAL(x) nvrtc_api_succeed_fatal(x, #x, __FILE__, __LINE__)
#define NVRTC_SUCCEED_NONFATAL(x) nvrtc_api_succeed_nonfatal(x, #x, __FILE__, __LINE__)

#define SUCCEED_OR_RETURN(serror) {               \
    if (serror) {                                 \
      if (!ctx->error) {                          \
        ctx->error = serror;                      \
        return bad;                               \
      } else {                                    \
        free(serror);                             \
      }                                           \
    }                                             \
  }

#define CUDA_SUCCEED_OR_RETURN(e) SUCCEED_OR_RETURN(CUDA_SUCCEED_NONFATAL(e))

// CUDA_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;

static inline void cuda_api_succeed_fatal(CUresult res, const char *call,
    const char *file, int line) {
  if (res != CUDA_SUCCESS) {
    const char *err_str;
    cuGetErrorString(res, &err_str);
    if (err_str == NULL) { err_str = "Unknown"; }
    futhark_panic(-1, "%s:%d: CUDA call\n  %s\nfailed with error code %d (%s)\n",
        file, line, call, res, err_str);
  }
}

static char* cuda_api_succeed_nonfatal(CUresult res, const char *call,
    const char *file, int line) {
  if (res != CUDA_SUCCESS) {
    const char *err_str;
    cuGetErrorString(res, &err_str);
    if (err_str == NULL) { err_str = "Unknown"; }
    return msgprintf("%s:%d: CUDA call\n  %s\nfailed with error code %d (%s)\n",
        file, line, call, res, err_str);
  } else {
    return NULL;
  }
}

static inline void nvrtc_api_succeed_fatal(nvrtcResult res, const char *call,
                                           const char *file, int line) {
  if (res != NVRTC_SUCCESS) {
    const char *err_str = nvrtcGetErrorString(res);
    futhark_panic(-1, "%s:%d: NVRTC call\n  %s\nfailed with error code %d (%s)\n",
        file, line, call, res, err_str);
  }
}

static char* nvrtc_api_succeed_nonfatal(nvrtcResult res, const char *call,
                                        const char *file, int line) {
  if (res != NVRTC_SUCCESS) {
    const char *err_str = nvrtcGetErrorString(res);
    return msgprintf("%s:%d: NVRTC call\n  %s\nfailed with error code %d (%s)\n",
                     file, line, call, res, err_str);
  } else {
    return NULL;
  }
}

struct cuda_config {
  int debugging;
  int logging;
  const char *preferred_device;
  int preferred_device_num;

  const char *dump_program_to;
  const char *load_program_from;

  const char *dump_ptx_to;
  const char *load_ptx_from;

  size_t default_block_size;
  size_t default_grid_size;
  size_t default_tile_size;
  size_t default_reg_tile_size;
  size_t default_threshold;

  int default_block_size_changed;
  int default_grid_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 cuda_config_init(struct cuda_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->preferred_device_num = 0;
  cfg->preferred_device = "";
  cfg->dump_program_to = NULL;
  cfg->load_program_from = NULL;

  cfg->dump_ptx_to = NULL;
  cfg->load_ptx_from = NULL;

  cfg->default_block_size = 256;
  cfg->default_grid_size = 0; // Set properly later.
  cfg->default_tile_size = 32;
  cfg->default_reg_tile_size = 2;
  cfg->default_threshold = 32*1024;

  cfg->default_block_size_changed = 0;
  cfg->default_grid_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 {
  cudaEvent_t *events; // Points to two events.
  int *runs;
  int64_t *runtime;
};

struct cuda_context {
  CUdevice dev;
  CUcontext cu_ctx;
  CUmodule module;

  struct cuda_config cfg;

  struct free_list free_list;

  size_t max_block_size;
  size_t max_grid_size;
  size_t max_tile_size;
  size_t max_threshold;
  size_t max_shared_memory;
  size_t max_bespoke;

  size_t lockstep_width;

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

#define CU_DEV_ATTR(x) (CU_DEVICE_ATTRIBUTE_##x)
#define device_query(dev,attrib) _device_query(dev, CU_DEV_ATTR(attrib))
static int _device_query(CUdevice dev, CUdevice_attribute attrib) {
  int val;
  CUDA_SUCCEED_FATAL(cuDeviceGetAttribute(&val, attrib, dev));
  return val;
}

#define CU_FUN_ATTR(x) (CU_FUNC_ATTRIBUTE_##x)
#define function_query(fn,attrib) _function_query(dev, CU_FUN_ATTR(attrib))
static int _function_query(CUfunction dev, CUfunction_attribute attrib) {
  int val;
  CUDA_SUCCEED_FATAL(cuFuncGetAttribute(&val, attrib, dev));
  return val;
}

static void set_preferred_device(struct cuda_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;
}

static int cuda_device_setup(struct cuda_context *ctx) {
  char name[256];
  int count, chosen = -1, best_cc = -1;
  int cc_major_best, cc_minor_best;
  int cc_major, cc_minor;
  CUdevice dev;

  CUDA_SUCCEED_FATAL(cuDeviceGetCount(&count));
  if (count == 0) { return 1; }

  int num_device_matches = 0;

  // XXX: Current device selection policy is to choose the device with the
  // highest compute capability (if no preferred device is set).
  // This should maybe be changed, since greater compute capability is not
  // necessarily an indicator of better performance.
  for (int i = 0; i < count; i++) {
    CUDA_SUCCEED_FATAL(cuDeviceGet(&dev, i));

    cc_major = device_query(dev, COMPUTE_CAPABILITY_MAJOR);
    cc_minor = device_query(dev, COMPUTE_CAPABILITY_MINOR);

    CUDA_SUCCEED_FATAL(cuDeviceGetName(name, sizeof(name) - 1, dev));
    name[sizeof(name) - 1] = 0;

    if (ctx->cfg.debugging) {
      fprintf(stderr, "Device #%d: name=\"%s\", compute capability=%d.%d\n",
          i, name, cc_major, cc_minor);
    }

    if (device_query(dev, COMPUTE_MODE) == CU_COMPUTEMODE_PROHIBITED) {
      if (ctx->cfg.debugging) {
        fprintf(stderr, "Device #%d is compute-prohibited, ignoring\n", i);
      }
      continue;
    }

    if (best_cc == -1 || cc_major > cc_major_best ||
        (cc_major == cc_major_best && cc_minor > cc_minor_best)) {
      best_cc = i;
      cc_major_best = cc_major;
      cc_minor_best = cc_minor;
    }

    if (strstr(name, ctx->cfg.preferred_device) != NULL &&
        num_device_matches++ == ctx->cfg.preferred_device_num) {
      chosen = i;
      break;
    }
  }

  if (chosen == -1) { chosen = best_cc; }
  if (chosen == -1) { return 1; }

  if (ctx->cfg.debugging) {
    fprintf(stderr, "Using device #%d\n", chosen);
  }

  CUDA_SUCCEED_FATAL(cuDeviceGet(&ctx->dev, chosen));
  return 0;
}

static char *concat_fragments(const char *src_fragments[]) {
  size_t src_len = 0;
  const char **p;

  for (p = src_fragments; *p; p++) {
    src_len += strlen(*p);
  }

  char *src = (char*) malloc(src_len + 1);
  size_t n = 0;
  for (p = src_fragments; *p; p++) {
    strcpy(src + n, *p);
    n += strlen(*p);
  }

  return src;
}

static const char *cuda_nvrtc_get_arch(CUdevice dev) {
  struct {
    int major;
    int minor;
    const char *arch_str;
  } static const x[] = {
    { 3, 0, "compute_30" },
    { 3, 2, "compute_32" },
    { 3, 5, "compute_35" },
    { 3, 7, "compute_37" },
    { 5, 0, "compute_50" },
    { 5, 2, "compute_52" },
    { 5, 3, "compute_53" },
    { 6, 0, "compute_60" },
    { 6, 1, "compute_61" },
    { 6, 2, "compute_62" },
    { 7, 0, "compute_70" },
    { 7, 2, "compute_72" },
    { 7, 5, "compute_75" },
    { 8, 0, "compute_80" }
  };

  int major = device_query(dev, COMPUTE_CAPABILITY_MAJOR);
  int minor = device_query(dev, COMPUTE_CAPABILITY_MINOR);

  int chosen = -1;
  for (int i = 0; i < sizeof(x)/sizeof(x[0]); i++) {
    if (x[i].major < major || (x[i].major == major && x[i].minor <= minor)) {
      chosen = i;
    } else {
      break;
    }
  }

  if (chosen == -1) {
    futhark_panic(-1, "Unsupported compute capability %d.%d\n", major, minor);
  }

  if (x[chosen].major != major || x[chosen].minor != minor) {
    fprintf(stderr,
            "Warning: device compute capability is %d.%d, but newest supported by Futhark is %d.%d.\n",
            major, minor, x[chosen].major, x[chosen].minor);
  }

  return x[chosen].arch_str;
}

static char* cuda_nvrtc_build(struct cuda_context *ctx, const char *src,
                              const char *extra_opts[], char **ptx) {
  nvrtcProgram prog;
  char *problem = NULL;

  problem = NVRTC_SUCCEED_NONFATAL(nvrtcCreateProgram(&prog, src, "futhark-cuda", 0, NULL, NULL));

  if (problem) {
    return problem;
  }

  int arch_set = 0, num_extra_opts;

  // nvrtc cannot handle multiple -arch options.  Hence, if one of the
  // extra_opts is -arch, we have to be careful not to do our usual
  // automatic generation.
  for (num_extra_opts = 0; extra_opts[num_extra_opts] != NULL; num_extra_opts++) {
    if (strstr(extra_opts[num_extra_opts], "-arch")
        == extra_opts[num_extra_opts] ||
        strstr(extra_opts[num_extra_opts], "--gpu-architecture")
        == extra_opts[num_extra_opts]) {
      arch_set = 1;
    }
  }

  size_t n_opts, i = 0, i_dyn, n_opts_alloc = 20 + num_extra_opts + ctx->cfg.num_sizes;
  const char **opts = (const char**) malloc(n_opts_alloc * sizeof(const char *));
  if (!arch_set) {
    opts[i++] = "-arch";
    opts[i++] = cuda_nvrtc_get_arch(ctx->dev);
  }
  opts[i++] = "-default-device";
  if (ctx->cfg.debugging) {
    opts[i++] = "-G";
    opts[i++] = "-lineinfo";
  } else {
    opts[i++] = "--disable-warnings";
  }
  i_dyn = i;
  for (size_t j = 0; j < ctx->cfg.num_sizes; j++) {
    opts[i++] = msgprintf("-D%s=%zu", ctx->cfg.size_vars[j],
        ctx->cfg.size_values[j]);
  }
  opts[i++] = msgprintf("-DLOCKSTEP_WIDTH=%zu", ctx->lockstep_width);
  opts[i++] = msgprintf("-DMAX_THREADS_PER_BLOCK=%zu", ctx->max_block_size);

  // Time for the best lines of the code in the entire compiler.
  if (getenv("CUDA_HOME") != NULL) {
    opts[i++] = msgprintf("-I%s/include", getenv("CUDA_HOME"));
  }
  if (getenv("CUDA_ROOT") != NULL) {
    opts[i++] = msgprintf("-I%s/include", getenv("CUDA_ROOT"));
  }
  if (getenv("CUDA_PATH") != NULL) {
    opts[i++] = msgprintf("-I%s/include", getenv("CUDA_PATH"));
  }
  opts[i++] = msgprintf("-I/usr/local/cuda/include");
  opts[i++] = msgprintf("-I/usr/include");

  // It is crucial that the extra_opts are last, so that the free()
  // logic below does not cause problems.
  for (int j = 0; extra_opts[j] != NULL; j++) {
    opts[i++] = extra_opts[j];
  }

  n_opts = i;

  if (ctx->cfg.debugging) {
    fprintf(stderr, "NVRTC compile options:\n");
    for (size_t j = 0; j < n_opts; j++) {
      fprintf(stderr, "\t%s\n", opts[j]);
    }
    fprintf(stderr, "\n");
  }

  nvrtcResult res = nvrtcCompileProgram(prog, n_opts, opts);
  if (res != NVRTC_SUCCESS) {
    size_t log_size;
    if (nvrtcGetProgramLogSize(prog, &log_size) == NVRTC_SUCCESS) {
      char *log = (char*) malloc(log_size);
      if (nvrtcGetProgramLog(prog, log) == NVRTC_SUCCESS) {
        problem = msgprintf("NVRTC compilation failed.\n\n%s\n", log);
      } else {
        problem = msgprintf("Could not retrieve compilation log\n");
      }
      free(log);
    }
    return problem;
  }

  for (i = i_dyn; i < n_opts-num_extra_opts; i++) { free((char *)opts[i]); }
  free(opts);

  size_t ptx_size;
  NVRTC_SUCCEED_FATAL(nvrtcGetPTXSize(prog, &ptx_size));
  *ptx = (char*) malloc(ptx_size);
  NVRTC_SUCCEED_FATAL(nvrtcGetPTX(prog, *ptx));

  NVRTC_SUCCEED_FATAL(nvrtcDestroyProgram(&prog));

  return NULL;
}

static void cuda_size_setup(struct cuda_context *ctx)
{
  if (ctx->cfg.default_block_size > ctx->max_block_size) {
    if (ctx->cfg.default_block_size_changed) {
      fprintf(stderr,
          "Note: Device limits default block size to %zu (down from %zu).\n",
          ctx->max_block_size, ctx->cfg.default_block_size);
    }
    ctx->cfg.default_block_size = ctx->max_block_size;
  }
  if (ctx->cfg.default_grid_size > ctx->max_grid_size) {
    if (ctx->cfg.default_grid_size_changed) {
      fprintf(stderr,
          "Note: Device limits default grid size to %zu (down from %zu).\n",
          ctx->max_grid_size, ctx->cfg.default_grid_size);
    }
    ctx->cfg.default_grid_size = ctx->max_grid_size;
  }
  if (ctx->cfg.default_tile_size > ctx->max_tile_size) {
    if (ctx->cfg.default_tile_size_changed) {
      fprintf(stderr,
          "Note: Device limits default tile size to %zu (down from %zu).\n",
          ctx->max_tile_size, ctx->cfg.default_tile_size);
    }
    ctx->cfg.default_tile_size = ctx->max_tile_size;
  }

  if (!ctx->cfg.default_grid_size_changed) {
    ctx->cfg.default_grid_size =
      (device_query(ctx->dev, MULTIPROCESSOR_COUNT) *
       device_query(ctx->dev, MAX_THREADS_PER_MULTIPROCESSOR))
      / ctx->cfg.default_block_size;
  }

  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 = ctx->max_block_size;
      default_value = ctx->cfg.default_block_size;
    } else if (strstr(size_class, "num_groups") == size_class) {
      max_value = ctx->max_grid_size;
      default_value = ctx->cfg.default_grid_size;
      // 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 = ctx->max_tile_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 %zu (down from %zu)\n",
              size_name, max_value, *size_value);
      *size_value = max_value;
    }
  }
}

static char* cuda_module_setup(struct cuda_context *ctx,
                               const char *src_fragments[],
                               const char *extra_opts[]) {
  char *ptx = NULL, *src = NULL;

  if (ctx->cfg.load_program_from == NULL) {
    src = concat_fragments(src_fragments);
  } else {
    src = slurp_file(ctx->cfg.load_program_from, NULL);
  }

  if (ctx->cfg.load_ptx_from) {
    if (ctx->cfg.load_program_from != NULL) {
      fprintf(stderr,
              "WARNING: Using PTX from %s instead of C code from %s\n",
              ctx->cfg.load_ptx_from, ctx->cfg.load_program_from);
    }
    ptx = slurp_file(ctx->cfg.load_ptx_from, NULL);
  }

  if (ctx->cfg.dump_program_to != NULL) {
    dump_file(ctx->cfg.dump_program_to, src, strlen(src));
  }

  if (ptx == NULL) {
    char* problem = cuda_nvrtc_build(ctx, src, extra_opts, &ptx);
    if (problem != NULL) {
      free(src);
      return problem;
    }
  }

  if (ctx->cfg.dump_ptx_to != NULL) {
    dump_file(ctx->cfg.dump_ptx_to, ptx, strlen(ptx));
  }

  CUDA_SUCCEED_FATAL(cuModuleLoadData(&ctx->module, ptx));

  free(ptx);
  if (src != NULL) {
    free(src);
  }

  return NULL;
}

static char* cuda_setup(struct cuda_context *ctx, const char *src_fragments[], const char *extra_opts[]) {
  CUDA_SUCCEED_FATAL(cuInit(0));

  if (cuda_device_setup(ctx) != 0) {
    futhark_panic(-1, "No suitable CUDA device found.\n");
  }
  CUDA_SUCCEED_FATAL(cuCtxCreate(&ctx->cu_ctx, 0, ctx->dev));

  free_list_init(&ctx->free_list);

  ctx->max_shared_memory = device_query(ctx->dev, MAX_SHARED_MEMORY_PER_BLOCK);
  ctx->max_block_size = device_query(ctx->dev, MAX_THREADS_PER_BLOCK);
  ctx->max_grid_size = device_query(ctx->dev, MAX_GRID_DIM_X);
  ctx->max_tile_size = sqrt(ctx->max_block_size);
  ctx->max_threshold = 0;
  ctx->max_bespoke = 0;
  ctx->lockstep_width = device_query(ctx->dev, WARP_SIZE);

  cuda_size_setup(ctx);
  return cuda_module_setup(ctx, src_fragments, extra_opts);
}

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

    float ms;
    if ((err = cudaEventElapsedTime(&ms, record.events[0], record.events[1])) != cudaSuccess) {
      return err;
    }

    // CUDA provides milisecond resolution, but we want microseconds.
    *record.runs += 1;
    *record.runtime += ms*1000;

    if ((err = cudaEventDestroy(record.events[0])) != cudaSuccess) {
      return err;
    }
    if ((err = cudaEventDestroy(record.events[1])) != cudaSuccess) {
      return err;
    }

    free(record.events);
  }

  ctx->profiling_records_used = 0;

  return cudaSuccess;
}

// Returns pointer to two events.
static cudaEvent_t* cuda_get_events(struct cuda_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));
    }
    cudaEvent_t *events = calloc(2, sizeof(cudaEvent_t));
    cudaEventCreate(&events[0]);
    cudaEventCreate(&events[1]);
    ctx->profiling_records[ctx->profiling_records_used].events = events;
    ctx->profiling_records[ctx->profiling_records_used].runs = runs;
    ctx->profiling_records[ctx->profiling_records_used].runtime = runtime;
    ctx->profiling_records_used++;
    return events;
}

static CUresult cuda_free_all(struct cuda_context *ctx);

static void cuda_cleanup(struct cuda_context *ctx) {
  CUDA_SUCCEED_FATAL(cuda_free_all(ctx));
  (void)cuda_tally_profiling_records(ctx);
  free(ctx->profiling_records);
  CUDA_SUCCEED_FATAL(cuModuleUnload(ctx->module));
  CUDA_SUCCEED_FATAL(cuCtxDestroy(ctx->cu_ctx));
}

static CUresult cuda_alloc(struct cuda_context *ctx, size_t min_size,
                           const char *tag, CUdeviceptr *mem_out) {
  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) {
    if (size >= min_size) {
      return CUDA_SUCCESS;
    } else {
      CUresult res = cuMemFree(*mem_out);
      if (res != CUDA_SUCCESS) {
        return res;
      }
    }
  }

  CUresult res = cuMemAlloc(mem_out, min_size);
  while (res == CUDA_ERROR_OUT_OF_MEMORY) {
    CUdeviceptr mem;
    if (free_list_first(&ctx->free_list, &mem) == 0) {
      res = cuMemFree(mem);
      if (res != CUDA_SUCCESS) {
        return res;
      }
    } else {
      break;
    }
    res = cuMemAlloc(mem_out, min_size);
  }

  return res;
}

static CUresult cuda_free(struct cuda_context *ctx, CUdeviceptr mem,
                          const char *tag) {
  size_t size;
  CUdeviceptr 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) {
    CUresult res = cuMemFree(existing_mem);
    if (res != CUDA_SUCCESS) {
      return res;
    }
  }

  CUresult res = cuMemGetAddressRange(NULL, &size, mem);
  if (res == CUDA_SUCCESS) {
    free_list_insert(&ctx->free_list, size, mem, tag);
  }

  return res;
}

static CUresult cuda_free_all(struct cuda_context *ctx) {
  CUdeviceptr mem;
  free_list_pack(&ctx->free_list);
  while (free_list_first(&ctx->free_list, &mem) == 0) {
    CUresult res = cuMemFree(mem);
    if (res != CUDA_SUCCESS) {
      return res;
    }
  }

  return CUDA_SUCCESS;
}

// End of cuda.h.

const char *cuda_program[] =
           {"\n#define FUTHARK_CUDA\n#define FUTHARK_F64_ENABLED\n\ntypedef char int8_t;\ntypedef short int16_t;\ntypedef int int32_t;\ntypedef long long int64_t;\ntypedef unsigned char uint8_t;\ntypedef unsigned short uint16_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long uint64_t;\ntypedef uint8_t uchar;\ntypedef uint16_t ushort;\ntypedef uint32_t uint;\ntypedef uint64_t ulong;\n#define __kernel extern \"C\" __global__ __launch_bounds__(MAX_THREADS_PER_BLOCK)\n#define __global\n#define __local\n#define __private\n#define __constant\n#define __write_only\n#define __read_only\n\nstatic inline int get_group_id_fn(int block_dim0, int block_dim1, int block_dim2, int d) {\n  switch (d) {\n    case 0: d = block_dim0; break;\n    case 1: d = block_dim1; break;\n    case 2: d = block_dim2; break;\n  }\n  switch (d) {\n    case 0: return blockIdx.x;\n    case 1: return blockIdx.y;\n    case 2: return blockIdx.z;\n    default: return 0;\n  }\n}\n#define get_group_id(d) get_group_id_fn(block_dim0, block_dim1, block_dim2, d)\n\nstatic inline int get_num_groups_fn(int block_dim0, int block_dim1, int block_dim2, int d) {\n  switch (d) {\n    case 0: d = block_dim0; break;\n    case 1: d = block_dim1; break;\n    case 2: d = block_dim2; break;\n  }\n  switch(d) {\n    case 0: return gridDim.x;\n    case 1: return gridDim.y;\n    case 2: return gridDim.z;\n    default: return 0;\n  }\n}\n#define get_num_groups(d) get_num_groups_fn(block_dim0, block_dim1, block_dim2, d)\n\nstatic inline int get_local_id(int d) {\n  switch (d) {\n    case 0: return threadIdx.x;\n    case 1: return threadIdx.y;\n    case 2: return threadIdx.z;\n    default: return 0;\n  }\n}\n\nstatic inline int get_local_size(int d) {\n  switch (d) {\n    case 0: return blockDim.x;\n    case 1: return blockDim.y;\n    case 2: return blockDim.z;\n    default: return 0;\n  }\n}\n\nstatic inline int get_global_id_fn(int block_dim0, int block_dim1, int block_dim2, int d) {\n  return get_group_id(d) * get_local_size(d) + get_local_id(d);\n}\n#define get_global_id(d) get_global_id_fn(block_dim0,",
            " block_dim1, block_dim2, d)\n\nstatic inline int get_global_size(int block_dim0, int block_dim1, int block_dim2, int d) {\n  return get_num_groups(d) * get_local_size(d);\n}\n\n#define CLK_LOCAL_MEM_FENCE 1\n#define CLK_GLOBAL_MEM_FENCE 2\nstatic inline void barrier(int x) {\n  __syncthreads();\n}\nstatic inline void mem_fence_local() {\n  __threadfence_block();\n}\nstatic inline void mem_fence_global() {\n  __threadfence();\n}\n\n#define NAN (0.0/0.0)\n#define INFINITY (1.0/0.0)\nextern volatile __shared__ unsigned char shared_mem[];\n// Start of half.h.\n\n// Conversion functions are from http://half.sourceforge.net/, but\n// translated to C.\n//\n// Copyright (c) 2012-2021 Christian Rau\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the 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, 0x00",
            "00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,\n  0x0200, 0x0400, 0x0800, 0x0C00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x2400, 0x2800, 0x2C00, 0x3000, 0x3400, 0x3800, 0x3C00,\n  0x4000, 0x4400, 0x4800, 0x4C00, 0x5000, 0x5400, 0x5800, 0x5C00, 0x6000, 0x6400, 0x6800, 0x6C00, 0x7000, 0x7400, 0x7800, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 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, 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  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, 0x369E0000,\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, 0x3712000",
            "0, 0x37130000, 0x37140000, 0x37150000, 0x37160000, 0x37170000, 0x37180000, 0x37190000, 0x371A0000, 0x371B0000, 0x371C0000, 0x371D0000, 0x371E0000, 0x371F0000,\n  0x37200000, 0x37210000, 0x37220000, 0x37230000, 0x37240000, 0x37250000, 0x37260000, 0x37270000, 0x37280000, 0x37290000, 0x372A0000, 0x372B0000, 0x372C0000, 0x372D0000, 0x372E0000, 0x372F0000,\n  0x37300000, 0x37310000, 0x37320000, 0x37330000, 0x37340000, 0x37350000, 0x37360000, 0x37370000, 0x37380000, 0x37390000, 0x373A0000, 0x373B0000, 0x373C0000, 0x373D0000, 0x373E0000, 0x373F0000,\n  0x37400000, 0x37410000, 0x37420000, 0x37430000, 0x37440000, 0x37450000, 0x37460000, 0x37470000, 0x37480000, 0x37490000, 0x374A0000, 0x374B0000, 0x374C0000, 0x374D0000, 0x374E0000, 0x374F0000,\n  0x37500000, 0x37510000, 0x37520000, 0x37530000, 0x37540000, 0x37550000, 0x37560000, 0x37570000, 0x37580000, 0x37590000, 0x375A0000, 0x375B0000, 0x375C0000, 0x375D0000, 0x375E0000, 0x375F0000,\n  0x37600000, 0x37610000, 0x37620000, 0x37630000, 0x37640000, 0x37650000, 0x37660000, 0x37670000, 0x37680000, 0x37690000, 0x376A0000, 0x376B0000, 0x376C0000, 0x376D0000, 0x376E0000, 0x376F0000,\n  0x37700000, 0x37710000, 0x37720000, 0x37730000, 0x37740000, 0x37750000, 0x37760000, 0x37770000, 0x37780000, 0x37790000, 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, 0x379B800",
            "0, 0x379C0000, 0x379C8000, 0x379D0000, 0x379D8000, 0x379E0000, 0x379E8000, 0x379F0000, 0x379F8000,\n  0x37A00000, 0x37A08000, 0x37A10000, 0x37A18000, 0x37A20000, 0x37A28000, 0x37A30000, 0x37A38000, 0x37A40000, 0x37A48000, 0x37A50000, 0x37A58000, 0x37A60000, 0x37A68000, 0x37A70000, 0x37A78000,\n  0x37A80000, 0x37A88000, 0x37A90000, 0x37A98000, 0x37AA0000, 0x37AA8000, 0x37AB0000, 0x37AB8000, 0x37AC0000, 0x37AC8000, 0x37AD0000, 0x37AD8000, 0x37AE0000, 0x37AE8000, 0x37AF0000, 0x37AF8000,\n  0x37B00000, 0x37B08000, 0x37B10000, 0x37B18000, 0x37B20000, 0x37B28000, 0x37B30000, 0x37B38000, 0x37B40000, 0x37B48000, 0x37B50000, 0x37B58000, 0x37B60000, 0x37B68000, 0x37B70000, 0x37B78000,\n  0x37B80000, 0x37B88000, 0x37B90000, 0x37B98000, 0x37BA0000, 0x37BA8000, 0x37BB0000, 0x37BB8000, 0x37BC0000, 0x37BC8000, 0x37BD0000, 0x37BD8000, 0x37BE0000, 0x37BE8000, 0x37BF0000, 0x37BF8000,\n  0x37C00000, 0x37C08000, 0x37C10000, 0x37C18000, 0x37C20000, 0x37C28000, 0x37C30000, 0x37C38000, 0x37C40000, 0x37C48000, 0x37C50000, 0x37C58000, 0x37C60000, 0x37C68000, 0x37C70000, 0x37C78000,\n  0x37C80000, 0x37C88000, 0x37C90000, 0x37C98000, 0x37CA0000, 0x37CA8000, 0x37CB0000, 0x37CB8000, 0x37CC0000, 0x37CC8000, 0x37CD0000, 0x37CD8000, 0x37CE0000, 0x37CE8000, 0x37CF0000, 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, 0x37EE000",
            "0, 0x37EE8000, 0x37EF0000, 0x37EF8000,\n  0x37F00000, 0x37F08000, 0x37F10000, 0x37F18000, 0x37F20000, 0x37F28000, 0x37F30000, 0x37F38000, 0x37F40000, 0x37F48000, 0x37F50000, 0x37F58000, 0x37F60000, 0x37F68000, 0x37F70000, 0x37F78000,\n  0x37F80000, 0x37F88000, 0x37F90000, 0x37F98000, 0x37FA0000, 0x37FA8000, 0x37FB0000, 0x37FB8000, 0x37FC0000, 0x37FC8000, 0x37FD0000, 0x37FD8000, 0x37FE0000, 0x37FE8000, 0x37FF0000, 0x37FF8000,\n  0x38000000, 0x38004000, 0x38008000, 0x3800C000, 0x38010000, 0x38014000, 0x38018000, 0x3801C000, 0x38020000, 0x38024000, 0x38028000, 0x3802C000, 0x38030000, 0x38034000, 0x38038000, 0x3803C000,\n  0x38040000, 0x38044000, 0x38048000, 0x3804C000, 0x38050000, 0x38054000, 0x38058000, 0x3805C000, 0x38060000, 0x38064000, 0x38068000, 0x3806C000, 0x38070000, 0x38074000, 0x38078000, 0x3807C000,\n  0x38080000, 0x38084000, 0x38088000, 0x3808C000, 0x38090000, 0x38094000, 0x38098000, 0x3809C000, 0x380A0000, 0x380A4000, 0x380A8000, 0x380AC000, 0x380B0000, 0x380B4000, 0x380B8000, 0x380BC000,\n  0x380C0000, 0x380C4000, 0x380C8000, 0x380CC000, 0x380D0000, 0x380D4000, 0x380D8000, 0x380DC000, 0x380E0000, 0x380E4000, 0x380E8000, 0x380EC000, 0x380F0000, 0x380F4000, 0x380F8000, 0x380FC000,\n  0x38100000, 0x38104000, 0x38108000, 0x3810C000, 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, 0x38204",
            "000, 0x38208000, 0x3820C000, 0x38210000, 0x38214000, 0x38218000, 0x3821C000, 0x38220000, 0x38224000, 0x38228000, 0x3822C000, 0x38230000, 0x38234000, 0x38238000, 0x3823C000,\n  0x38240000, 0x38244000, 0x38248000, 0x3824C000, 0x38250000, 0x38254000, 0x38258000, 0x3825C000, 0x38260000, 0x38264000, 0x38268000, 0x3826C000, 0x38270000, 0x38274000, 0x38278000, 0x3827C000,\n  0x38280000, 0x38284000, 0x38288000, 0x3828C000, 0x38290000, 0x38294000, 0x38298000, 0x3829C000, 0x382A0000, 0x382A4000, 0x382A8000, 0x382AC000, 0x382B0000, 0x382B4000, 0x382B8000, 0x382BC000,\n  0x382C0000, 0x382C4000, 0x382C8000, 0x382CC000, 0x382D0000, 0x382D4000, 0x382D8000, 0x382DC000, 0x382E0000, 0x382E4000, 0x382E8000, 0x382EC000, 0x382F0000, 0x382F4000, 0x382F8000, 0x382FC000,\n  0x38300000, 0x38304000, 0x38308000, 0x3830C000, 0x38310000, 0x38314000, 0x38318000, 0x3831C000, 0x38320000, 0x38324000, 0x38328000, 0x3832C000, 0x38330000, 0x38334000, 0x38338000, 0x3833C000,\n  0x38340000, 0x38344000, 0x38348000, 0x3834C000, 0x38350000, 0x38354000, 0x38358000, 0x3835C000, 0x38360000, 0x38364000, 0x38368000, 0x3836C000, 0x38370000, 0x38374000, 0x38378000, 0x3837C000,\n  0x38380000, 0x38384000, 0x38388000, 0x3838C000, 0x38390000, 0x38394000, 0x38398000, 0x3839C000, 0x383A0000, 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, 0x38498",
            "000, 0x3849C000, 0x384A0000, 0x384A4000, 0x384A8000, 0x384AC000, 0x384B0000, 0x384B4000, 0x384B8000, 0x384BC000,\n  0x384C0000, 0x384C4000, 0x384C8000, 0x384CC000, 0x384D0000, 0x384D4000, 0x384D8000, 0x384DC000, 0x384E0000, 0x384E4000, 0x384E8000, 0x384EC000, 0x384F0000, 0x384F4000, 0x384F8000, 0x384FC000,\n  0x38500000, 0x38504000, 0x38508000, 0x3850C000, 0x38510000, 0x38514000, 0x38518000, 0x3851C000, 0x38520000, 0x38524000, 0x38528000, 0x3852C000, 0x38530000, 0x38534000, 0x38538000, 0x3853C000,\n  0x38540000, 0x38544000, 0x38548000, 0x3854C000, 0x38550000, 0x38554000, 0x38558000, 0x3855C000, 0x38560000, 0x38564000, 0x38568000, 0x3856C000, 0x38570000, 0x38574000, 0x38578000, 0x3857C000,\n  0x38580000, 0x38584000, 0x38588000, 0x3858C000, 0x38590000, 0x38594000, 0x38598000, 0x3859C000, 0x385A0000, 0x385A4000, 0x385A8000, 0x385AC000, 0x385B0000, 0x385B4000, 0x385B8000, 0x385BC000,\n  0x385C0000, 0x385C4000, 0x385C8000, 0x385CC000, 0x385D0000, 0x385D4000, 0x385D8000, 0x385DC000, 0x385E0000, 0x385E4000, 0x385E8000, 0x385EC000, 0x385F0000, 0x385F4000, 0x385F8000, 0x385FC000,\n  0x38600000, 0x38604000, 0x38608000, 0x3860C000, 0x38610000, 0x38614000, 0x38618000, 0x3861C000, 0x38620000, 0x38624000, 0x38628000, 0x3862C000, 0x38630000, 0x38634000, 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, 0x3872C",
            "000, 0x38730000, 0x38734000, 0x38738000, 0x3873C000,\n  0x38740000, 0x38744000, 0x38748000, 0x3874C000, 0x38750000, 0x38754000, 0x38758000, 0x3875C000, 0x38760000, 0x38764000, 0x38768000, 0x3876C000, 0x38770000, 0x38774000, 0x38778000, 0x3877C000,\n  0x38780000, 0x38784000, 0x38788000, 0x3878C000, 0x38790000, 0x38794000, 0x38798000, 0x3879C000, 0x387A0000, 0x387A4000, 0x387A8000, 0x387AC000, 0x387B0000, 0x387B4000, 0x387B8000, 0x387BC000,\n  0x387C0000, 0x387C4000, 0x387C8000, 0x387CC000, 0x387D0000, 0x387D4000, 0x387D8000, 0x387DC000, 0x387E0000, 0x387E4000, 0x387E8000, 0x387EC000, 0x387F0000, 0x387F4000, 0x387F8000, 0x387FC000,\n  0x38000000, 0x38002000, 0x38004000, 0x38006000, 0x38008000, 0x3800A000, 0x3800C000, 0x3800E000, 0x38010000, 0x38012000, 0x38014000, 0x38016000, 0x38018000, 0x3801A000, 0x3801C000, 0x3801E000,\n  0x38020000, 0x38022000, 0x38024000, 0x38026000, 0x38028000, 0x3802A000, 0x3802C000, 0x3802E000, 0x38030000, 0x38032000, 0x38034000, 0x38036000, 0x38038000, 0x3803A000, 0x3803C000, 0x3803E000,\n  0x38040000, 0x38042000, 0x38044000, 0x38046000, 0x38048000, 0x3804A000, 0x3804C000, 0x3804E000, 0x38050000, 0x38052000, 0x38054000, 0x38056000, 0x38058000, 0x3805A000, 0x3805C000, 0x3805E000,\n  0x38060000, 0x38062000, 0x38064000, 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  0x380",
            "E0000, 0x380E2000, 0x380E4000, 0x380E6000, 0x380E8000, 0x380EA000, 0x380EC000, 0x380EE000, 0x380F0000, 0x380F2000, 0x380F4000, 0x380F6000, 0x380F8000, 0x380FA000, 0x380FC000, 0x380FE000,\n  0x38100000, 0x38102000, 0x38104000, 0x38106000, 0x38108000, 0x3810A000, 0x3810C000, 0x3810E000, 0x38110000, 0x38112000, 0x38114000, 0x38116000, 0x38118000, 0x3811A000, 0x3811C000, 0x3811E000,\n  0x38120000, 0x38122000, 0x38124000, 0x38126000, 0x38128000, 0x3812A000, 0x3812C000, 0x3812E000, 0x38130000, 0x38132000, 0x38134000, 0x38136000, 0x38138000, 0x3813A000, 0x3813C000, 0x3813E000,\n  0x38140000, 0x38142000, 0x38144000, 0x38146000, 0x38148000, 0x3814A000, 0x3814C000, 0x3814E000, 0x38150000, 0x38152000, 0x38154000, 0x38156000, 0x38158000, 0x3815A000, 0x3815C000, 0x3815E000,\n  0x38160000, 0x38162000, 0x38164000, 0x38166000, 0x38168000, 0x3816A000, 0x3816C000, 0x3816E000, 0x38170000, 0x38172000, 0x38174000, 0x38176000, 0x38178000, 0x3817A000, 0x3817C000, 0x3817E000,\n  0x38180000, 0x38182000, 0x38184000, 0x38186000, 0x38188000, 0x3818A000, 0x3818C000, 0x3818E000, 0x38190000, 0x38192000, 0x38194000, 0x38196000, 0x38198000, 0x3819A000, 0x3819C000, 0x3819E000,\n  0x381A0000, 0x381A2000, 0x381A4000, 0x381A6000, 0x381A8000, 0x381AA000, 0x381AC000, 0x381AE000, 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, 0x382",
            "2A000, 0x3822C000, 0x3822E000, 0x38230000, 0x38232000, 0x38234000, 0x38236000, 0x38238000, 0x3823A000, 0x3823C000, 0x3823E000,\n  0x38240000, 0x38242000, 0x38244000, 0x38246000, 0x38248000, 0x3824A000, 0x3824C000, 0x3824E000, 0x38250000, 0x38252000, 0x38254000, 0x38256000, 0x38258000, 0x3825A000, 0x3825C000, 0x3825E000,\n  0x38260000, 0x38262000, 0x38264000, 0x38266000, 0x38268000, 0x3826A000, 0x3826C000, 0x3826E000, 0x38270000, 0x38272000, 0x38274000, 0x38276000, 0x38278000, 0x3827A000, 0x3827C000, 0x3827E000,\n  0x38280000, 0x38282000, 0x38284000, 0x38286000, 0x38288000, 0x3828A000, 0x3828C000, 0x3828E000, 0x38290000, 0x38292000, 0x38294000, 0x38296000, 0x38298000, 0x3829A000, 0x3829C000, 0x3829E000,\n  0x382A0000, 0x382A2000, 0x382A4000, 0x382A6000, 0x382A8000, 0x382AA000, 0x382AC000, 0x382AE000, 0x382B0000, 0x382B2000, 0x382B4000, 0x382B6000, 0x382B8000, 0x382BA000, 0x382BC000, 0x382BE000,\n  0x382C0000, 0x382C2000, 0x382C4000, 0x382C6000, 0x382C8000, 0x382CA000, 0x382CC000, 0x382CE000, 0x382D0000, 0x382D2000, 0x382D4000, 0x382D6000, 0x382D8000, 0x382DA000, 0x382DC000, 0x382DE000,\n  0x382E0000, 0x382E2000, 0x382E4000, 0x382E6000, 0x382E8000, 0x382EA000, 0x382EC000, 0x382EE000, 0x382F0000, 0x382F2000, 0x382F4000, 0x382F6000, 0x382F8000, 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, 0x383",
            "74000, 0x38376000, 0x38378000, 0x3837A000, 0x3837C000, 0x3837E000,\n  0x38380000, 0x38382000, 0x38384000, 0x38386000, 0x38388000, 0x3838A000, 0x3838C000, 0x3838E000, 0x38390000, 0x38392000, 0x38394000, 0x38396000, 0x38398000, 0x3839A000, 0x3839C000, 0x3839E000,\n  0x383A0000, 0x383A2000, 0x383A4000, 0x383A6000, 0x383A8000, 0x383AA000, 0x383AC000, 0x383AE000, 0x383B0000, 0x383B2000, 0x383B4000, 0x383B6000, 0x383B8000, 0x383BA000, 0x383BC000, 0x383BE000,\n  0x383C0000, 0x383C2000, 0x383C4000, 0x383C6000, 0x383C8000, 0x383CA000, 0x383CC000, 0x383CE000, 0x383D0000, 0x383D2000, 0x383D4000, 0x383D6000, 0x383D8000, 0x383DA000, 0x383DC000, 0x383DE000,\n  0x383E0000, 0x383E2000, 0x383E4000, 0x383E6000, 0x383E8000, 0x383EA000, 0x383EC000, 0x383EE000, 0x383F0000, 0x383F2000, 0x383F4000, 0x383F6000, 0x383F8000, 0x383FA000, 0x383FC000, 0x383FE000,\n  0x38400000, 0x38402000, 0x38404000, 0x38406000, 0x38408000, 0x3840A000, 0x3840C000, 0x3840E000, 0x38410000, 0x38412000, 0x38414000, 0x38416000, 0x38418000, 0x3841A000, 0x3841C000, 0x3841E000,\n  0x38420000, 0x38422000, 0x38424000, 0x38426000, 0x38428000, 0x3842A000, 0x3842C000, 0x3842E000, 0x38430000, 0x38432000, 0x38434000, 0x38436000, 0x38438000, 0x3843A000, 0x3843C000, 0x3843E000,\n  0x38440000, 0x38442000, 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, 0x384",
            "BE000,\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, 0x3",
            "8608000, 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, 0x3",
            "8752000, 0x38754000, 0x38756000, 0x38758000, 0x3875A000, 0x3875C000, 0x3875E000,\n  0x38760000, 0x38762000, 0x38764000, 0x38766000, 0x38768000, 0x3876A000, 0x3876C000, 0x3876E000, 0x38770000, 0x38772000, 0x38774000, 0x38776000, 0x38778000, 0x3877A000, 0x3877C000, 0x3877E000,\n  0x38780000, 0x38782000, 0x38784000, 0x38786000, 0x38788000, 0x3878A000, 0x3878C000, 0x3878E000, 0x38790000, 0x38792000, 0x38794000, 0x38796000, 0x38798000, 0x3879A000, 0x3879C000, 0x3879E000,\n  0x387A0000, 0x387A2000, 0x387A4000, 0x387A6000, 0x387A8000, 0x387AA000, 0x387AC000, 0x387AE000, 0x387B0000, 0x387B2000, 0x387B4000, 0x387B6000, 0x387B8000, 0x387BA000, 0x387BC000, 0x387BE000,\n  0x387C0000, 0x387C2000, 0x387C4000, 0x387C6000, 0x387C8000, 0x387CA000, 0x387CC000, 0x387CE000, 0x387D0000, 0x387D2000, 0x387D4000, 0x387D6000, 0x387D8000, 0x387DA000, 0x387DC000, 0x387DE000,\n  0x387E0000, 0x387E2000, 0x387E4000, 0x387E6000, 0x387E8000, 0x387EA000, 0x387EC000, 0x387EE000, 0x387F0000, 0x387F2000, 0x387F4000, 0x387F6000, 0x387F8000, 0x387FA000, 0x387FC000, 0x387FE000 };\n__constant static const uint32_t exponent_table[64] = {\n  0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000, 0x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000, 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 initialisers.\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\nstati",
            "c inline uint8_t sub8(uint8_t x, uint8_t y) {\n  return x - y;\n}\n\nstatic inline uint16_t sub16(uint16_t x, uint16_t y) {\n  return x - y;\n}\n\nstatic inline uint32_t sub32(uint32_t x, uint32_t y) {\n  return x - y;\n}\n\nstatic inline uint64_t sub64(uint64_t x, uint64_t y) {\n  return x - y;\n}\n\nstatic inline uint8_t mul8(uint8_t x, uint8_t y) {\n  return x * y;\n}\n\nstatic inline uint16_t mul16(uint16_t x, uint16_t y) {\n  return x * y;\n}\n\nstatic inline uint32_t mul32(uint32_t x, uint32_t y) {\n  return x * y;\n}\n\nstatic inline uint64_t mul64(uint64_t x, uint64_t y) {\n  return x * y;\n}\n\nstatic inline uint8_t udiv8(uint8_t x, uint8_t y) {\n  return x / y;\n}\n\nstatic inline uint16_t udiv16(uint16_t x, uint16_t y) {\n  return x / y;\n}\n\nstatic inline uint32_t udiv32(uint32_t x, uint32_t y) {\n  return x / y;\n}\n\nstatic inline uint64_t udiv64(uint64_t x, uint64_t y) {\n  return x / y;\n}\n\nstatic inline uint8_t udiv_up8(uint8_t x, uint8_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint16_t udiv_up16(uint16_t x, uint16_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint32_t udiv_up32(uint32_t x, uint32_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint64_t udiv_up64(uint64_t x, uint64_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint8_t umod8(uint8_t x, uint8_t y) {\n  return x % y;\n}\n\nstatic inline uint16_t umod16(uint16_t x, uint16_t y) {\n  return x % y;\n}\n\nstatic inline uint32_t umod32(uint32_t x, uint32_t y) {\n  return x % y;\n}\n\nstatic inline uint64_t umod64(uint64_t x, uint64_t y) {\n  return x % y;\n}\n\nstatic inline uint8_t udiv_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint16_t udiv_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint32_t udiv_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint64_t udiv_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint8_t udiv_up_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inli",
            "ne uint16_t udiv_up_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint32_t udiv_up_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint64_t udiv_up_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint8_t umod_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint16_t umod_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint32_t umod_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint64_t umod_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int8_t sdiv8(int8_t x, int8_t y) {\n  int8_t q = x / y;\n  int8_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int16_t sdiv16(int16_t x, int16_t y) {\n  int16_t q = x / y;\n  int16_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int32_t sdiv32(int32_t x, int32_t y) {\n  int32_t q = x / y;\n  int32_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int64_t sdiv64(int64_t x, int64_t y) {\n  int64_t q = x / y;\n  int64_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int8_t sdiv_up8(int8_t x, int8_t y) {\n  return sdiv8(x + y - 1, y);\n}\n\nstatic inline int16_t sdiv_up16(int16_t x, int16_t y) {\n  return sdiv16(x + y - 1, y);\n}\n\nstatic inline int32_t sdiv_up32(int32_t x, int32_t y) {\n  return sdiv32(x + y - 1, y);\n}\n\nstatic inline int64_t sdiv_up64(int64_t x, int64_t y) {\n  return sdiv64(x + y - 1, y);\n}\n\nstatic inline int8_t smod8(int8_t x, int8_t y) {\n  int8_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int16_t smod16(int16_t x, int16_t y) {\n  int16_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int32_t smod32(int32_t x, int32_t y) {\n  int32_t r = x % y;\n\n  return",
            " r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int64_t smod64(int64_t x, int64_t y) {\n  int64_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int8_t sdiv_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : sdiv8(x, y);\n}\n\nstatic inline int16_t sdiv_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : sdiv16(x, y);\n}\n\nstatic inline int32_t sdiv_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : sdiv32(x, y);\n}\n\nstatic inline int64_t sdiv_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : sdiv64(x, y);\n}\n\nstatic inline int8_t sdiv_up_safe8(int8_t x, int8_t y) {\n  return sdiv_safe8(x + y - 1, y);\n}\n\nstatic inline int16_t sdiv_up_safe16(int16_t x, int16_t y) {\n  return sdiv_safe16(x + y - 1, y);\n}\n\nstatic inline int32_t sdiv_up_safe32(int32_t x, int32_t y) {\n  return sdiv_safe32(x + y - 1, y);\n}\n\nstatic inline int64_t sdiv_up_safe64(int64_t x, int64_t y) {\n  return sdiv_safe64(x + y - 1, y);\n}\n\nstatic inline int8_t smod_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : smod8(x, y);\n}\n\nstatic inline int16_t smod_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : smod16(x, y);\n}\n\nstatic inline int32_t smod_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : smod32(x, y);\n}\n\nstatic inline int64_t smod_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : smod64(x, y);\n}\n\nstatic inline int8_t squot8(int8_t x, int8_t y) {\n  return x / y;\n}\n\nstatic inline int16_t squot16(int16_t x, int16_t y) {\n  return x / y;\n}\n\nstatic inline int32_t squot32(int32_t x, int32_t y) {\n  return x / y;\n}\n\nstatic inline int64_t squot64(int64_t x, int64_t y) {\n  return x / y;\n}\n\nstatic inline int8_t srem8(int8_t x, int8_t y) {\n  return x % y;\n}\n\nstatic inline int16_t srem16(int16_t x, int16_t y) {\n  return x % y;\n}\n\nstatic inline int32_t srem32(int32_t x, int32_t y) {\n  return x % y;\n}\n\nstatic inline int64_t srem64(int64_t x, int64_t y) {\n  return x % y;\n}\n\nstatic inline int8_t squot_safe8(int8_t x, int8_t y)",
            " {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int16_t squot_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int32_t squot_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int64_t squot_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int8_t srem_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int16_t srem_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int32_t srem_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int64_t srem_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int8_t smin8(int8_t x, int8_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int16_t smin16(int16_t x, int16_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int32_t smin32(int32_t x, int32_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int64_t smin64(int64_t x, int64_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint8_t umin8(uint8_t x, uint8_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint16_t umin16(uint16_t x, uint16_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint32_t umin32(uint32_t x, uint32_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint64_t umin64(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\nsta",
            "tic 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(int",
            "8_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 fu",
            "trts_mul_hi16(uint16_t a, uint16_t b) {\n  uint32_t aa = a;\n  uint32_t bb = b;\n\n  return aa * bb >> 16;\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {\n  uint64_t aa = a;\n  uint64_t bb = b;\n\n  return aa * bb >> 32;\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  __uint128_t aa = a;\n  __uint128_t bb = b;\n\n  return aa * bb >> 64;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {\n  return mad_hi(a, b, c);\n}\n\n#else // Not OpenCL\n\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {\n  return futrts_mul_hi8(a, b) + c;\n}\n\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {\n  return futrts_mul_hi16(a, b) + c;\n}\n\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {\n  return futrts_mul_hi32(a, b) + c;\n}\n\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {\n  return futrts_mul_hi64(a, b) + c;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_clzz8(int8_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return clz(x);\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_clzz8(int8_t x) {\n  return __clz(zext_i8_i32(x)) - 24;\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return __clz(zext_i16_i32(x)) - 16;\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return __clz(x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return __clzll(x);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_clzz8(int8_t x) {\n  return x == 0 ? 8 : __builtin_clz((uint32_t)zext_i8_i32(x)) - 24;\n",
            "}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return x == 0 ? 16 : __builtin_clz((uint32_t)zext_i16_i32(x)) - 16;\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return x == 0 ? 32 : __builtin_clz((uint32_t)x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return x == 0 ? 64 : __builtin_clzll((uint64_t)x);\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_ctzz8(int8_t x) {\n  int i = 0;\n  for (; i < 8 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  int i = 0;\n  for (; i < 16 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  int i = 0;\n  for (; i < 32 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  int i = 0;\n  for (; i < 64 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_ctzz8(int8_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 8 : y - 1;\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 16 : y - 1;\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 32 : y - 1;\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  int y = __ffsll(x);\n  return y == 0 ? 64 : y - 1;\n}\n\n#else // 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  retur",
            "n x < y;\n}\n\nstatic inline bool cmple32(float x, float y) {\n  return x <= y;\n}\n\nstatic inline float sitofp_i8_f32(int8_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i16_f32(int16_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i32_f32(int32_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i64_f32(int64_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i8_f32(uint8_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i16_f32(uint16_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i32_f32(uint32_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i64_f32(uint64_t x) {\n  return (float) x;\n}\n\nstatic inline int8_t fptosi_f32_i8(float x) {\n  return (int8_t) x;\n}\n\nstatic inline int16_t fptosi_f32_i16(float x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f32_i32(float x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f32_i64(float x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f32_i8(float x) {\n  return (uint8_t) x;\n}\n\nstatic inline uint16_t fptoui_f32_i16(float x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f32_i32(float x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fptoui_f32_i64(float x) {\n  return (uint64_t) x;\n}\n\n#ifdef __OPENCL_VERSION__\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 __OP",
            "ENCL_VERSION__\nstatic inline float futrts_log32(float x) {\n  return log(x);\n}\n\nstatic inline float futrts_log2_32(float x) {\n  return log2(x);\n}\n\nstatic inline float futrts_log10_32(float x) {\n  return log10(x);\n}\n\nstatic inline float futrts_sqrt32(float x) {\n  return sqrt(x);\n}\n\nstatic inline float futrts_exp32(float x) {\n  return exp(x);\n}\n\nstatic inline float futrts_cos32(float x) {\n  return cos(x);\n}\n\nstatic inline float futrts_sin32(float x) {\n  return sin(x);\n}\n\nstatic inline float futrts_tan32(float x) {\n  return tan(x);\n}\n\nstatic inline float futrts_acos32(float x) {\n  return acos(x);\n}\n\nstatic inline float futrts_asin32(float x) {\n  return asin(x);\n}\n\nstatic inline float futrts_atan32(float x) {\n  return atan(x);\n}\n\nstatic inline float futrts_cosh32(float x) {\n  return cosh(x);\n}\n\nstatic inline float futrts_sinh32(float x) {\n  return sinh(x);\n}\n\nstatic inline float futrts_tanh32(float x) {\n  return tanh(x);\n}\n\nstatic inline float futrts_acosh32(float x) {\n  return acosh(x);\n}\n\nstatic inline float futrts_asinh32(float x) {\n  return asinh(x);\n}\n\nstatic inline float futrts_atanh32(float x) {\n  return atanh(x);\n}\n\nstatic inline float futrts_atan2_32(float x, float y) {\n  return atan2(x, y);\n}\n\nstatic inline float futrts_hypot32(float x, float y) {\n  return hypot(x, y);\n}\n\nstatic inline float futrts_gamma32(float x) {\n  return tgamma(x);\n}\n\nstatic inline float futrts_lgamma32(float x) {\n  return lgamma(x);\n}\n\nstatic inline float fmod32(float x, float y) {\n  return fmod(x, y);\n}\n\nstatic inline float futrts_round32(float x) {\n  return rint(x);\n}\n\nstatic inline float futrts_floor32(float x) {\n  return floor(x);\n}\n\nstatic inline float futrts_ceil32(float x) {\n  return ceil(x);\n}\n\nstatic inline float futrts_lerp32(float v0, float v1, float t) {\n  return mix(v0, v1, t);\n}\n\nstatic inline float futrts_mad32(float a, float b, float c) {\n  return mad(a, b, c);\n}\n\nstatic inline float futrts_fma32(float a, float b, float c) {\n  return fma(a, b, c);\n}\n\n#else // Not OpenCL, b",
            "ut CUDA or plain C.\n\nstatic inline float futrts_log32(float x) {\n  return logf(x);\n}\n\nstatic inline float futrts_log2_32(float x) {\n  return log2f(x);\n}\n\nstatic inline float futrts_log10_32(float x) {\n  return log10f(x);\n}\n\nstatic inline float futrts_sqrt32(float x) {\n  return sqrtf(x);\n}\n\nstatic inline float futrts_exp32(float x) {\n  return expf(x);\n}\n\nstatic inline float futrts_cos32(float x) {\n  return cosf(x);\n}\n\nstatic inline float futrts_sin32(float x) {\n  return sinf(x);\n}\n\nstatic inline float futrts_tan32(float x) {\n  return tanf(x);\n}\n\nstatic inline float futrts_acos32(float x) {\n  return acosf(x);\n}\n\nstatic inline float futrts_asin32(float x) {\n  return asinf(x);\n}\n\nstatic inline float futrts_atan32(float x) {\n  return atanf(x);\n}\n\nstatic inline float futrts_cosh32(float x) {\n  return coshf(x);\n}\n\nstatic inline float futrts_sinh32(float x) {\n  return sinhf(x);\n}\n\nstatic inline float futrts_tanh32(float x) {\n  return tanhf(x);\n}\n\nstatic inline float futrts_acosh32(float x) {\n  return acoshf(x);\n}\n\nstatic inline float futrts_asinh32(float x) {\n  return asinhf(x);\n}\n\nstatic inline float futrts_atanh32(float x) {\n  return atanhf(x);\n}\n\nstatic inline float futrts_atan2_32(float x, float y) {\n  return atan2f(x, y);\n}\n\nstatic inline 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 double 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 dou",
            "ble 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(doub",
            "le 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 t",
            "hat the half-precision storage format is still 16 bits - the\n// compiler will have to be real careful!\ntypedef float f16;\n\n#else\n\n#ifdef __CUDA_ARCH__\n#include <cuda_fp16.h>\n#endif\n\ntypedef half f16;\n\n#endif\n\n// Some of these functions convert to single precision because half\n// precision versions are not available.\n\nstatic inline f16 fadd16(f16 x, f16 y) {\n  return x + y;\n}\n\nstatic inline f16 fsub16(f16 x, f16 y) {\n  return x - y;\n}\n\nstatic inline f16 fmul16(f16 x, f16 y) {\n  return x * y;\n}\n\nstatic inline bool cmplt16(f16 x, f16 y) {\n  return x < y;\n}\n\nstatic inline bool cmple16(f16 x, f16 y) {\n  return x <= y;\n}\n\nstatic inline f16 sitofp_i8_f16(int8_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i16_f16(int16_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i32_f16(int32_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i64_f16(int64_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i8_f16(uint8_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i16_f16(uint16_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i32_f16(uint32_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i64_f16(uint64_t x) {\n  return (f16) x;\n}\n\nstatic inline int8_t fptosi_f16_i8(f16 x) {\n  return (int8_t) (float) x;\n}\n\nstatic inline int16_t 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 fpow",
            "16(f16 x, f16 y) {\n  return pow(x, y);\n}\n\n#else // Assuming CUDA.\n\nstatic inline f16 fabs16(f16 x) {\n  return fabsf(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmaxf(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fminf(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return powf(x, y);\n}\n#endif\n\nstatic inline bool futrts_isnan16(f16 x) {\n  return isnan((float)x);\n}\n\nstatic inline bool futrts_isinf16(f16 x) {\n  return isinf((float)x);\n}\n\n#ifdef __OPENCL_VERSION__\nstatic inline f16 futrts_log16(f16 x) {\n  return log(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return log2(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return log10(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return sqrt(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return exp(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return cos(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return sin(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return tan(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return acos(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return asin(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return atan(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return cosh(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return sinh(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return tanh(x);\n}\n\nstatic inline f16 futrts_acosh16(f16 x) {\n  return acosh(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return asinh(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return atanh(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return atan2(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return hypot(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return tgamma(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return lgamma(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmod(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return rint(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {",
            "\n  return floor(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return ceil(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return mix(v0, v1, t);\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return mad(a, b, c);\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return fma(a, b, c);\n}\n\n#else // Assume CUDA.\n\nstatic inline f16 futrts_log16(f16 x) {\n  return hlog(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return hlog2(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return hlog10(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return hsqrt(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return hexp(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return hcos(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return hsin(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return tanf(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return acosf(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return asinf(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return atanf(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return coshf(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return sinhf(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return tanhf(x);\n}\n\nstatic inline f16 futrts_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(f1",
            "6 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 futrts_mad32(a, b, c);\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return futrts_fma32(a, b, c);\n}\n\n// Even when we are using an OpenCL that does not support cl_khr_fp16,\n// it must still support vload_half for actually creating a\n// half-precision number, which can then be efficiently converted to a\n// float.  Similarly for vstore_half.\n#ifdef __OPENCL_VERSION__\n\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  int16_t y;\n  // Violating strict aliasing here.\n  vstore_half((float)x, 0, (half*)&y);\n  return y;\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return (f16)vload_half(0, (half*)&x);\n}\n\n#else\n\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  return (int16_t)float2halfbits(x);\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return halfbits2float((uint16_t)x);\n}\n\nstat",
            "ic 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 atomi",
            "c_min(p, x);\n#endif\n}\n\ninline int32_t atomic_and_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int32_t*)p, x);\n#else\n  return atomic_and(p, x);\n#endif\n}\n\ninline int32_t atomic_and_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int32_t*)p, x);\n#else\n  return atomic_and(p, x);\n#endif\n}\n\ninline int32_t atomic_or_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int32_t*)p, x);\n#else\n  return atomic_or(p, x);\n#endif\n}\n\ninline int32_t atomic_or_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int32_t*)p, x);\n#else\n  return atomic_or(p, x);\n#endif\n}\n\ninline int32_t atomic_xor_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_xor_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\n// Start of 64 bit atomics\n\ninline int64_t atomic_xchg_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((uint64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\ninline int64_t atomic_xchg_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((uint64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\ninline int64_t atomic_cmpxchg_i64_global(volatile __global int64_t *p,\n                                         int64_t cmp, int64_t val) {\n#ifdef FUTHARK_CUDA\n  return atomicCAS((uint64_t*)p, cmp, val);\n#else\n  return atom_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int64_t atomic_cmpxchg_i64_local(volatile __local int64_t *p,\n                                        int64_t cmp, int64_t val) {\n#ifdef FUTHARK_CUDA\n  return atomicCAS((uint64_t*)p, cmp, val);\n#else\n  return atom_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int64_t atomi",
            "c_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\nin",
            "line uint64_t atomic_umax_i64_global(volatile __global uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((uint64_t*)p, x);\n#else\n  return atom_max(p, x);\n#endif\n}\n\ninline uint64_t atomic_umax_i64_local(volatile __local uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((uint64_t*)p, x);\n#else\n  return atom_max(p, x);\n#endif\n}\n\ninline uint64_t atomic_umin_i64_global(volatile __global uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((uint64_t*)p, x);\n#else\n  return atom_min(p, x);\n#endif\n}\n\ninline uint64_t atomic_umin_i64_local(volatile __local uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((uint64_t*)p, x);\n#else\n  return atom_min(p, x);\n#endif\n}\n\ninline int64_t atomic_and_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int64_t*)p, x);\n#else\n  return atom_and(p, x);\n#endif\n}\n\ninline int64_t atomic_and_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int64_t*)p, x);\n#else\n  return atom_and(p, x);\n#endif\n}\n\ninline int64_t atomic_or_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int64_t*)p, x);\n#else\n  return atom_or(p, x);\n#endif\n}\n\ninline int64_t atomic_or_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int64_t*)p, x);\n#else\n  return atom_or(p, x);\n#endif\n}\n\ninline int64_t atomic_xor_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\ninline int64_t atomic_xor_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\n// End of atomics.h\n\n\n\n__kernel void builtinzhreplicate_f64zireplicate_233079(int32_t num_elems_233076,\n                                                       double val_233077,\n                                                  ",
            "     __global\n                                                       unsigned char *mem_233075)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_233079;\n    int32_t replicate_ltid_233080;\n    int32_t replicate_gid_233081;\n    \n    replicate_gtid_233079 = get_global_id(0);\n    replicate_ltid_233080 = get_local_id(0);\n    replicate_gid_233081 = get_group_id(0);\n    \n    int64_t slice_233085 = num_elems_233076;\n    int64_t rep_i_233084 = sext_i32_i64(replicate_gtid_233079);\n    int64_t remnant_233086 = sext_i32_i64(replicate_gtid_233079) - rep_i_233084;\n    \n    if (slt64(replicate_gtid_233079, num_elems_233076)) {\n        ((__global double *) mem_233075)[rep_i_233084] = val_233077;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_232620(int32_t num_elems_232617,\n                                                       int64_t val_232618,\n                                                       __global\n                                                       unsigned char *mem_232616)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232620;\n    int32_t replicate_ltid_232621;\n    int32_t replicate_gid_232622;\n    \n    replicate_gtid_232620 = get_global_id(0);\n    replicate_ltid_232621 = get_local_id(0);\n    replicate_gid_232622 = get_group_id(0);\n    \n    int64_t slice_232626 = num_elems_232617;\n    int64_t rep_i_232625 = sext_i32_i64(replicate_gtid_232620);\n    int64_t remnant_232627 = sext_i32_i64(replicate_gtid_232620) - rep_i_232625;\n    \n    if (slt64(replicate_gtid_232620, num_elems_232617)) {\n        ((__global int64_t *) mem_232616)[rep_i_232625] = val_232618;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i8zireplicate_232377(int32_t num_elems_232374,\n                                                      int8_t val_232375,\n                                                  ",
            "    __global\n                                                      unsigned char *mem_232373)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232377;\n    int32_t replicate_ltid_232378;\n    int32_t replicate_gid_232379;\n    \n    replicate_gtid_232377 = get_global_id(0);\n    replicate_ltid_232378 = get_local_id(0);\n    replicate_gid_232379 = get_group_id(0);\n    \n    int64_t slice_232383 = num_elems_232374;\n    int64_t rep_i_232382 = sext_i32_i64(replicate_gtid_232377);\n    int64_t remnant_232384 = sext_i32_i64(replicate_gtid_232377) - rep_i_232382;\n    \n    if (slt64(replicate_gtid_232377, num_elems_232374)) {\n        ((__global int8_t *) mem_232373)[rep_i_232382] = val_232375;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f64(const int block_dim0, const int block_dim1,\n                                    const int block_dim2,\n                                    uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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(const int block_dim0, const\n                                               int block_dim1, const\n                                               int block_dim2,\n                                               uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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    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(const int block_dim0, const\n                                              int block_dim1, const\n                                              int block_dim2,\n                                              uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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",
            "        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 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(uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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    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(const int block_dim0, const int block_dim1,\n                                    const int block_dim2,\n                                    uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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_loca",
            "l_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(const int block_dim0, const\n                                               int block_dim1, const\n                                               int block_dim2,\n                                               uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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(const int block_dim0, const\n                                              int block_dim1, const\n                                              int block_dim2,\n                                              uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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(uint block_9_backing_offset_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    volatile unsigned char *block_9_backing_0 =\n                           &shared_mem[block_9_backing_offset_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_g",
            "roup_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_232638(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t i_203760, __global\n                                unsigned char *mem_229294, __global\n                                unsigned char *mem_229302)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232638;\n    int32_t copy_ltid_232639;\n    int32_t copy_gid_232640;\n    \n    copy_gtid_232638 = get_global_id(0);\n    copy_ltid_232639 = get_local_id(0);\n    copy_gid_232640 = get_group_id(0);\n    \n    int64_t slice_232644 = partition_sizze_203667;\n    int64_t copy_i_232643 = sext_i32_i64(copy_gtid_2326",
            "38);\n    int64_t remnant_232645 = sext_i32_i64(copy_gtid_232638) - copy_i_232643;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232638), partition_sizze_203667)) {\n        int64_t tmp_232646;\n        \n        tmp_232646 = ((__global int64_t *) mem_229294)[i_203760 +\n                                                       copy_i_232643 *\n                                                       n_203572];\n        ((__global int64_t *) mem_229302)[copy_i_232643] = tmp_232646;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_232839(int64_t n_p_203574,\n                                int64_t partition_sizze_203667,\n                                int64_t defunc_0_f_res_203721, int64_t i_203808,\n                                __global unsigned char *mem_229358, __global\n                                unsigned char *mem_229368)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232839;\n    int32_t copy_ltid_232840;\n    int32_t copy_gid_232841;\n    \n    copy_gtid_232839 = get_global_id(0);\n    copy_ltid_232840 = get_local_id(0);\n    copy_gid_232841 = get_group_id(0);\n    \n    int64_t slice_232846 = n_p_203574;\n    int64_t slice_232847 = partition_sizze_203667 * slice_232846;\n    int64_t copy_i_232844 = squot64(sext_i32_i64(copy_gtid_232839),\n                                    slice_232846);\n    int64_t remnant_232848 = sext_i32_i64(copy_gtid_232839) - copy_i_232844 *\n            slice_232846;\n    int64_t copy_i_232845 = remnant_232848;\n    int64_t remnant_232849 = remnant_232848 - copy_i_232845;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232839), partition_sizze_203667 *\n              n_p_203574)) {\n        int64_t tmp_232850;\n        \n        tmp_232850 = ((__global int64_t *) mem_229358)[i_203808 +\n                                                       (copy_i_232844 *\n                                                        (defunc_0_f_res_203721 *\n                                                       ",
            "  n_p_203574) +\n                                                        copy_i_232845 *\n                                                        defunc_0_f_res_203721)];\n        ((__global int64_t *) mem_229368)[copy_i_232844 * n_p_203574 +\n                                          copy_i_232845] = tmp_232850;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234876(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_230672)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234876;\n    int32_t copy_ltid_234877;\n    int32_t copy_gid_234878;\n    \n    copy_gtid_234876 = get_global_id(0);\n    copy_ltid_234877 = get_local_id(0);\n    copy_gid_234878 = get_group_id(0);\n    \n    int64_t slice_234883 = n_203572;\n    int64_t slice_234884 = partition_sizze_203667 * slice_234883;\n    int64_t copy_i_234881 = squot64(sext_i32_i64(copy_gtid_234876),\n                                    slice_234883);\n    int64_t remnant_234885 = sext_i32_i64(copy_gtid_234876) - copy_i_234881 *\n            slice_234883;\n    int64_t copy_i_234882 = remnant_234885;\n    int64_t remnant_234886 = remnant_234885 - copy_i_234882;\n    \n    if (slt64(sext_i32_i64(copy_gtid_234876), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_234887;\n        \n        tmp_234887 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_234881 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_234882 *\n             ",
            "                                       ctx_param_ext_229599)];\n        ((__global double *) mem_230672)[copy_i_234882 *\n                                         partition_sizze_203667 +\n                                         copy_i_234881] = tmp_234887;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235075(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_230730)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235075;\n    int32_t copy_ltid_235076;\n    int32_t copy_gid_235077;\n    \n    copy_gtid_235075 = get_global_id(0);\n    copy_ltid_235076 = get_local_id(0);\n    copy_gid_235077 = get_group_id(0);\n    \n    int64_t slice_235082 = n_203572;\n    int64_t slice_235083 = partition_sizze_203667 * slice_235082;\n    int64_t copy_i_235080 = squot64(sext_i32_i64(copy_gtid_235075),\n                                    slice_235082);\n    int64_t remnant_235084 = sext_i32_i64(copy_gtid_235075) - copy_i_235080 *\n            slice_235082;\n    int64_t copy_i_235081 = remnant_235084;\n    int64_t remnant_235085 = remnant_235084 - copy_i_235081;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235075), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235086;\n        \n        tmp_235086 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_235080 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235081 *\n                                                    ctx_param_ext_22",
            "9599)];\n        ((__global double *) mem_230730)[copy_i_235081 *\n                                         partition_sizze_203667 +\n                                         copy_i_235080] = tmp_235086;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235325(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_230837)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235325;\n    int32_t copy_ltid_235326;\n    int32_t copy_gid_235327;\n    \n    copy_gtid_235325 = get_global_id(0);\n    copy_ltid_235326 = get_local_id(0);\n    copy_gid_235327 = get_group_id(0);\n    \n    int64_t slice_235332 = n_203572;\n    int64_t slice_235333 = partition_sizze_203667 * slice_235332;\n    int64_t copy_i_235330 = squot64(sext_i32_i64(copy_gtid_235325),\n                                    slice_235332);\n    int64_t remnant_235334 = sext_i32_i64(copy_gtid_235325) - copy_i_235330 *\n            slice_235332;\n    int64_t copy_i_235331 = remnant_235334;\n    int64_t remnant_235335 = remnant_235334 - copy_i_235331;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235325), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235336;\n        \n        tmp_235336 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_235330 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235331 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_230837)[copy_i",
            "_235331 *\n                                         partition_sizze_203667 +\n                                         copy_i_235330] = tmp_235336;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235703(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_231047)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235703;\n    int32_t copy_ltid_235704;\n    int32_t copy_gid_235705;\n    \n    copy_gtid_235703 = get_global_id(0);\n    copy_ltid_235704 = get_local_id(0);\n    copy_gid_235705 = get_group_id(0);\n    \n    int64_t slice_235710 = n_203572;\n    int64_t slice_235711 = partition_sizze_203667 * slice_235710;\n    int64_t copy_i_235708 = squot64(sext_i32_i64(copy_gtid_235703),\n                                    slice_235710);\n    int64_t remnant_235712 = sext_i32_i64(copy_gtid_235703) - copy_i_235708 *\n            slice_235710;\n    int64_t copy_i_235709 = remnant_235712;\n    int64_t remnant_235713 = remnant_235712 - copy_i_235709;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235703), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235714;\n        \n        tmp_235714 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_235708 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235709 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_231047)[copy_i_235709 *\n                                         part",
            "ition_sizze_203667 +\n                                         copy_i_235708] = tmp_235714;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235925(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_231167)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235925;\n    int32_t copy_ltid_235926;\n    int32_t copy_gid_235927;\n    \n    copy_gtid_235925 = get_global_id(0);\n    copy_ltid_235926 = get_local_id(0);\n    copy_gid_235927 = get_group_id(0);\n    \n    int64_t slice_235932 = n_203572;\n    int64_t slice_235933 = partition_sizze_203667 * slice_235932;\n    int64_t copy_i_235930 = squot64(sext_i32_i64(copy_gtid_235925),\n                                    slice_235932);\n    int64_t remnant_235934 = sext_i32_i64(copy_gtid_235925) - copy_i_235930 *\n            slice_235932;\n    int64_t copy_i_235931 = remnant_235934;\n    int64_t remnant_235935 = remnant_235934 - copy_i_235931;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235925), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_235936;\n        \n        tmp_235936 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_235930 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_235931 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_231167)[copy_i_235931 *\n                                         partition_sizze_203667 +\n                                  ",
            "       copy_i_235930] = tmp_235936;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_236198(int64_t n_203572,\n                                int64_t partition_sizze_203667,\n                                int64_t ctx_param_ext_229596,\n                                int64_t ctx_param_ext_229597,\n                                int64_t ctx_param_ext_229599, __global\n                                unsigned char *mem_param_229601, __global\n                                unsigned char *mem_231336)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_236198;\n    int32_t copy_ltid_236199;\n    int32_t copy_gid_236200;\n    \n    copy_gtid_236198 = get_global_id(0);\n    copy_ltid_236199 = get_local_id(0);\n    copy_gid_236200 = get_group_id(0);\n    \n    int64_t slice_236205 = n_203572;\n    int64_t slice_236206 = partition_sizze_203667 * slice_236205;\n    int64_t copy_i_236203 = squot64(sext_i32_i64(copy_gtid_236198),\n                                    slice_236205);\n    int64_t remnant_236207 = sext_i32_i64(copy_gtid_236198) - copy_i_236203 *\n            slice_236205;\n    int64_t copy_i_236204 = remnant_236207;\n    int64_t remnant_236208 = remnant_236207 - copy_i_236204;\n    \n    if (slt64(sext_i32_i64(copy_gtid_236198), partition_sizze_203667 *\n              n_203572)) {\n        double tmp_236209;\n        \n        tmp_236209 = ((__global\n                       double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                   (copy_i_236203 *\n                                                    ctx_param_ext_229597 +\n                                                    copy_i_236204 *\n                                                    ctx_param_ext_229599)];\n        ((__global double *) mem_231336)[copy_i_236204 *\n                                         partition_sizze_203667 +\n                                         copy_i_236203] = tmp_236209;\n    }\n    \n  error_",
            "0:\n    return;\n}\n__kernel void mainzisegmap_206959(__global int *global_failure,\n                                  int64_t m_203571, int64_t n_203572,\n                                  int64_t num_groups_206964, __global\n                                  unsigned char *mem_229242, __global\n                                  unsigned char *mem_229260, __global\n                                  unsigned char *mem_229263, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_229272)\n{\n    #define segmap_group_sizze_206962 (mainzisegmap_group_sizze_206961)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232474;\n    int32_t local_tid_232475;\n    int64_t group_sizze_232478;\n    int32_t wave_sizze_232477;\n    int32_t group_tid_232476;\n    \n    global_tid_232474 = get_global_id(0);\n    local_tid_232475 = get_local_id(0);\n    group_sizze_232478 = get_local_size(0);\n    wave_sizze_232477 = LOCKSTEP_WIDTH;\n    group_tid_232476 = get_group_id(0);\n    \n    int32_t phys_tid_206959 = global_tid_232474;\n    int32_t phys_group_id_232479;\n    \n    phys_group_id_232479 = get_group_id(0);\n    for (int32_t i_232480 = 0; i_232480 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_203571,\n                                          segmap_group_sizze_206962)) -\n                   phys_group_id_232479, sext_i64_i32(num_groups_206964));\n         i_232480++) {\n        int32_t virt_group_id_232481 = phys_group_id_232479 + i_232480 *\n                sext_i64_i32(num_groups_206964);\n        int64_t global_tid_232482 = sext_i32_i64(virt_group_id_232481) *\n                segmap_group_sizze_206962 + sext_i32_i64(local_tid_232475);\n        int64_t slice_232483 = m_203571;\n        int64_t write_i_206958 = global_tid_232482;\n        int64_t remnant_232484 = global_tid_232482 - write_i_206958;\n        \n     ",
            "   if (slt64(write_i_206958, m_203571)) {\n            int64_t c_203673;\n            \n            c_203673 = ((__global int64_t *) mem_229263)[write_i_206958];\n            \n            int64_t offset_203674;\n            \n            offset_203674 = ((__global int64_t *) mem_229260)[write_i_206958];\n            \n            bool is_this_one_203678 = c_203673 == (int64_t) 0;\n            int64_t this_offset_203679 = (int64_t) -1 + offset_203674;\n            int64_t total_res_203680;\n            \n            if (is_this_one_203678) {\n                total_res_203680 = this_offset_203679;\n            } else {\n                total_res_203680 = (int64_t) -1;\n            }\n            if (sle64((int64_t) 0, total_res_203680) && slt64(total_res_203680,\n                                                              m_203571)) {\n                for (int64_t i_232485 = 0; i_232485 < n_203572; i_232485++) {\n                    double tmp_232486;\n                    \n                    tmp_232486 = ((__global\n                                   double *) mem_229242)[write_i_206958 +\n                                                         i_232485 * m_203571];\n                    ((__global double *) mem_229269)[total_res_203680 *\n                                                     n_203572 + i_232485] =\n                        tmp_232486;\n                }\n            }\n            if (sle64((int64_t) 0, total_res_203680) && slt64(total_res_203680,\n                                                              m_203571)) {\n                ((__global int64_t *) mem_229272)[total_res_203680] =\n                    write_i_206958;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_206962\n}\n__kernel void mainzisegmap_207135(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n          ",
            "                        unsigned char *mem_229269, __global\n                                  unsigned char *mem_229294, __global\n                                  unsigned char *mem_229298)\n{\n    #define segmap_group_sizze_207130 (mainzisegmap_group_sizze_207015)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232628;\n    int32_t local_tid_232629;\n    int64_t group_sizze_232632;\n    int32_t wave_sizze_232631;\n    int32_t group_tid_232630;\n    \n    global_tid_232628 = get_global_id(0);\n    local_tid_232629 = get_local_id(0);\n    group_sizze_232632 = get_local_size(0);\n    wave_sizze_232631 = LOCKSTEP_WIDTH;\n    group_tid_232630 = get_group_id(0);\n    \n    int32_t phys_tid_207135 = global_tid_232628;\n    int64_t global_tid_232633 = sext_i32_i64(group_tid_232630) *\n            segmap_group_sizze_207130 + sext_i32_i64(local_tid_232629);\n    int64_t slice_232634 = n_203572;\n    int64_t slice_232635 = partition_sizze_203667 * slice_232634;\n    int64_t gtid_207133 = squot64(global_tid_232633, slice_232634);\n    int64_t remnant_232636 = global_tid_232633 - gtid_207133 * slice_232634;\n    int64_t gtid_207134 = remnant_232636;\n    int64_t remnant_232637 = remnant_232636 - gtid_207134;\n    \n    if (slt64(gtid_207133, partition_sizze_203667) && slt64(gtid_207134,\n                                                            n_203572)) {\n        double x_207136;\n        \n        x_207136 = ((__global double *) mem_229269)[gtid_207133 * n_203572 +\n                                                    gtid_207134];\n        \n        bool isnan_res_207139;\n        \n        isnan_res_207139 = futrts_isnan64(x_207136);\n        \n        bool defunc_0_p_res_207140 = !isnan_res_207139;\n        int64_t defunc_1_f_res_207141;\n        \n        if (defunc_0_p_res_207140) {\n            int64_t x_207137;\n            \n            x_207137 = ((__global int64_t *) mem_229294)",
            "[gtid_207133 *\n                                                         n_203572 +\n                                                         gtid_207134];\n            \n            int64_t defunc_1_f_res_t_res_207142 = sub64(x_207137, (int64_t) 1);\n            \n            defunc_1_f_res_207141 = defunc_1_f_res_t_res_207142;\n        } else {\n            defunc_1_f_res_207141 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207133) && slt64(gtid_207133,\n                                                      partition_sizze_203667)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207141) &&\n             slt64(defunc_1_f_res_207141, n_203572))) {\n            ((__global int64_t *) mem_229298)[gtid_207133 * n_203572 +\n                                              defunc_1_f_res_207141] =\n                gtid_207134;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207130\n}\n__kernel void mainzisegmap_207260(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t i_203760, __global\n                                  unsigned char *mem_229308, __global\n                                  unsigned char *mem_229314)\n{\n    #define segmap_group_sizze_207254 (mainzisegmap_group_sizze_207172)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232648;\n    int32_t local_tid_232649;\n    int64_t group_sizze_232652;\n    int32_t wave_sizze_232651;\n    int32_t group_tid_232650;\n    \n    global_tid_232648 = get_global_id(0);\n    local_tid_232649 = get_local_id(0);\n    group_sizze_232652 ",
            "= get_local_size(0);\n    wave_sizze_232651 = LOCKSTEP_WIDTH;\n    group_tid_232650 = get_group_id(0);\n    \n    int32_t phys_tid_207260 = global_tid_232648;\n    int64_t global_tid_232653 = sext_i32_i64(group_tid_232650) *\n            segmap_group_sizze_207254 + sext_i32_i64(local_tid_232649);\n    int64_t slice_232654 = defunc_0_f_res_203721;\n    int64_t slice_232655 = n_p_203574 * slice_232654;\n    int64_t slice_232656 = partition_sizze_203667 * slice_232655;\n    int64_t gtid_207257 = squot64(global_tid_232653, slice_232655);\n    int64_t remnant_232657 = global_tid_232653 - gtid_207257 * slice_232655;\n    int64_t gtid_207258 = squot64(remnant_232657, slice_232654);\n    int64_t remnant_232658 = remnant_232657 - gtid_207258 * slice_232654;\n    int64_t gtid_207259 = remnant_232658;\n    int64_t remnant_232659 = remnant_232658 - gtid_207259;\n    \n    if ((slt64(gtid_207257, partition_sizze_203667) && slt64(gtid_207258,\n                                                             n_p_203574)) &&\n        slt64(gtid_207259, defunc_0_f_res_203721)) {\n        int64_t y_207264 = mul64(n_p_203574, gtid_207259);\n        int64_t new_i_207265 = add64(gtid_207258, y_207264);\n        bool cond_207266 = slt64(i_203760, new_i_207265);\n        double defunc_0_f_res_207267;\n        \n        if (cond_207266) {\n            defunc_0_f_res_207267 = NAN;\n        } else {\n            bool x_207268 = sle64((int64_t) 0, new_i_207265);\n            bool y_207269 = slt64(new_i_207265, n_203572);\n            bool bounds_check_207270 = x_207268 && y_207269;\n            bool index_certs_207271;\n            \n            if (!bounds_check_207270) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 1) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) new_i_207265;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n  ",
            "          }\n            \n            double defunc_0_f_res_f_res_207272;\n            \n            defunc_0_f_res_f_res_207272 = ((__global\n                                            double *) mem_229308)[gtid_207257 *\n                                                                  n_203572 +\n                                                                  new_i_207265];\n            defunc_0_f_res_207267 = defunc_0_f_res_f_res_207272;\n        }\n        ((__global double *) mem_229314)[gtid_207257 * (defunc_0_f_res_203721 *\n                                                        n_p_203574) +\n                                         gtid_207258 * defunc_0_f_res_203721 +\n                                         gtid_207259] = defunc_0_f_res_207267;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207254\n}\n__kernel void mainzisegmap_207695(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721, __global\n                                  unsigned char *mem_229314, __global\n                                  unsigned char *mem_229358, __global\n                                  unsigned char *mem_229363)\n{\n    #define segmap_group_sizze_207689 (mainzisegmap_group_sizze_207440)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232827;\n    int32_t local_tid_232828;\n    int64_t group_sizze_232831;\n    int32_t wave_sizze_232830;\n    int32_t group_tid_232829;\n    \n    global_tid_232827 = get_global_id(0);\n    local_tid_232828 = get_local_id(0);\n    group_sizze_232831 = get_local_size(0);\n    wave_sizze_232830 = LOCKSTEP_WIDTH;\n    group_tid_232829 = get_group_id(0);\n    \n    int32_t phys_tid_207695 = global_tid_232827;\n    int64_t global_tid_232832 = sext_i32_i64(group_tid_232829) *",
            "\n            segmap_group_sizze_207689 + sext_i32_i64(local_tid_232828);\n    int64_t slice_232833 = defunc_0_f_res_203721;\n    int64_t slice_232834 = n_p_203574 * slice_232833;\n    int64_t slice_232835 = partition_sizze_203667 * slice_232834;\n    int64_t gtid_207692 = squot64(global_tid_232832, slice_232834);\n    int64_t remnant_232836 = global_tid_232832 - gtid_207692 * slice_232834;\n    int64_t gtid_207693 = squot64(remnant_232836, slice_232833);\n    int64_t remnant_232837 = remnant_232836 - gtid_207693 * slice_232833;\n    int64_t gtid_207694 = remnant_232837;\n    int64_t remnant_232838 = remnant_232837 - gtid_207694;\n    \n    if ((slt64(gtid_207692, partition_sizze_203667) && slt64(gtid_207693,\n                                                             n_p_203574)) &&\n        slt64(gtid_207694, defunc_0_f_res_203721)) {\n        double x_207696;\n        \n        x_207696 = ((__global double *) mem_229314)[gtid_207692 *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207693 *\n                                                    defunc_0_f_res_203721 +\n                                                    gtid_207694];\n        \n        bool isnan_res_207699;\n        \n        isnan_res_207699 = futrts_isnan64(x_207696);\n        \n        bool defunc_0_p_res_207700 = !isnan_res_207699;\n        int64_t defunc_1_f_res_207701;\n        \n        if (defunc_0_p_res_207700) {\n            int64_t x_207697;\n            \n            x_207697 = ((__global int64_t *) mem_229358)[gtid_207692 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_207693 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_207694];\n            \n       ",
            "     int64_t defunc_1_f_res_t_res_207702 = sub64(x_207697, (int64_t) 1);\n            \n            defunc_1_f_res_207701 = defunc_1_f_res_t_res_207702;\n        } else {\n            defunc_1_f_res_207701 = (int64_t) -1;\n        }\n        if (((sle64((int64_t) 0, gtid_207692) && slt64(gtid_207692,\n                                                       partition_sizze_203667)) &&\n             (sle64((int64_t) 0, gtid_207693) && slt64(gtid_207693,\n                                                       n_p_203574))) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207701) &&\n             slt64(defunc_1_f_res_207701, defunc_0_f_res_203721))) {\n            ((__global int64_t *) mem_229363)[gtid_207692 *\n                                              (defunc_0_f_res_203721 *\n                                               n_p_203574) + gtid_207693 *\n                                              defunc_0_f_res_203721 +\n                                              defunc_1_f_res_207701] =\n                gtid_207694;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207689\n}\n__kernel void mainzisegmap_208908(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *mem_229439)\n{\n    #define segmap_group_sizze_208902 (mainzisegmap_group_sizze_208565)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232912;\n    int32_t local_tid_232913;\n    int64_t group_sizze_232916;\n    int32_t wave_sizze_232915;\n    int32_t group_tid_232914;\n    \n    global_tid_232912 = get_global_id(0);\n    local_tid_232913 = get_local_id(0);\n    group_sizze_232916 = get_local_s",
            "ize(0);\n    wave_sizze_232915 = LOCKSTEP_WIDTH;\n    group_tid_232914 = get_group_id(0);\n    \n    int32_t phys_tid_208908 = global_tid_232912;\n    int64_t global_tid_232917 = sext_i32_i64(group_tid_232914) *\n            segmap_group_sizze_208902 + sext_i32_i64(local_tid_232913);\n    int64_t slice_232918 = defunc_0_f_res_203721;\n    int64_t slice_232919 = n_p_203574 * slice_232918;\n    int64_t slice_232920 = partition_sizze_203667 * slice_232919;\n    int64_t gtid_208905 = squot64(global_tid_232917, slice_232919);\n    int64_t remnant_232921 = global_tid_232917 - gtid_208905 * slice_232919;\n    int64_t gtid_208906 = squot64(remnant_232921, slice_232918);\n    int64_t remnant_232922 = remnant_232921 - gtid_208906 * slice_232918;\n    int64_t gtid_208907 = remnant_232922;\n    int64_t remnant_232923 = remnant_232922 - gtid_208907;\n    \n    if ((slt64(gtid_208905, partition_sizze_203667) && slt64(gtid_208906,\n                                                             n_p_203574)) &&\n        slt64(gtid_208907, defunc_0_f_res_203721)) {\n        int64_t x_208909;\n        \n        x_208909 = ((__global int64_t *) ext_mem_229373)[gtid_208905 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208906 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_208907];\n        \n        int64_t defunc_0_f_res_208910 = add64((int64_t) 1, x_208909);\n        \n        ((__global int64_t *) mem_229439)[gtid_208905 * (defunc_0_f_res_203721 *\n                                                         n_p_203574) +\n                                          gtid_208906 * defunc_0_f_res_203721 +\n                                          gtid_208907] = defunc_0_f_res_208910;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208902\n}\n_",
            "_kernel void mainzisegmap_208922(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t partition_sizze_203667,\n                                  int64_t min_res_203839, double i64_res_203845,\n                                  __global unsigned char *ext_mem_229372,\n                                  __global unsigned char *mem_229444, __global\n                                  unsigned char *mem_229448, __global\n                                  unsigned char *mem_229452, __global\n                                  unsigned char *mem_229456)\n{\n    #define segmap_group_sizze_208914 (mainzisegmap_group_sizze_208534)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232924;\n    int32_t local_tid_232925;\n    int64_t group_sizze_232928;\n    int32_t wave_sizze_232927;\n    int32_t group_tid_232926;\n    \n    global_tid_232924 = get_global_id(0);\n    local_tid_232925 = get_local_id(0);\n    group_sizze_232928 = get_local_size(0);\n    wave_sizze_232927 = LOCKSTEP_WIDTH;\n    group_tid_232926 = get_group_id(0);\n    \n    int32_t phys_tid_208922 = global_tid_232924;\n    int64_t global_tid_232929 = sext_i32_i64(group_tid_232926) *\n            segmap_group_sizze_208914 + sext_i32_i64(local_tid_232925);\n    int64_t slice_232930 = n_p_203574;\n    int64_t slice_232931 = partition_sizze_203667 * slice_232930;\n    int64_t gtid_208920 = squot64(global_tid_232929, slice_232930);\n    int64_t remnant_232932 = global_tid_232929 - gtid_208920 * slice_232930;\n    int64_t gtid_208921 = remnant_232932;\n    int64_t remnant_232933 = remnant_232932 - gtid_208921;\n    \n    if (slt64(gtid_208920, partition_sizze_203667) && slt64(gtid_208921,\n                                                            n_p_203574)) {\n        int64_t x_208923;\n        \n        x_208923 = ((__global int64_t *) e",
            "xt_mem_229372)[gtid_208920 *\n                                                         n_p_203574 +\n                                                         gtid_208921];\n        \n        int64_t min_arg_208924 = sub64(x_208923, (int64_t) 1);\n        int64_t min_arg_208925 = sub64(x_208923, min_res_203839);\n        int64_t min_res_208926 = smin64(q_s_203575, x_208923);\n        double i64_res_208927 = sitofp_i64_f64(x_208923);\n        double x_208928 = i64_res_203845 - i64_res_208927;\n        double max_arg_208929 = x_208928 / 2.0;\n        double max_res_208930 = fmax64(0.0, max_arg_208929);\n        \n        ((__global int64_t *) mem_229444)[gtid_208920 * n_p_203574 +\n                                          gtid_208921] = min_arg_208924;\n        ((__global int64_t *) mem_229448)[gtid_208920 * n_p_203574 +\n                                          gtid_208921] = min_arg_208925;\n        ((__global int64_t *) mem_229452)[gtid_208920 * n_p_203574 +\n                                          gtid_208921] = min_res_208926;\n        ((__global double *) mem_229456)[gtid_208920 * n_p_203574 +\n                                         gtid_208921] = max_res_208930;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208914\n}\n__kernel void mainzisegmap_208946(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, int64_t i_203808,\n                                  unsigned char x_203809_bits,\n                                  int64_t min_res_203839,\n                                  unsigned char loop_cond_203844_bits, __global\n             ",
            "                     unsigned char *mem_229439, __global\n                                  unsigned char *mem_229444, __global\n                                  unsigned char *mem_229448, __global\n                                  unsigned char *mem_229452, __global\n                                  unsigned char *mem_229456, __global\n                                  unsigned char *mem_229462, __global\n                                  unsigned char *mem_229467)\n{\n    bool x_203809 = x_203809_bits;\n    bool loop_cond_203844 = loop_cond_203844_bits;\n    \n    #define segmap_group_sizze_208939 (mainzisegmap_group_sizze_208295)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232934;\n    int32_t local_tid_232935;\n    int64_t group_sizze_232938;\n    int32_t wave_sizze_232937;\n    int32_t group_tid_232936;\n    \n    global_tid_232934 = get_global_id(0);\n    local_tid_232935 = get_local_id(0);\n    group_sizze_232938 = get_local_size(0);\n    wave_sizze_232937 = LOCKSTEP_WIDTH;\n    group_tid_232936 = get_group_id(0);\n    \n    int32_t phys_tid_208946 = global_tid_232934;\n    int64_t global_tid_232939 = sext_i32_i64(group_tid_232936) *\n            segmap_group_sizze_208939 + sext_i32_i64(local_tid_232935);\n    int64_t slice_232940 = s_n_m_203726;\n    int64_t slice_232941 = n_p_203574 * slice_232940;\n    int64_t slice_232942 = partition_sizze_203667 * slice_232941;\n    int64_t gtid_208943 = squot64(global_tid_232939, slice_232941);\n    int64_t remnant_232943 = global_tid_232939 - gtid_208943 * slice_232941;\n    int64_t gtid_208944 = squot64(remnant_232943, slice_232940);\n    int64_t remnant_232944 = remnant_232943 - gtid_208944 * slice_232940;\n    int64_t gtid_208945 = remnant_232944;\n    int64_t remnant_232945 = remnant_232944 - gtid_208945;\n    \n    if ((slt64(gtid_208943, partition_sizze_203667) && slt64(gtid_208944,\n                                   ",
            "                          n_p_203574)) &&\n        slt64(gtid_208945, s_n_m_203726)) {\n        int64_t min_arg_208948;\n        \n        min_arg_208948 = ((__global int64_t *) mem_229444)[gtid_208943 *\n                                                           n_p_203574 +\n                                                           gtid_208944];\n        \n        int64_t min_arg_208949;\n        \n        min_arg_208949 = ((__global int64_t *) mem_229448)[gtid_208943 *\n                                                           n_p_203574 +\n                                                           gtid_208944];\n        \n        int64_t min_res_208950;\n        \n        min_res_208950 = ((__global int64_t *) mem_229452)[gtid_208943 *\n                                                           n_p_203574 +\n                                                           gtid_208944];\n        \n        double max_res_208951;\n        \n        max_res_208951 = ((__global double *) mem_229456)[gtid_208943 *\n                                                          n_p_203574 +\n                                                          gtid_208944];\n        \n        bool cond_208953 = gtid_208945 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208954;\n        \n        if (cond_208953) {\n            defunc_0_m_fun_res_208954 = (int64_t) 0;\n        } else {\n            int64_t y_208955 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_208956 = gtid_208945 == y_208955;\n            int64_t defunc_0_m_fun_res_f_res_208957;\n            \n            if (cond_208956) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208958 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208957 =\n                    defunc_0_m_fun_res_f_res_t_res_208958;\n            } else {\n                int64_t x_208959 = sub64(gtid_208945, (int64_t) 1);\n                int64_t x_208960 = mul64(jump_s_203581, x_208959);\n              ",
            "  int64_t min_arg_208961 = add64((int64_t) 1, x_208960);\n                int64_t min_res_208962 = smin64(defunc_0_f_res_203721,\n                                                min_arg_208961);\n                \n                defunc_0_m_fun_res_f_res_208957 = min_res_208962;\n            }\n            defunc_0_m_fun_res_208954 = defunc_0_m_fun_res_f_res_208957;\n        }\n        \n        bool init_idx_208963;\n        int64_t init_idx_208964;\n        int64_t init_idx_208965;\n        bool loop_while_208966;\n        int64_t low_208967;\n        int64_t high_208968;\n        \n        loop_while_208966 = x_203809;\n        low_208967 = (int64_t) 0;\n        high_208968 = i_203808;\n        while (loop_while_208966) {\n            int64_t x_208969 = add64(low_208967, high_208968);\n            int64_t mid_208970 = sdiv64(x_208969, (int64_t) 2);\n            bool x_208971 = sle64((int64_t) 0, mid_208970);\n            bool y_208972 = slt64(mid_208970, defunc_0_f_res_203721);\n            bool bounds_check_208973 = x_208971 && y_208972;\n            bool index_certs_208974;\n            \n            if (!bounds_check_208973) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208970;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_208975;\n            \n            mid_id_208975 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_208944 *\n                                                              defunc_0_f_res_203721 +",
            "\n                                                              mid_208970];\n            \n            bool cond_208976 = slt64(mid_id_208975, (int64_t) 0);\n            int64_t mid_idx_208977;\n            \n            if (cond_208976) {\n                mid_idx_208977 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208977 = mid_id_208975;\n            }\n            \n            bool cond_208978 = sle64(defunc_0_m_fun_res_208954, mid_idx_208977);\n            int64_t loopres_208979;\n            int64_t loopres_208980;\n            \n            if (cond_208978) {\n                int64_t loopres_t_res_208981 = sub64(mid_208970, (int64_t) 1);\n                \n                loopres_208979 = low_208967;\n                loopres_208980 = loopres_t_res_208981;\n            } else {\n                int64_t loopres_f_res_208982 = add64((int64_t) 1, mid_208970);\n                \n                loopres_208979 = loopres_f_res_208982;\n                loopres_208980 = high_208968;\n            }\n            \n            bool loop_cond_208983 = sle64(loopres_208979, loopres_208980);\n            bool loop_while_tmp_232946 = loop_cond_208983;\n            int64_t low_tmp_232947 = loopres_208979;\n            int64_t high_tmp_232948 = loopres_208980;\n            \n            loop_while_208966 = loop_while_tmp_232946;\n            low_208967 = low_tmp_232947;\n            high_208968 = high_tmp_232948;\n        }\n        init_idx_208963 = loop_while_208966;\n        init_idx_208964 = low_208967;\n        init_idx_208965 = high_208968;\n        \n        bool idx_208984;\n        int64_t idx_208985;\n        int64_t idx_208986;\n        int64_t idx_208987;\n        bool loop_while_208988;\n        int64_t l_idx_208989;\n        int64_t r_idx_208990;\n        int64_t span_208991;\n        \n        loop_while_208988 = loop_cond_203844;\n        l_idx_208989 = init_idx_208964;\n        r_idx_208990 = init_idx_208964;\n        span_208991 = (int64_t) 1;\n        while (loop_while_208988)",
            " {\n            int64_t max_arg_208992 = sub64(l_idx_208989, (int64_t) 1);\n            int64_t max_res_208993 = smax64((int64_t) 0, max_arg_208992);\n            int64_t min_arg_208994 = add64((int64_t) 1, r_idx_208990);\n            int64_t min_res_208995 = smin64(min_arg_208948, min_arg_208994);\n            bool x_208996 = sle64((int64_t) 0, max_res_208993);\n            bool y_208997 = slt64(max_res_208993, defunc_0_f_res_203721);\n            bool bounds_check_208998 = x_208996 && y_208997;\n            bool index_certs_208999;\n            \n            if (!bounds_check_208998) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 13) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208993;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209000;\n            \n            x_209000 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208944 *\n                                                         defunc_0_f_res_203721 +\n                                                         max_res_208993];\n            \n            int64_t abs_arg_209001 = sub64(x_209000, defunc_0_m_fun_res_208954);\n            int64_t abs_res_209002 = abs64(abs_arg_209001);\n            bool x_209003 = sle64((int64_t) 0, min_res_208995);\n            bool y_209004 = slt64(min_res_208995, defunc_0_f_res_203721);\n            bool bounds_check_209005 = x_209003 && y_209004;\n            bool index_certs_209006;\n            \n            if (!bounds_check_209005) {\n                {\n                    if (atomi",
            "c_cmpxchg_i32_global(global_failure, -1, 14) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_208995;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209007;\n            \n            x_209007 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208944 *\n                                                         defunc_0_f_res_203721 +\n                                                         min_res_208995];\n            \n            int64_t abs_arg_209008 = sub64(x_209007, defunc_0_m_fun_res_208954);\n            int64_t abs_res_209009 = abs64(abs_arg_209008);\n            bool cond_209010 = max_res_208993 == l_idx_208989;\n            int64_t loopres_209011;\n            int64_t loopres_209012;\n            int64_t loopres_209013;\n            \n            if (cond_209010) {\n                loopres_209011 = l_idx_208989;\n                loopres_209012 = r_idx_208990;\n                loopres_209013 = min_res_203839;\n            } else {\n                bool cond_209014 = slt64(abs_res_209002, abs_res_209009);\n                bool cond_f_res_209015 = min_res_208995 == r_idx_208990;\n                bool x_209016 = !cond_209014;\n                bool y_209017 = cond_f_res_209015 && x_209016;\n                bool cond_209018 = cond_209014 || y_209017;\n                int64_t loopres_f_res_209019;\n                \n                if (cond_209018) {\n                    loopres_f_res_209019 = max_res_208993;\n                } else {\n                    loopres_f_res_209019 = l_idx_208989;\n                }\n                ",
            "\n                int64_t loopres_f_res_209020;\n                \n                if (cond_209018) {\n                    loopres_f_res_209020 = r_idx_208990;\n                } else {\n                    loopres_f_res_209020 = min_res_208995;\n                }\n                \n                int64_t loopres_f_res_209021;\n                \n                if (cond_209018) {\n                    int64_t loopres_f_res_t_res_209022 = add64((int64_t) 1,\n                                                               span_208991);\n                    \n                    loopres_f_res_209021 = loopres_f_res_t_res_209022;\n                } else {\n                    int64_t loopres_f_res_f_res_209023 = add64((int64_t) 1,\n                                                               span_208991);\n                    \n                    loopres_f_res_209021 = loopres_f_res_f_res_209023;\n                }\n                loopres_209011 = loopres_f_res_209019;\n                loopres_209012 = loopres_f_res_209020;\n                loopres_209013 = loopres_f_res_209021;\n            }\n            \n            bool loop_cond_209024 = slt64(loopres_209013, min_res_203839);\n            bool loop_while_tmp_232949 = loop_cond_209024;\n            int64_t l_idx_tmp_232950 = loopres_209011;\n            int64_t r_idx_tmp_232951 = loopres_209012;\n            int64_t span_tmp_232952 = loopres_209013;\n            \n            loop_while_208988 = loop_while_tmp_232949;\n            l_idx_208989 = l_idx_tmp_232950;\n            r_idx_208990 = r_idx_tmp_232951;\n            span_208991 = span_tmp_232952;\n        }\n        idx_208984 = loop_while_208988;\n        idx_208985 = l_idx_208989;\n        idx_208986 = r_idx_208990;\n        idx_208987 = span_208991;\n        \n        int64_t min_res_209025 = smin64(min_arg_208949, idx_208985);\n        int64_t max_res_209026 = smax64((int64_t) 0, min_res_209025);\n        int64_t defunc_0_m_fun_res_209027;\n        \n        if (cond_208953) {\n            defunc_0_m",
            "_fun_res_209027 = (int64_t) 0;\n        } else {\n            int64_t y_209028 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_209029 = gtid_208945 == y_209028;\n            int64_t defunc_0_m_fun_res_f_res_209030;\n            \n            if (cond_209029) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_209031 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_209030 =\n                    defunc_0_m_fun_res_f_res_t_res_209031;\n            } else {\n                int64_t x_209032 = sub64(gtid_208945, (int64_t) 1);\n                int64_t x_209033 = mul64(jump_s_203581, x_209032);\n                int64_t min_arg_209034 = add64((int64_t) 1, x_209033);\n                int64_t min_res_209035 = smin64(defunc_0_f_res_203721,\n                                                min_arg_209034);\n                \n                defunc_0_m_fun_res_f_res_209030 = min_res_209035;\n            }\n            defunc_0_m_fun_res_209027 = defunc_0_m_fun_res_f_res_209030;\n        }\n        \n        int64_t x_209036 = add64(min_res_208950, max_res_209026);\n        int64_t r_209037 = sub64(x_209036, (int64_t) 1);\n        bool x_209038 = sle64((int64_t) 0, r_209037);\n        bool y_209039 = slt64(r_209037, defunc_0_f_res_203721);\n        bool bounds_check_209040 = x_209038 && y_209039;\n        bool index_certs_209041;\n        \n        if (!bounds_check_209040) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 15) == -1) {\n                    global_failure_args[0] = (int64_t) r_209037;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209042;\n        \n        x_209042 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                     (defunc_0_f_res_203721 *\n                                       ",
            "               n_p_203574) +\n                                                     gtid_208944 *\n                                                     defunc_0_f_res_203721 +\n                                                     r_209037];\n        \n        int64_t abs_arg_209043 = sub64(x_209042, defunc_0_m_fun_res_209027);\n        int64_t abs_res_209044 = abs64(abs_arg_209043);\n        bool x_209045 = sle64((int64_t) 0, max_res_209026);\n        bool y_209046 = slt64(max_res_209026, defunc_0_f_res_203721);\n        bool bounds_check_209047 = x_209045 && y_209046;\n        bool index_certs_209048;\n        \n        if (!bounds_check_209047) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 16) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209026;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209049;\n        \n        x_209049 = ((__global int64_t *) mem_229439)[gtid_208943 *\n                                                     (defunc_0_f_res_203721 *\n                                                      n_p_203574) +\n                                                     gtid_208944 *\n                                                     defunc_0_f_res_203721 +\n                                                     max_res_209026];\n        \n        int64_t abs_arg_209050 = sub64(x_209049, defunc_0_m_fun_res_209027);\n        int64_t abs_res_209051 = abs64(abs_arg_209050);\n        int64_t max_res_209052 = smax64(abs_res_209044, abs_res_209051);\n        double defunc_0_f_res_209053 = sitofp_i64_f64(max_res_209052);\n        double defunc_1_f_res_209054 = max_res_208951 + defunc_0_f_res_209053;\n        \n        ((__global double *) mem_229462)[gtid_208943 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                        ",
            " gtid_208944 * s_n_m_203726 +\n                                         gtid_208945] = defunc_1_f_res_209054;\n        ((__global int64_t *) mem_229467)[gtid_208943 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_208944 * s_n_m_203726 +\n                                          gtid_208945] = max_res_209026;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208939\n}\n__kernel void mainzisegmap_209556(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229496)\n{\n    #define segmap_group_sizze_209551 (mainzisegmap_group_sizze_209527)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232979;\n    int32_t local_tid_232980;\n    int64_t group_sizze_232983;\n    int32_t wave_sizze_232982;\n    int32_t group_tid_232981;\n    \n    global_tid_232979 = get_global_id(0);\n    local_tid_232980 = get_local_id(0);\n    group_sizze_232983 = get_local_size(0);\n    wave_sizze_232982 = LOCKSTEP_WIDTH;\n    group_tid_232981 = get_group_id(0);\n    \n    int32_t phys_tid_209556 = global_tid_232979;\n    int64_t global_tid_232984 = sext_i32_i64(group_tid_232981) *\n            segmap_group_sizze_209551 + sext_i32_i64(local_tid_232980);\n    int64_t slice_232985 = n_203572;\n    int64_t slice_232986 = partition_sizze_203667 * slice_232985;\n    int64_t gtid_209554 = squot64(global_tid_232984, slice_232985);\n    int64_t remnant_232987 = global_tid_232984 - gtid_209554 * slice_232985;\n    int64_t gtid_209555 = remnant_232987;\n    int64_t remnant_232988 = remnant_232987 - gtid_209555;\n    \n    if (slt64(gtid_209554, partition_sizze_203667) && slt64(gtid_20955",
            "5,\n                                                            n_203572)) {\n        int64_t x_209557;\n        \n        x_209557 = ((__global int64_t *) ext_mem_229305)[gtid_209554 *\n                                                         n_203572 +\n                                                         gtid_209555];\n        \n        int64_t defunc_0_f_res_209558 = add64((int64_t) 1, x_209557);\n        \n        ((__global int64_t *) mem_229496)[gtid_209554 * n_203572 +\n                                          gtid_209555] = defunc_0_f_res_209558;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209551\n}\n__kernel void mainzisegmap_209568(__global int *global_failure,\n                                  int64_t q_l_203577,\n                                  int64_t partition_sizze_203667,\n                                  int64_t min_res_203971, double i64_res_203977,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *mem_229500, __global\n                                  unsigned char *mem_229503, __global\n                                  unsigned char *mem_229506, __global\n                                  unsigned char *mem_229509)\n{\n    #define segmap_group_sizze_209561 (mainzisegmap_group_sizze_209501)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232989;\n    int32_t local_tid_232990;\n    int64_t group_sizze_232993;\n    int32_t wave_sizze_232992;\n    int32_t group_tid_232991;\n    \n    global_tid_232989 = get_global_id(0);\n    local_tid_232990 = get_local_id(0);\n    group_sizze_232993 = get_local_size(0);\n    wave_sizze_232992 = LOCKSTEP_WIDTH;\n    group_tid_232991 = get_group_id(0);\n    \n    int32_t phys_tid_209568 = global_tid_232989;\n    int64_t global_tid_232994 = sext_i32_i64(group_tid_232991) *\n            segmap_group_sizze_209561 + sex",
            "t_i32_i64(local_tid_232990);\n    int64_t slice_232995 = partition_sizze_203667;\n    int64_t gtid_209567 = global_tid_232994;\n    int64_t remnant_232996 = global_tid_232994 - gtid_209567;\n    \n    if (slt64(gtid_209567, partition_sizze_203667)) {\n        int64_t x_209569;\n        \n        x_209569 = ((__global int64_t *) ext_mem_229304)[gtid_209567];\n        \n        int64_t min_arg_209570 = sub64(x_209569, (int64_t) 1);\n        int64_t min_arg_209571 = sub64(x_209569, min_res_203971);\n        int64_t min_res_209572 = smin64(q_l_203577, x_209569);\n        double i64_res_209573 = sitofp_i64_f64(x_209569);\n        double x_209574 = i64_res_203977 - i64_res_209573;\n        double max_arg_209575 = x_209574 / 2.0;\n        double max_res_209576 = fmax64(0.0, max_arg_209575);\n        \n        ((__global int64_t *) mem_229500)[gtid_209567] = min_arg_209570;\n        ((__global int64_t *) mem_229503)[gtid_209567] = min_arg_209571;\n        ((__global int64_t *) mem_229506)[gtid_209567] = min_res_209572;\n        ((__global double *) mem_229509)[gtid_209567] = max_res_209576;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209561\n}\n__kernel void mainzisegmap_209589(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_l_203583,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  unsigned char x_203761_bits,\n                                  int64_t min_res_203971,\n                                  unsigned char loop_cond_203976_bits, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229496, __global\n                                  unsigned char *mem_229500, __global\n                     ",
            "             unsigned char *mem_229503, __global\n                                  unsigned char *mem_229506, __global\n                                  unsigned char *mem_229509, __global\n                                  unsigned char *mem_229514, __global\n                                  unsigned char *mem_229518)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_203976 = loop_cond_203976_bits;\n    \n    #define segmap_group_sizze_209583 (mainzisegmap_group_sizze_209297)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232997;\n    int32_t local_tid_232998;\n    int64_t group_sizze_233001;\n    int32_t wave_sizze_233000;\n    int32_t group_tid_232999;\n    \n    global_tid_232997 = get_global_id(0);\n    local_tid_232998 = get_local_id(0);\n    group_sizze_233001 = get_local_size(0);\n    wave_sizze_233000 = LOCKSTEP_WIDTH;\n    group_tid_232999 = get_group_id(0);\n    \n    int32_t phys_tid_209589 = global_tid_232997;\n    int64_t global_tid_233002 = sext_i32_i64(group_tid_232999) *\n            segmap_group_sizze_209583 + sext_i32_i64(local_tid_232998);\n    int64_t slice_233003 = l_n_m_203733;\n    int64_t slice_233004 = partition_sizze_203667 * slice_233003;\n    int64_t gtid_209587 = squot64(global_tid_233002, slice_233003);\n    int64_t remnant_233005 = global_tid_233002 - gtid_209587 * slice_233003;\n    int64_t gtid_209588 = remnant_233005;\n    int64_t remnant_233006 = remnant_233005 - gtid_209588;\n    \n    if (slt64(gtid_209587, partition_sizze_203667) && slt64(gtid_209588,\n                                                            l_n_m_203733)) {\n        int64_t min_arg_209592;\n        \n        min_arg_209592 = ((__global int64_t *) mem_229500)[gtid_209587];\n        \n        int64_t min_arg_209593;\n        \n        min_arg_209593 = ((__global int64_t *) mem_229503)[gtid_209587];\n        \n        int64_t min_res_209594;\n        \n        min_r",
            "es_209594 = ((__global int64_t *) mem_229506)[gtid_209587];\n        \n        double max_res_209595;\n        \n        max_res_209595 = ((__global double *) mem_229509)[gtid_209587];\n        \n        int64_t min_arg_209597 = mul64(jump_l_203583, gtid_209588);\n        int64_t min_res_209598 = smin64(i_203760, min_arg_209597);\n        int64_t defunc_0_g_res_209599 = add64((int64_t) 1, min_res_209598);\n        bool init_idx_209600;\n        int64_t init_idx_209601;\n        int64_t init_idx_209602;\n        bool loop_while_209603;\n        int64_t low_209604;\n        int64_t high_209605;\n        \n        loop_while_209603 = x_203761;\n        low_209604 = (int64_t) 0;\n        high_209605 = i_203760;\n        while (loop_while_209603) {\n            int64_t x_209606 = add64(low_209604, high_209605);\n            int64_t mid_209607 = sdiv64(x_209606, (int64_t) 2);\n            bool x_209608 = sle64((int64_t) 0, mid_209607);\n            bool y_209609 = slt64(mid_209607, n_203572);\n            bool bounds_check_209610 = x_209608 && y_209609;\n            bool index_certs_209611;\n            \n            if (!bounds_check_209610) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 22) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209607;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_209612;\n            \n            mid_id_209612 = ((__global int64_t *) mem_229496)[gtid_209587 *\n                                                              n_203572 +\n                                                              mid_209607];\n            \n            bool cond_209613 = slt64(mid_id_209612, (int64_t) 0);\n            int64_t mid_idx_209614;\n            \n            if (cond_209613) {\n                mid_idx_209614 = (int64_t) 9223372036",
            "854775807;\n            } else {\n                mid_idx_209614 = mid_id_209612;\n            }\n            \n            bool cond_209615 = sle64(defunc_0_g_res_209599, mid_idx_209614);\n            int64_t loopres_209616;\n            int64_t loopres_209617;\n            \n            if (cond_209615) {\n                int64_t loopres_t_res_209618 = sub64(mid_209607, (int64_t) 1);\n                \n                loopres_209616 = low_209604;\n                loopres_209617 = loopres_t_res_209618;\n            } else {\n                int64_t loopres_f_res_209619 = add64((int64_t) 1, mid_209607);\n                \n                loopres_209616 = loopres_f_res_209619;\n                loopres_209617 = high_209605;\n            }\n            \n            bool loop_cond_209620 = sle64(loopres_209616, loopres_209617);\n            bool loop_while_tmp_233007 = loop_cond_209620;\n            int64_t low_tmp_233008 = loopres_209616;\n            int64_t high_tmp_233009 = loopres_209617;\n            \n            loop_while_209603 = loop_while_tmp_233007;\n            low_209604 = low_tmp_233008;\n            high_209605 = high_tmp_233009;\n        }\n        init_idx_209600 = loop_while_209603;\n        init_idx_209601 = low_209604;\n        init_idx_209602 = high_209605;\n        \n        bool idx_209621;\n        int64_t idx_209622;\n        int64_t idx_209623;\n        int64_t idx_209624;\n        bool loop_while_209625;\n        int64_t l_idx_209626;\n        int64_t r_idx_209627;\n        int64_t span_209628;\n        \n        loop_while_209625 = loop_cond_203976;\n        l_idx_209626 = init_idx_209601;\n        r_idx_209627 = init_idx_209601;\n        span_209628 = (int64_t) 1;\n        while (loop_while_209625) {\n            int64_t max_arg_209629 = sub64(l_idx_209626, (int64_t) 1);\n            int64_t max_res_209630 = smax64((int64_t) 0, max_arg_209629);\n            int64_t min_arg_209631 = add64((int64_t) 1, r_idx_209627);\n            int64_t min_res_209632 = smin64(min_arg_209592, min_arg_20963",
            "1);\n            bool x_209633 = sle64((int64_t) 0, max_res_209630);\n            bool y_209634 = slt64(max_res_209630, n_203572);\n            bool bounds_check_209635 = x_209633 && y_209634;\n            bool index_certs_209636;\n            \n            if (!bounds_check_209635) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 23) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209630;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209637;\n            \n            x_209637 = ((__global int64_t *) mem_229496)[gtid_209587 *\n                                                         n_203572 +\n                                                         max_res_209630];\n            \n            int64_t abs_arg_209638 = sub64(x_209637, defunc_0_g_res_209599);\n            int64_t abs_res_209639 = abs64(abs_arg_209638);\n            bool x_209640 = sle64((int64_t) 0, min_res_209632);\n            bool y_209641 = slt64(min_res_209632, n_203572);\n            bool bounds_check_209642 = x_209640 && y_209641;\n            bool index_certs_209643;\n            \n            if (!bounds_check_209642) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 24) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209632;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209644;\n            \n            x_209644 = ((__global int64_t *) mem_229496)[gtid_209587 *\n                                                         n_203572 +\n                                                         min_res_209632];\n  ",
            "          \n            int64_t abs_arg_209645 = sub64(x_209644, defunc_0_g_res_209599);\n            int64_t abs_res_209646 = abs64(abs_arg_209645);\n            bool cond_209647 = max_res_209630 == l_idx_209626;\n            int64_t loopres_209648;\n            int64_t loopres_209649;\n            int64_t loopres_209650;\n            \n            if (cond_209647) {\n                loopres_209648 = l_idx_209626;\n                loopres_209649 = r_idx_209627;\n                loopres_209650 = min_res_203971;\n            } else {\n                bool cond_209651 = slt64(abs_res_209639, abs_res_209646);\n                bool cond_f_res_209652 = min_res_209632 == r_idx_209627;\n                bool x_209653 = !cond_209651;\n                bool y_209654 = cond_f_res_209652 && x_209653;\n                bool cond_209655 = cond_209651 || y_209654;\n                int64_t loopres_f_res_209656;\n                \n                if (cond_209655) {\n                    loopres_f_res_209656 = max_res_209630;\n                } else {\n                    loopres_f_res_209656 = l_idx_209626;\n                }\n                \n                int64_t loopres_f_res_209657;\n                \n                if (cond_209655) {\n                    loopres_f_res_209657 = r_idx_209627;\n                } else {\n                    loopres_f_res_209657 = min_res_209632;\n                }\n                \n                int64_t loopres_f_res_209658;\n                \n                if (cond_209655) {\n                    int64_t loopres_f_res_t_res_209659 = add64((int64_t) 1,\n                                                               span_209628);\n                    \n                    loopres_f_res_209658 = loopres_f_res_t_res_209659;\n                } else {\n                    int64_t loopres_f_res_f_res_209660 = add64((int64_t) 1,\n                                                               span_209628);\n                    \n                    loopres_f_res_209658 = loopres_f_res_f_res_2096",
            "60;\n                }\n                loopres_209648 = loopres_f_res_209656;\n                loopres_209649 = loopres_f_res_209657;\n                loopres_209650 = loopres_f_res_209658;\n            }\n            \n            bool loop_cond_209661 = slt64(loopres_209650, min_res_203971);\n            bool loop_while_tmp_233010 = loop_cond_209661;\n            int64_t l_idx_tmp_233011 = loopres_209648;\n            int64_t r_idx_tmp_233012 = loopres_209649;\n            int64_t span_tmp_233013 = loopres_209650;\n            \n            loop_while_209625 = loop_while_tmp_233010;\n            l_idx_209626 = l_idx_tmp_233011;\n            r_idx_209627 = r_idx_tmp_233012;\n            span_209628 = span_tmp_233013;\n        }\n        idx_209621 = loop_while_209625;\n        idx_209622 = l_idx_209626;\n        idx_209623 = r_idx_209627;\n        idx_209624 = span_209628;\n        \n        int64_t min_res_209662 = smin64(min_arg_209593, idx_209622);\n        int64_t max_res_209663 = smax64((int64_t) 0, min_res_209662);\n        int64_t x_209664 = add64(min_res_209594, max_res_209663);\n        int64_t r_209665 = sub64(x_209664, (int64_t) 1);\n        bool x_209666 = sle64((int64_t) 0, r_209665);\n        bool y_209667 = slt64(r_209665, n_203572);\n        bool bounds_check_209668 = x_209666 && y_209667;\n        bool index_certs_209669;\n        \n        if (!bounds_check_209668) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 25) == -1) {\n                    global_failure_args[0] = (int64_t) r_209665;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209670;\n        \n        x_209670 = ((__global int64_t *) ext_mem_229305)[gtid_209587 *\n                                                         n_203572 + r_209665];\n        \n        int64_t abs_arg_209671 = sub64(x_209670, min_res_209598);\n        int64_t abs_res_209672 = abs64(abs",
            "_arg_209671);\n        bool x_209673 = sle64((int64_t) 0, max_res_209663);\n        bool y_209674 = slt64(max_res_209663, n_203572);\n        bool bounds_check_209675 = x_209673 && y_209674;\n        bool index_certs_209676;\n        \n        if (!bounds_check_209675) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 26) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209663;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209677;\n        \n        x_209677 = ((__global int64_t *) ext_mem_229305)[gtid_209587 *\n                                                         n_203572 +\n                                                         max_res_209663];\n        \n        int64_t abs_arg_209678 = sub64(x_209677, min_res_209598);\n        int64_t abs_res_209679 = abs64(abs_arg_209678);\n        int64_t max_res_209680 = smax64(abs_res_209672, abs_res_209679);\n        double defunc_0_f_res_209681 = sitofp_i64_f64(max_res_209680);\n        double defunc_1_f_res_209682 = max_res_209595 + defunc_0_f_res_209681;\n        \n        ((__global double *) mem_229514)[gtid_209587 * l_n_m_203733 +\n                                         gtid_209588] = defunc_1_f_res_209682;\n        ((__global int64_t *) mem_229518)[gtid_209587 * l_n_m_203733 +\n                                          gtid_209588] = max_res_209663;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209583\n}\n__kernel void mainzisegmap_210182(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229545)\n{\n    #define segmap_group_sizze_210177 (mainzisegmap_group_sizze_210153)\n    \n    const int block_dim0 =",
            " 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233039;\n    int32_t local_tid_233040;\n    int64_t group_sizze_233043;\n    int32_t wave_sizze_233042;\n    int32_t group_tid_233041;\n    \n    global_tid_233039 = get_global_id(0);\n    local_tid_233040 = get_local_id(0);\n    group_sizze_233043 = get_local_size(0);\n    wave_sizze_233042 = LOCKSTEP_WIDTH;\n    group_tid_233041 = get_group_id(0);\n    \n    int32_t phys_tid_210182 = global_tid_233039;\n    int64_t global_tid_233044 = sext_i32_i64(group_tid_233041) *\n            segmap_group_sizze_210177 + sext_i32_i64(local_tid_233040);\n    int64_t slice_233045 = n_203572;\n    int64_t slice_233046 = partition_sizze_203667 * slice_233045;\n    int64_t gtid_210180 = squot64(global_tid_233044, slice_233045);\n    int64_t remnant_233047 = global_tid_233044 - gtid_210180 * slice_233045;\n    int64_t gtid_210181 = remnant_233047;\n    int64_t remnant_233048 = remnant_233047 - gtid_210181;\n    \n    if (slt64(gtid_210180, partition_sizze_203667) && slt64(gtid_210181,\n                                                            n_203572)) {\n        int64_t x_210183;\n        \n        x_210183 = ((__global int64_t *) ext_mem_229305)[gtid_210180 *\n                                                         n_203572 +\n                                                         gtid_210181];\n        \n        int64_t defunc_0_f_res_210184 = add64((int64_t) 1, x_210183);\n        \n        ((__global int64_t *) mem_229545)[gtid_210180 * n_203572 +\n                                          gtid_210181] = defunc_0_f_res_210184;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210177\n}\n__kernel void mainzisegmap_210194(__global int *global_failure,\n                                  int64_t q_t_203576,\n                                  int64_t partition_sizze_203667,\n                                  int64_t min_res_204083, double i64_res_204089,\n      ",
            "                            __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *mem_229549, __global\n                                  unsigned char *mem_229552, __global\n                                  unsigned char *mem_229555, __global\n                                  unsigned char *mem_229558)\n{\n    #define segmap_group_sizze_210187 (mainzisegmap_group_sizze_210127)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233049;\n    int32_t local_tid_233050;\n    int64_t group_sizze_233053;\n    int32_t wave_sizze_233052;\n    int32_t group_tid_233051;\n    \n    global_tid_233049 = get_global_id(0);\n    local_tid_233050 = get_local_id(0);\n    group_sizze_233053 = get_local_size(0);\n    wave_sizze_233052 = LOCKSTEP_WIDTH;\n    group_tid_233051 = get_group_id(0);\n    \n    int32_t phys_tid_210194 = global_tid_233049;\n    int64_t global_tid_233054 = sext_i32_i64(group_tid_233051) *\n            segmap_group_sizze_210187 + sext_i32_i64(local_tid_233050);\n    int64_t slice_233055 = partition_sizze_203667;\n    int64_t gtid_210193 = global_tid_233054;\n    int64_t remnant_233056 = global_tid_233054 - gtid_210193;\n    \n    if (slt64(gtid_210193, partition_sizze_203667)) {\n        int64_t x_210195;\n        \n        x_210195 = ((__global int64_t *) ext_mem_229304)[gtid_210193];\n        \n        int64_t min_arg_210196 = sub64(x_210195, (int64_t) 1);\n        int64_t min_arg_210197 = sub64(x_210195, min_res_204083);\n        int64_t min_res_210198 = smin64(q_t_203576, x_210195);\n        double i64_res_210199 = sitofp_i64_f64(x_210195);\n        double x_210200 = i64_res_204089 - i64_res_210199;\n        double max_arg_210201 = x_210200 / 2.0;\n        double max_res_210202 = fmax64(0.0, max_arg_210201);\n        \n        ((__global int64_t *) mem_229549)[gtid_210193] = min_arg_210196;\n        ((__global int64_t *) mem_22955",
            "2)[gtid_210193] = min_arg_210197;\n        ((__global int64_t *) mem_229555)[gtid_210193] = min_res_210198;\n        ((__global double *) mem_229558)[gtid_210193] = max_res_210202;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210187\n}\n__kernel void mainzisegmap_210215(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  unsigned char x_203761_bits,\n                                  int64_t min_res_204083,\n                                  unsigned char loop_cond_204088_bits, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_229545, __global\n                                  unsigned char *mem_229549, __global\n                                  unsigned char *mem_229552, __global\n                                  unsigned char *mem_229555, __global\n                                  unsigned char *mem_229558, __global\n                                  unsigned char *mem_229563, __global\n                                  unsigned char *mem_229567)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_204088 = loop_cond_204088_bits;\n    \n    #define segmap_group_sizze_210209 (mainzisegmap_group_sizze_209923)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_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_210215 = global_tid_233057;\n    int64_t global_tid_233062 = sext_i32_i64(group_tid_233059) *\n            segmap_group_sizze_210209 + sext_i32_i64(local_tid_233058);\n    int64_t slice_233063 = t_n_m_203740;\n    int64_t slice_233064 = partition_sizze_203667 * slice_233063;\n    int64_t gtid_210213 = squot64(global_tid_233062, slice_233063);\n    int64_t remnant_233065 = global_tid_233062 - gtid_210213 * slice_233063;\n    int64_t gtid_210214 = remnant_233065;\n    int64_t remnant_233066 = remnant_233065 - gtid_210214;\n    \n    if (slt64(gtid_210213, partition_sizze_203667) && slt64(gtid_210214,\n                                                            t_n_m_203740)) {\n        int64_t min_arg_210218;\n        \n        min_arg_210218 = ((__global int64_t *) mem_229549)[gtid_210213];\n        \n        int64_t min_arg_210219;\n        \n        min_arg_210219 = ((__global int64_t *) mem_229552)[gtid_210213];\n        \n        int64_t min_res_210220;\n        \n        min_res_210220 = ((__global int64_t *) mem_229555)[gtid_210213];\n        \n        double max_res_210221;\n        \n        max_res_210221 = ((__global double *) mem_229558)[gtid_210213];\n        \n        int64_t min_arg_210223 = mul64(jump_t_203582, gtid_210214);\n        int64_t min_res_210224 = smin64(i_203760, min_arg_210223);\n        int64_t defunc_0_g_res_210225 = add64((int64_t) 1, min_res_210224);\n        bool init_idx_210226;\n        int64_t init_idx_210227;\n        int64_t init_idx_210228;\n        bool loop_while_210229;\n        int64_t low_210230;\n        int64_t high_210231;\n        \n        loop_while_210229 = x_203761;\n        low_210230 = (int64_t) 0;\n        high_210231 = i_203760;\n        while (loop_while_210229) {\n            int64_t x_210232 = add64(low_210230, high_210231);\n            int64_t mid_210233 = sdiv64(x_210232, (int64_t) 2);\n            bool x_210234 = sle64((int",
            "64_t) 0, mid_210233);\n            bool y_210235 = slt64(mid_210233, n_203572);\n            bool bounds_check_210236 = x_210234 && y_210235;\n            bool index_certs_210237;\n            \n            if (!bounds_check_210236) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 32) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_210233;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_210238;\n            \n            mid_id_210238 = ((__global int64_t *) mem_229545)[gtid_210213 *\n                                                              n_203572 +\n                                                              mid_210233];\n            \n            bool cond_210239 = slt64(mid_id_210238, (int64_t) 0);\n            int64_t mid_idx_210240;\n            \n            if (cond_210239) {\n                mid_idx_210240 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_210240 = mid_id_210238;\n            }\n            \n            bool cond_210241 = sle64(defunc_0_g_res_210225, mid_idx_210240);\n            int64_t loopres_210242;\n            int64_t loopres_210243;\n            \n            if (cond_210241) {\n                int64_t loopres_t_res_210244 = sub64(mid_210233, (int64_t) 1);\n                \n                loopres_210242 = low_210230;\n                loopres_210243 = loopres_t_res_210244;\n            } else {\n                int64_t loopres_f_res_210245 = add64((int64_t) 1, mid_210233);\n                \n                loopres_210242 = loopres_f_res_210245;\n                loopres_210243 = high_210231;\n            }\n            \n            bool loop_cond_210246 = sle64(loopres_210242, loopres_210243);\n            bool loop_while_tmp_233067 = loop_cond_210246;\n            int64_t low_t",
            "mp_233068 = loopres_210242;\n            int64_t high_tmp_233069 = loopres_210243;\n            \n            loop_while_210229 = loop_while_tmp_233067;\n            low_210230 = low_tmp_233068;\n            high_210231 = high_tmp_233069;\n        }\n        init_idx_210226 = loop_while_210229;\n        init_idx_210227 = low_210230;\n        init_idx_210228 = high_210231;\n        \n        bool idx_210247;\n        int64_t idx_210248;\n        int64_t idx_210249;\n        int64_t idx_210250;\n        bool loop_while_210251;\n        int64_t l_idx_210252;\n        int64_t r_idx_210253;\n        int64_t span_210254;\n        \n        loop_while_210251 = loop_cond_204088;\n        l_idx_210252 = init_idx_210227;\n        r_idx_210253 = init_idx_210227;\n        span_210254 = (int64_t) 1;\n        while (loop_while_210251) {\n            int64_t max_arg_210255 = sub64(l_idx_210252, (int64_t) 1);\n            int64_t max_res_210256 = smax64((int64_t) 0, max_arg_210255);\n            int64_t min_arg_210257 = add64((int64_t) 1, r_idx_210253);\n            int64_t min_res_210258 = smin64(min_arg_210218, min_arg_210257);\n            bool x_210259 = sle64((int64_t) 0, max_res_210256);\n            bool y_210260 = slt64(max_res_210256, n_203572);\n            bool bounds_check_210261 = x_210259 && y_210260;\n            bool index_certs_210262;\n            \n            if (!bounds_check_210261) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_210256;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210263;\n            \n            x_210263 = ((__global int64_t *) mem_229545)[gtid_210213 *\n                                                         n_203572 +\n                                                ",
            "         max_res_210256];\n            \n            int64_t abs_arg_210264 = sub64(x_210263, defunc_0_g_res_210225);\n            int64_t abs_res_210265 = abs64(abs_arg_210264);\n            bool x_210266 = sle64((int64_t) 0, min_res_210258);\n            bool y_210267 = slt64(min_res_210258, n_203572);\n            bool bounds_check_210268 = x_210266 && y_210267;\n            bool index_certs_210269;\n            \n            if (!bounds_check_210268) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 34) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_210258;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210270;\n            \n            x_210270 = ((__global int64_t *) mem_229545)[gtid_210213 *\n                                                         n_203572 +\n                                                         min_res_210258];\n            \n            int64_t abs_arg_210271 = sub64(x_210270, defunc_0_g_res_210225);\n            int64_t abs_res_210272 = abs64(abs_arg_210271);\n            bool cond_210273 = max_res_210256 == l_idx_210252;\n            int64_t loopres_210274;\n            int64_t loopres_210275;\n            int64_t loopres_210276;\n            \n            if (cond_210273) {\n                loopres_210274 = l_idx_210252;\n                loopres_210275 = r_idx_210253;\n                loopres_210276 = min_res_204083;\n            } else {\n                bool cond_210277 = slt64(abs_res_210265, abs_res_210272);\n                bool cond_f_res_210278 = min_res_210258 == r_idx_210253;\n                bool x_210279 = !cond_210277;\n                bool y_210280 = cond_f_res_210278 && x_210279;\n                bool cond_210281 = cond_210277 || y_210280;\n                int64_t loopres_f_res_210282;\n           ",
            "     \n                if (cond_210281) {\n                    loopres_f_res_210282 = max_res_210256;\n                } else {\n                    loopres_f_res_210282 = l_idx_210252;\n                }\n                \n                int64_t loopres_f_res_210283;\n                \n                if (cond_210281) {\n                    loopres_f_res_210283 = r_idx_210253;\n                } else {\n                    loopres_f_res_210283 = min_res_210258;\n                }\n                \n                int64_t loopres_f_res_210284;\n                \n                if (cond_210281) {\n                    int64_t loopres_f_res_t_res_210285 = add64((int64_t) 1,\n                                                               span_210254);\n                    \n                    loopres_f_res_210284 = loopres_f_res_t_res_210285;\n                } else {\n                    int64_t loopres_f_res_f_res_210286 = add64((int64_t) 1,\n                                                               span_210254);\n                    \n                    loopres_f_res_210284 = loopres_f_res_f_res_210286;\n                }\n                loopres_210274 = loopres_f_res_210282;\n                loopres_210275 = loopres_f_res_210283;\n                loopres_210276 = loopres_f_res_210284;\n            }\n            \n            bool loop_cond_210287 = slt64(loopres_210276, min_res_204083);\n            bool loop_while_tmp_233070 = loop_cond_210287;\n            int64_t l_idx_tmp_233071 = loopres_210274;\n            int64_t r_idx_tmp_233072 = loopres_210275;\n            int64_t span_tmp_233073 = loopres_210276;\n            \n            loop_while_210251 = loop_while_tmp_233070;\n            l_idx_210252 = l_idx_tmp_233071;\n            r_idx_210253 = r_idx_tmp_233072;\n            span_210254 = span_tmp_233073;\n        }\n        idx_210247 = loop_while_210251;\n        idx_210248 = l_idx_210252;\n        idx_210249 = r_idx_210253;\n        idx_210250 = span_210254;\n        \n        int64_t min_res_",
            "210288 = smin64(min_arg_210219, idx_210248);\n        int64_t max_res_210289 = smax64((int64_t) 0, min_res_210288);\n        int64_t x_210290 = add64(min_res_210220, max_res_210289);\n        int64_t r_210291 = sub64(x_210290, (int64_t) 1);\n        bool x_210292 = sle64((int64_t) 0, r_210291);\n        bool y_210293 = slt64(r_210291, n_203572);\n        bool bounds_check_210294 = x_210292 && y_210293;\n        bool index_certs_210295;\n        \n        if (!bounds_check_210294) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 35) == -1) {\n                    global_failure_args[0] = (int64_t) r_210291;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210296;\n        \n        x_210296 = ((__global int64_t *) ext_mem_229305)[gtid_210213 *\n                                                         n_203572 + r_210291];\n        \n        int64_t abs_arg_210297 = sub64(x_210296, min_res_210224);\n        int64_t abs_res_210298 = abs64(abs_arg_210297);\n        bool x_210299 = sle64((int64_t) 0, max_res_210289);\n        bool y_210300 = slt64(max_res_210289, n_203572);\n        bool bounds_check_210301 = x_210299 && y_210300;\n        bool index_certs_210302;\n        \n        if (!bounds_check_210301) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 36) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_210289;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210303;\n        \n        x_210303 = ((__global int64_t *) ext_mem_229305)[gtid_210213 *\n                                                         n_203572 +\n                                                         max_res_210289];\n        \n        int64_t abs_arg_210304 = sub64(x_210303, mi",
            "n_res_210224);\n        int64_t abs_res_210305 = abs64(abs_arg_210304);\n        int64_t max_res_210306 = smax64(abs_res_210298, abs_res_210305);\n        double defunc_0_f_res_210307 = sitofp_i64_f64(max_res_210306);\n        double defunc_1_f_res_210308 = max_res_210221 + defunc_0_f_res_210307;\n        \n        ((__global double *) mem_229563)[gtid_210213 * t_n_m_203740 +\n                                         gtid_210214] = defunc_1_f_res_210308;\n        ((__global int64_t *) mem_229567)[gtid_210213 * t_n_m_203740 +\n                                          gtid_210214] = max_res_210289;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210209\n}\n__kernel void mainzisegmap_210357(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229619, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_param_229623, __global\n                                  unsigned char *mem_229628)\n{\n    #define segmap_group_sizze_210352 (mainzisegmap_group_sizze_210326)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233114;\n    int32_t local_tid_233115;\n    int64_t group_sizze_233118;\n    int32_t wave_sizze_233117;\n    int32_t group_tid_233116;\n    \n    global_tid_233114 = get_global_id(0);\n    local_tid_233115 = get_local_id(0);\n    group_sizze_233118 = get_local_size(0);\n    wave_sizze_233117 = LOCKSTEP_WIDTH;\n    group_tid_233116 = get_group_id(0);\n    \n    int32_t phys_tid_210357 = global_tid_233114;\n    int64_t global_tid_233119 = sext_i32_i64(group_tid_233116) *\n            segmap_group_sizze_210352 + sext_i32_i64(local_tid_233115);\n    int64_t slice_233120 = n_203572;\n    int64_t slice_233121 = partition_sizze_203667 *",
            " slice_233120;\n    int64_t gtid_210355 = squot64(global_tid_233119, slice_233120);\n    int64_t remnant_233122 = global_tid_233119 - gtid_210355 * slice_233120;\n    int64_t gtid_210356 = remnant_233122;\n    int64_t remnant_233123 = remnant_233122 - gtid_210356;\n    \n    if (slt64(gtid_210355, partition_sizze_203667) && slt64(gtid_210356,\n                                                            n_203572)) {\n        double x_210358;\n        \n        x_210358 = ((__global double *) mem_229269)[gtid_210355 * n_203572 +\n                                                    gtid_210356];\n        \n        double x_210359;\n        \n        x_210359 = ((__global double *) mem_param_229623)[gtid_210355 *\n                                                          ctx_param_ext_229619 +\n                                                          gtid_210356];\n        \n        double defunc_1_f_res_210360 = x_210358 - x_210359;\n        \n        ((__global double *) mem_229628)[gtid_210355 * n_203572 + gtid_210356] =\n            defunc_1_f_res_210360;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210352\n}\n__kernel void mainzisegmap_210502(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_229628, __global\n   ",
            "                               unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639)\n{\n    #define segmap_group_sizze_210495 (mainzisegmap_group_sizze_210389)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233124;\n    int32_t local_tid_233125;\n    int64_t group_sizze_233128;\n    int32_t wave_sizze_233127;\n    int32_t group_tid_233126;\n    \n    global_tid_233124 = get_global_id(0);\n    local_tid_233125 = get_local_id(0);\n    group_sizze_233128 = get_local_size(0);\n    wave_sizze_233127 = LOCKSTEP_WIDTH;\n    group_tid_233126 = get_group_id(0);\n    \n    int32_t phys_tid_210502 = global_tid_233124;\n    int64_t global_tid_233129 = sext_i32_i64(group_tid_233126) *\n            segmap_group_sizze_210495 + sext_i32_i64(local_tid_233125);\n    int64_t slice_233130 = defunc_0_f_res_203721;\n    int64_t slice_233131 = n_p_203574 * slice_233130;\n    int64_t slice_233132 = partition_sizze_203667 * slice_233131;\n    int64_t gtid_210499 = squot64(global_tid_233129, slice_233131);\n    int64_t remnant_233133 = global_tid_233129 - gtid_210499 * slice_233131;\n    int64_t gtid_210500 = squot64(remnant_233133, slice_233130);\n    int64_t remnant_233134 = remnant_233133 - gtid_210500 * slice_233130;\n    int64_t gtid_210501 = remnant_233134;\n    int64_t remnant_233135 = remnant_233134 - gtid_210501;\n    \n    if ((slt64(gtid_210499, partition_sizze_203667) && slt64(gtid_210500,\n                                                             n_p_203574)) &&\n        slt64(gtid_210501, defunc_0_f_res_203721)) {\n        int64_t x_210506;\n        \n        x_210506 = ((__global int64_t *) ext_mem_229373)[gtid_210499 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_21050",
            "0 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_210501];\n        \n        int64_t x_210507 = mul64(n_p_203574, x_210506);\n        int64_t idx_210508 = add64(gtid_210500, x_210507);\n        bool cond_210509 = slt64(i_203760, idx_210508);\n        bool cond_f_res_210510 = slt64(x_210506, (int64_t) 0);\n        bool x_210511 = !cond_210509;\n        bool y_210512 = cond_f_res_210510 && x_210511;\n        bool cond_210513 = cond_210509 || y_210512;\n        double defunc_0_f_res_210514;\n        double defunc_0_f_res_210515;\n        \n        if (cond_210513) {\n            defunc_0_f_res_210514 = 0.0;\n            defunc_0_f_res_210515 = 0.0;\n        } else {\n            bool x_210516 = sle64((int64_t) 0, idx_210508);\n            bool y_210517 = slt64(idx_210508, n_203572);\n            bool bounds_check_210518 = x_210516 && y_210517;\n            bool index_certs_210519;\n            \n            if (!bounds_check_210518) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) idx_210508;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_f_res_210520;\n            \n            defunc_0_f_res_f_res_210520 = ((__global\n                                            double *) mem_229628)[gtid_210499 *\n                                                                  n_203572 +\n                                                                  idx_210508];\n            \n            double defunc_0_f_res_f_res_210521;\n            \n            defunc_0_f_res_f_res_210521 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                   ",
            "                                                     (gtid_210499 *\n                                                                         ctx_param_ext_229597 +\n                                                                         idx_210508 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_210514 = defunc_0_f_res_f_res_210520;\n            defunc_0_f_res_210515 = defunc_0_f_res_f_res_210521;\n        }\n        ((__global double *) mem_229634)[gtid_210499 * (defunc_0_f_res_203721 *\n                                                        n_p_203574) +\n                                         gtid_210500 * defunc_0_f_res_203721 +\n                                         gtid_210501] = defunc_0_f_res_210514;\n        ((__global double *) mem_229639)[gtid_210499 * (defunc_0_f_res_203721 *\n                                                        n_p_203574) +\n                                         gtid_210500 * defunc_0_f_res_203721 +\n                                         gtid_210501] = defunc_0_f_res_210515;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210495\n}\n__kernel void mainzisegmap_210632(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_210628,\n                                  int64_t num_threads_232221, __global\n                                  unsigned char *mem_229648, __global\n                                  unsigned char *mem_229651, __global\n                                  unsigned char *mem_229655, __global\n                                  unsi",
            "gned char *mem_229659, __global\n                                  unsigned char *mem_229663, __global\n                                  unsigned char *mem_229667, __global\n                                  unsigned char *mem_229716, __global\n                                  unsigned char *color_232097)\n{\n    #define segmap_group_sizze_210627 (mainzisegmap_group_sizze_210531)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233140;\n    int32_t local_tid_233141;\n    int64_t group_sizze_233144;\n    int32_t wave_sizze_233143;\n    int32_t group_tid_233142;\n    \n    global_tid_233140 = get_global_id(0);\n    local_tid_233141 = get_local_id(0);\n    group_sizze_233144 = get_local_size(0);\n    wave_sizze_233143 = LOCKSTEP_WIDTH;\n    group_tid_233142 = get_group_id(0);\n    \n    int32_t phys_tid_210632 = global_tid_233140;\n    int32_t phys_group_id_233145;\n    \n    phys_group_id_233145 = get_group_id(0);\n    for (int32_t i_233146 = 0; i_233146 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_210627)) -\n                   phys_group_id_233145, sext_i64_i32(num_groups_210628));\n         i_233146++) {\n        int32_t virt_group_id_233147 = phys_group_id_233145 + i_233146 *\n                sext_i64_i32(num_groups_210628);\n        int64_t global_tid_233148 = sext_i32_i64(virt_group_id_233147) *\n                segmap_group_sizze_210627 + sext_i32_i64(local_tid_233141);\n        int64_t slice_233149 = partition_sizze_203667;\n        int64_t gtid_210631 = global_tid_233148;\n        int64_t remnant_233150 = global_tid_233148 - gtid_210631;\n        \n        if (slt64(gtid_210631, partition_sizze_203667)) {\n            for (int64_t i_229019 = 0; i_229019 < n_p_203574; i_229019++) {\n                int64_t x_210643;\n                \n                x_210643 = ((__global int64_t *) mem_22",
            "9651)[i_229019 *\n                                                             partition_sizze_203667 +\n                                                             gtid_210631];\n                for (int64_t i_229023 = 0; i_229023 < s_n_m_203726;\n                     i_229023++) {\n                    int64_t x_210648;\n                    \n                    x_210648 = ((__global int64_t *) mem_229659)[i_229019 *\n                                                                 (partition_sizze_203667 *\n                                                                  s_n_m_203726) +\n                                                                 i_229023 *\n                                                                 partition_sizze_203667 +\n                                                                 gtid_210631];\n                    \n                    double x_210649;\n                    \n                    x_210649 = ((__global double *) mem_229648)[i_229019 *\n                                                                (partition_sizze_203667 *\n                                                                 s_n_m_203726) +\n                                                                i_229023 *\n                                                                partition_sizze_203667 +\n                                                                gtid_210631];\n                    \n                    bool cond_210650 = i_229023 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_210651;\n                    \n                    if (cond_210650) {\n                        defunc_0_m_fun_res_210651 = (int64_t) 0;\n                    } else {\n                        int64_t y_210652 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_210653 = i_229023 == y_210652;\n                        int64_t defunc_0_m_fun_res_f_res_210654;\n                        \n                        if (cond_210653) {\n                            in",
            "t64_t defunc_0_m_fun_res_f_res_t_res_210655 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210654 =\n                                defunc_0_m_fun_res_f_res_t_res_210655;\n                        } else {\n                            int64_t x_210656 = sub64(i_229023, (int64_t) 1);\n                            int64_t x_210657 = mul64(jump_s_203581, x_210656);\n                            int64_t min_arg_210658 = add64((int64_t) 1,\n                                                           x_210657);\n                            int64_t min_res_210659 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_210658);\n                            \n                            defunc_0_m_fun_res_f_res_210654 = min_res_210659;\n                        }\n                        defunc_0_m_fun_res_210651 =\n                            defunc_0_m_fun_res_f_res_210654;\n                    }\n                    \n                    double defunc_2_reduce_res_210660;\n                    double redout_228537 = 0.0;\n                    \n                    for (int64_t i_228538 = 0; i_228538 < q_s_203575;\n                         i_228538++) {\n                        bool cond_210665 = sle64(x_210643, i_228538);\n                        int64_t defunc_0_f_res_210666;\n                        \n                        if (cond_210665) {\n                            defunc_0_f_res_210666 = (int64_t) 0;\n                        } else {\n                            int64_t i_210667 = add64(x_210648, i_228538);\n                            int64_t defunc_0_add_arg_210668;\n                            \n                            defunc_0_add_arg_210668 = ((__global\n                                                        int64_t *) mem_229667)[i_229019 *\n                                                                          ",
            "     (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_210667 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_210631];\n                            \n                            int64_t defunc_1_add_res_210669 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210668);\n                            \n                            defunc_0_f_res_210666 = defunc_1_add_res_210669;\n                        }\n                        \n                        double defunc_0_f_res_210670;\n                        \n                        if (cond_210665) {\n                            defunc_0_f_res_210670 = 0.0;\n                        } else {\n                            int64_t i_210671 = add64(x_210648, i_228538);\n                            double defunc_0_add_arg_210672;\n                            \n                            defunc_0_add_arg_210672 = ((__global\n                                                        double *) mem_229655)[i_229019 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_210671 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_210631];\n                            defunc_0_f_res_210670 = defunc_0_add_arg_210672;\n                        }\n                        \n                        int64_t binop_p_210673 = sub64(defunc_0_f_r",
            "es_210666,\n                                                       defunc_0_m_fun_res_210651);\n                        double defunc_0_f_res_210674 =\n                               sitofp_i64_f64(binop_p_210673);\n                        double abs_res_210675 = fabs(defunc_0_f_res_210674);\n                        double tmp1_210676 = abs_res_210675 / x_210649;\n                        double x_210677 = tmp1_210676 * tmp1_210676;\n                        double y_210678 = tmp1_210676 * x_210677;\n                        double tmp2_210679 = 1.0 - y_210678;\n                        double x_210680 = tmp2_210679 * tmp2_210679;\n                        double tmp3_210681 = tmp2_210679 * x_210680;\n                        double w_j_210682 = defunc_0_f_res_210670 * tmp3_210681;\n                        double defunc_1_op_res_210663 = w_j_210682 +\n                               redout_228537;\n                        double redout_tmp_233153 = defunc_1_op_res_210663;\n                        \n                        redout_228537 = redout_tmp_233153;\n                    }\n                    defunc_2_reduce_res_210660 = redout_228537;\n                    \n                    double a0_210683 = 1.0 / defunc_2_reduce_res_210660;\n                    int64_t defunc_0_m_fun_res_210684;\n                    \n                    if (cond_210650) {\n                        defunc_0_m_fun_res_210684 = (int64_t) 0;\n                    } else {\n                        int64_t y_210685 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_210686 = i_229023 == y_210685;\n                        int64_t defunc_0_m_fun_res_f_res_210687;\n                        \n                        if (cond_210686) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_210688 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210687 =\n                                defunc_0_m_",
            "fun_res_f_res_t_res_210688;\n                        } else {\n                            int64_t x_210689 = sub64(i_229023, (int64_t) 1);\n                            int64_t x_210690 = mul64(jump_s_203581, x_210689);\n                            int64_t min_arg_210691 = add64((int64_t) 1,\n                                                           x_210690);\n                            int64_t min_res_210692 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_210691);\n                            \n                            defunc_0_m_fun_res_f_res_210687 = min_res_210692;\n                        }\n                        defunc_0_m_fun_res_210684 =\n                            defunc_0_m_fun_res_f_res_210687;\n                    }\n                    \n                    double defunc_2_reduce_res_210693;\n                    double redout_228539 = 0.0;\n                    \n                    for (int64_t i_228540 = 0; i_228540 < q_s_203575;\n                         i_228540++) {\n                        bool cond_210698 = sle64(x_210643, i_228540);\n                        int64_t defunc_0_f_res_210699;\n                        \n                        if (cond_210698) {\n                            defunc_0_f_res_210699 = (int64_t) 0;\n                        } else {\n                            int64_t i_210700 = add64(x_210648, i_228540);\n                            int64_t defunc_0_add_arg_210701;\n                            \n                            defunc_0_add_arg_210701 = ((__global\n                                                        int64_t *) mem_229667)[i_229019 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_210700 *\n                              ",
            "                                                 partition_sizze_203667 +\n                                                                               gtid_210631];\n                            \n                            int64_t defunc_1_add_res_210702 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210701);\n                            \n                            defunc_0_f_res_210699 = defunc_1_add_res_210702;\n                        }\n                        \n                        double defunc_0_f_res_210703;\n                        \n                        if (cond_210698) {\n                            defunc_0_f_res_210703 = 0.0;\n                        } else {\n                            int64_t i_210704 = add64(x_210648, i_228540);\n                            double defunc_0_add_arg_210705;\n                            \n                            defunc_0_add_arg_210705 = ((__global\n                                                        double *) mem_229655)[i_229019 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_210704 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_210631];\n                            defunc_0_f_res_210703 = defunc_0_add_arg_210705;\n                        }\n                        \n                        int64_t binop_p_210706 = sub64(defunc_0_f_res_210699,\n                                                       defunc_0_m_fun_res_210684);\n                        double defunc_0_f_res_210707 =\n                               sitofp_i64_f64(binop_p_210706);\n                        double abs_res_21070",
            "8 = fabs(defunc_0_f_res_210707);\n                        double tmp1_210709 = abs_res_210708 / x_210649;\n                        double x_210710 = tmp1_210709 * tmp1_210709;\n                        double y_210711 = tmp1_210709 * x_210710;\n                        double tmp2_210712 = 1.0 - y_210711;\n                        double x_210713 = tmp2_210712 * tmp2_210712;\n                        double tmp3_210714 = tmp2_210712 * x_210713;\n                        double tmp4_210715 = defunc_0_f_res_210703 *\n                               tmp3_210714;\n                        double defunc_0_f_res_210716;\n                        \n                        if (cond_210698) {\n                            defunc_0_f_res_210716 = 0.0;\n                        } else {\n                            int64_t i_210717 = add64(x_210648, i_228540);\n                            double defunc_0_add_arg_210718;\n                            \n                            defunc_0_add_arg_210718 = ((__global\n                                                        double *) mem_229663)[i_229019 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_210717 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_210631];\n                            defunc_0_f_res_210716 = defunc_0_add_arg_210718;\n                        }\n                        \n                        double x_210719 = a0_210683 * tmp4_210715;\n                        double defunc_9_fit_fun_res_210720 =\n                               defunc_0_f_res_210716 * x_210719;\n                        double defunc_1_op_res_210696 =\n                               defunc_9_fit_fun_re",
            "s_210720 + redout_228539;\n                        double redout_tmp_233154 = defunc_1_op_res_210696;\n                        \n                        redout_228539 = redout_tmp_233154;\n                    }\n                    defunc_2_reduce_res_210693 = redout_228539;\n                    ((__global double *) color_232097)[phys_tid_210632 +\n                                                       (i_229019 *\n                                                        (num_threads_232221 *\n                                                         s_n_m_203726) +\n                                                        i_229023 *\n                                                        num_threads_232221)] =\n                        defunc_2_reduce_res_210693;\n                }\n            }\n            for (int64_t i_233155 = 0; i_233155 < n_p_203574; i_233155++) {\n                for (int64_t i_233156 = 0; i_233156 < s_n_m_203726;\n                     i_233156++) {\n                    double tmp_233157;\n                    \n                    tmp_233157 = ((__global\n                                   double *) color_232097)[phys_tid_210632 +\n                                                           (i_233155 *\n                                                            (num_threads_232221 *\n                                                             s_n_m_203726) +\n                                                            i_233156 *\n                                                            num_threads_232221)];\n                    ((__global double *) mem_229716)[gtid_210631 + (i_233155 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233156 *\n                                                                    partition_sizze_203667)] =\n                        tmp_23315",
            "7;\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_210627\n}\n__kernel void mainzisegmap_211772(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_211752,\n                                  int64_t num_threads_232223, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *mem_229720, __global\n                                  unsigned char *mem_229724, __global\n                                  unsigned char *mem_229728, __global\n                                  unsigned char *mem_229732, __global\n                                  unsigned char *mem_229736, __global\n                                  unsigned char *mem_229756, __global\n                                  unsigned char *color_232098)\n{\n    #define segmap_group_sizze_211751 (mainzisegmap_group_sizze_210726)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233158;\n    int32_t local_tid_233159;\n    int64_t group_sizze_233162;\n    int32_t wave_sizze_233161;\n    int32_t group_tid_233160;\n    \n    global_tid_233158 = get_global_id(0);\n    local_tid_233159 = get_local_id(0);\n    group_sizze_233162 = get_local_size(0);\n    wave_sizze_233161 = LOCKSTEP_WIDTH;\n    group_tid_233160 = get_group_id(0);\n    \n    int32_t phys_tid_211772 = global_tid_233158;\n    int32_t phys_group_id_233163;\n    \n    p",
            "hys_group_id_233163 = get_group_id(0);\n    for (int32_t i_233164 = 0; i_233164 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574,\n                                          segmap_group_sizze_211751)) -\n                   phys_group_id_233163, sext_i64_i32(num_groups_211752));\n         i_233164++) {\n        int32_t virt_group_id_233165 = phys_group_id_233163 + i_233164 *\n                sext_i64_i32(num_groups_211752);\n        int64_t global_tid_233166 = sext_i32_i64(virt_group_id_233165) *\n                segmap_group_sizze_211751 + sext_i32_i64(local_tid_233159);\n        int64_t slice_233167 = n_p_203574;\n        int64_t slice_233168 = partition_sizze_203667 * slice_233167;\n        int64_t gtid_211770 = squot64(global_tid_233166, slice_233167);\n        int64_t remnant_233169 = global_tid_233166 - gtid_211770 * slice_233167;\n        int64_t gtid_211771 = remnant_233169;\n        int64_t remnant_233170 = remnant_233169 - gtid_211771;\n        \n        if (slt64(gtid_211770, partition_sizze_203667) && slt64(gtid_211771,\n                                                                n_p_203574)) {\n            int64_t x_211776;\n            \n            x_211776 = ((__global int64_t *) ext_mem_229372)[gtid_211770 *\n                                                             n_p_203574 +\n                                                             gtid_211771];\n            for (int64_t i_229027 = 0; i_229027 < s_n_m_203726; i_229027++) {\n                int64_t x_211781;\n                \n                x_211781 = ((__global int64_t *) mem_229720)[i_229027 *\n                                                             (n_p_203574 *\n                                                              partition_sizze_203667) +\n                                                             gtid_211770 *\n                                                             n_p_203574 +\n                                                             gtid_211771];\n    ",
            "            \n                double x_211782;\n                \n                x_211782 = ((__global double *) mem_229724)[i_229027 *\n                                                            (n_p_203574 *\n                                                             partition_sizze_203667) +\n                                                            gtid_211770 *\n                                                            n_p_203574 +\n                                                            gtid_211771];\n                \n                bool cond_211783 = i_229027 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_211784;\n                \n                if (cond_211783) {\n                    defunc_0_m_fun_res_211784 = (int64_t) 0;\n                } else {\n                    int64_t y_211785 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_211786 = i_229027 == y_211785;\n                    int64_t defunc_0_m_fun_res_f_res_211787;\n                    \n                    if (cond_211786) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211788 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211787 =\n                            defunc_0_m_fun_res_f_res_t_res_211788;\n                    } else {\n                        int64_t x_211789 = sub64(i_229027, (int64_t) 1);\n                        int64_t x_211790 = mul64(jump_s_203581, x_211789);\n                        int64_t min_arg_211791 = add64((int64_t) 1, x_211790);\n                        int64_t min_res_211792 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_211791);\n                        \n                        defunc_0_m_fun_res_f_res_211787 = min_res_211792;\n                    }\n                    defunc_0_m_fun_res_211784 = defunc_0_m_fun_res_f_res_211787;\n                }\n                \n                double d",
            "efunc_2_reduce_res_211793;\n                double redout_228545 = 0.0;\n                \n                for (int64_t i_228546 = 0; i_228546 < q_s_203575; i_228546++) {\n                    bool cond_211798 = sle64(x_211776, i_228546);\n                    int64_t defunc_0_f_res_211799;\n                    \n                    if (cond_211798) {\n                        defunc_0_f_res_211799 = (int64_t) 0;\n                    } else {\n                        int64_t i_211800 = add64(x_211781, i_228546);\n                        int64_t defunc_0_add_arg_211801;\n                        \n                        defunc_0_add_arg_211801 = ((__global\n                                                    int64_t *) mem_229728)[i_211800 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_211770 *\n                                                                           n_p_203574 +\n                                                                           gtid_211771];\n                        \n                        int64_t defunc_1_add_res_211802 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211801);\n                        \n                        defunc_0_f_res_211799 = defunc_1_add_res_211802;\n                    }\n                    \n                    double defunc_0_f_res_211803;\n                    \n                    if (cond_211798) {\n                        defunc_0_f_res_211803 = 0.0;\n                    } else {\n                        int64_t i_211804 = add64(x_211781, i_228546);\n                        double defunc_0_add_arg_211805;\n                        \n                        defunc_0_add_arg_211805 = ((__global\n                                                    double *) mem_229732",
            ")[i_211804 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_211770 *\n                                                                          n_p_203574 +\n                                                                          gtid_211771];\n                        defunc_0_f_res_211803 = defunc_0_add_arg_211805;\n                    }\n                    \n                    int64_t binop_p_211806 = sub64(defunc_0_f_res_211799,\n                                                   defunc_0_m_fun_res_211784);\n                    double defunc_0_f_res_211807 =\n                           sitofp_i64_f64(binop_p_211806);\n                    double abs_res_211808 = fabs(defunc_0_f_res_211807);\n                    double tmp1_211809 = abs_res_211808 / x_211782;\n                    double x_211810 = tmp1_211809 * tmp1_211809;\n                    double y_211811 = tmp1_211809 * x_211810;\n                    double tmp2_211812 = 1.0 - y_211811;\n                    double x_211813 = tmp2_211812 * tmp2_211812;\n                    double tmp3_211814 = tmp2_211812 * x_211813;\n                    double w_j_211815 = defunc_0_f_res_211803 * tmp3_211814;\n                    double defunc_1_op_res_211796 = w_j_211815 + redout_228545;\n                    double redout_tmp_233172 = defunc_1_op_res_211796;\n                    \n                    redout_228545 = redout_tmp_233172;\n                }\n                defunc_2_reduce_res_211793 = redout_228545;\n                \n                double a0_211816 = 1.0 / defunc_2_reduce_res_211793;\n                int64_t defunc_0_m_fun_res_211817;\n                \n                if (cond_211783) {\n                    defunc_0_m_fun_res_211817 = (int64_t) 0;\n                } else {\n                    int64_t y_211818 = sub64",
            "(s_n_m_203726, (int64_t) 1);\n                    bool cond_211819 = i_229027 == y_211818;\n                    int64_t defunc_0_m_fun_res_f_res_211820;\n                    \n                    if (cond_211819) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211821 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211820 =\n                            defunc_0_m_fun_res_f_res_t_res_211821;\n                    } else {\n                        int64_t x_211822 = sub64(i_229027, (int64_t) 1);\n                        int64_t x_211823 = mul64(jump_s_203581, x_211822);\n                        int64_t min_arg_211824 = add64((int64_t) 1, x_211823);\n                        int64_t min_res_211825 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_211824);\n                        \n                        defunc_0_m_fun_res_f_res_211820 = min_res_211825;\n                    }\n                    defunc_0_m_fun_res_211817 = defunc_0_m_fun_res_f_res_211820;\n                }\n                \n                double defunc_2_reduce_res_211826;\n                double redout_228547 = 0.0;\n                \n                for (int64_t i_228548 = 0; i_228548 < q_s_203575; i_228548++) {\n                    bool cond_211831 = sle64(x_211776, i_228548);\n                    int64_t defunc_0_f_res_211832;\n                    \n                    if (cond_211831) {\n                        defunc_0_f_res_211832 = (int64_t) 0;\n                    } else {\n                        int64_t i_211833 = add64(x_211781, i_228548);\n                        int64_t defunc_0_add_arg_211834;\n                        \n                        defunc_0_add_arg_211834 = ((__global\n                                                    int64_t *) mem_229728)[i_211833 *\n                                                                           (n_p_203574 *\n   ",
            "                                                                         partition_sizze_203667) +\n                                                                           gtid_211770 *\n                                                                           n_p_203574 +\n                                                                           gtid_211771];\n                        \n                        int64_t defunc_1_add_res_211835 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211834);\n                        \n                        defunc_0_f_res_211832 = defunc_1_add_res_211835;\n                    }\n                    \n                    double defunc_0_f_res_211836;\n                    \n                    if (cond_211831) {\n                        defunc_0_f_res_211836 = 0.0;\n                    } else {\n                        int64_t i_211837 = add64(x_211781, i_228548);\n                        double defunc_0_add_arg_211838;\n                        \n                        defunc_0_add_arg_211838 = ((__global\n                                                    double *) mem_229732)[i_211837 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_211770 *\n                                                                          n_p_203574 +\n                                                                          gtid_211771];\n                        defunc_0_f_res_211836 = defunc_0_add_arg_211838;\n                    }\n                    \n                    int64_t binop_p_211839 = sub64(defunc_0_f_res_211832,\n                                                   defunc_0_m_fun_res_211817);\n                    double defunc_0_f_res_211840 =\n                           sitofp_i64_f64",
            "(binop_p_211839);\n                    double abs_res_211841 = fabs(defunc_0_f_res_211840);\n                    double tmp1_211842 = abs_res_211841 / x_211782;\n                    double x_211843 = tmp1_211842 * tmp1_211842;\n                    double y_211844 = tmp1_211842 * x_211843;\n                    double tmp2_211845 = 1.0 - y_211844;\n                    double x_211846 = tmp2_211845 * tmp2_211845;\n                    double tmp3_211847 = tmp2_211845 * x_211846;\n                    double tmp4_211848 = defunc_0_f_res_211836 * tmp3_211847;\n                    double defunc_0_f_res_211849;\n                    \n                    if (cond_211831) {\n                        defunc_0_f_res_211849 = 0.0;\n                    } else {\n                        int64_t i_211850 = add64(x_211781, i_228548);\n                        double defunc_0_add_arg_211851;\n                        \n                        defunc_0_add_arg_211851 = ((__global\n                                                    double *) mem_229736)[i_211850 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_211770 *\n                                                                          n_p_203574 +\n                                                                          gtid_211771];\n                        defunc_0_f_res_211849 = defunc_0_add_arg_211851;\n                    }\n                    \n                    double x_211852 = a0_211816 * tmp4_211848;\n                    double defunc_9_fit_fun_res_211853 = defunc_0_f_res_211849 *\n                           x_211852;\n                    double defunc_1_op_res_211829 =\n                           defunc_9_fit_fun_res_211853 + redout_228547;\n                    double redout_tmp_233173 = defunc_1_op_res_211829;\n                ",
            "    \n                    redout_228547 = redout_tmp_233173;\n                }\n                defunc_2_reduce_res_211826 = redout_228547;\n                ((__global double *) color_232098)[phys_tid_211772 + i_229027 *\n                                                   num_threads_232223] =\n                    defunc_2_reduce_res_211826;\n            }\n            for (int64_t i_233174 = 0; i_233174 < s_n_m_203726; i_233174++) {\n                double tmp_233175;\n                \n                tmp_233175 = ((__global\n                               double *) color_232098)[phys_tid_211772 +\n                                                       i_233174 *\n                                                       num_threads_232223];\n                ((__global double *) mem_229756)[gtid_211770 * n_p_203574 +\n                                                 gtid_211771 + i_233174 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233175;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211751\n}\n__kernel void mainzisegmap_211980(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *ext_mem_229470, __global\n                                  unsigned char *ext_mem_229471, __global\n                                 ",
            " unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639, __global\n                                  unsigned char *mem_229789)\n{\n    #define segmap_group_sizze_211969 (mainzisegmap_group_sizze_211061)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233232;\n    int32_t local_tid_233233;\n    int64_t group_sizze_233236;\n    int32_t wave_sizze_233235;\n    int32_t group_tid_233234;\n    \n    global_tid_233232 = get_global_id(0);\n    local_tid_233233 = get_local_id(0);\n    group_sizze_233236 = get_local_size(0);\n    wave_sizze_233235 = LOCKSTEP_WIDTH;\n    group_tid_233234 = get_group_id(0);\n    \n    int32_t phys_tid_211980 = global_tid_233232;\n    int64_t global_tid_233237 = sext_i32_i64(group_tid_233234) *\n            segmap_group_sizze_211969 + sext_i32_i64(local_tid_233233);\n    int64_t slice_233238 = s_n_m_203726;\n    int64_t slice_233239 = n_p_203574 * slice_233238;\n    int64_t slice_233240 = partition_sizze_203667 * slice_233239;\n    int64_t gtid_211977 = squot64(global_tid_233237, slice_233239);\n    int64_t remnant_233241 = global_tid_233237 - gtid_211977 * slice_233239;\n    int64_t gtid_211978 = squot64(remnant_233241, slice_233238);\n    int64_t remnant_233242 = remnant_233241 - gtid_211978 * slice_233238;\n    int64_t gtid_211979 = remnant_233242;\n    int64_t remnant_233243 = remnant_233242 - gtid_211979;\n    \n    if ((slt64(gtid_211977, partition_sizze_203667) && slt64(gtid_211978,\n                                                             n_p_203574)) &&\n        slt64(gtid_211979, s_n_m_203726)) {\n        int64_t x_211984;\n        \n        x_211984 = ((__global int64_t *) ext_mem_229372)[gtid_211977 *\n                                                         n_p_203574 +\n                                                         gtid_211978];\n        \n        int64_t x_211986;\n        \n        x_2119",
            "86 = ((__global int64_t *) ext_mem_229471)[gtid_211977 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_211978 *\n                                                         s_n_m_203726 +\n                                                         gtid_211979];\n        \n        double x_211987;\n        \n        x_211987 = ((__global double *) ext_mem_229470)[gtid_211977 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_211978 *\n                                                        s_n_m_203726 +\n                                                        gtid_211979];\n        \n        bool cond_211988 = gtid_211979 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211989;\n        \n        if (cond_211988) {\n            defunc_0_m_fun_res_211989 = (int64_t) 0;\n        } else {\n            int64_t y_211990 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_211991 = gtid_211979 == y_211990;\n            int64_t defunc_0_m_fun_res_f_res_211992;\n            \n            if (cond_211991) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211993 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211992 =\n                    defunc_0_m_fun_res_f_res_t_res_211993;\n            } else {\n                int64_t x_211994 = sub64(gtid_211979, (int64_t) 1);\n                int64_t x_211995 = mul64(jump_s_203581, x_211994);\n                int64_t min_arg_211996 = add64((int64_t) 1, x_211995);\n                int64_t min_res_211997 = smin64(defunc_0_f_res_203721,\n                                                min_arg_211996);\n                \n                defunc_0_m_fun_res_f_res_211992 = mi",
            "n_res_211997;\n            }\n            defunc_0_m_fun_res_211989 = defunc_0_m_fun_res_f_res_211992;\n        }\n        \n        double defunc_2_reduce_res_211998;\n        double redout_228561 = 0.0;\n        \n        for (int64_t i_228562 = 0; i_228562 < q_s_203575; i_228562++) {\n            bool cond_212003 = sle64(x_211984, i_228562);\n            int64_t defunc_0_f_res_212004;\n            \n            if (cond_212003) {\n                defunc_0_f_res_212004 = (int64_t) 0;\n            } else {\n                int64_t i_212005 = add64(x_211986, i_228562);\n                int64_t defunc_0_add_arg_212006;\n                \n                defunc_0_add_arg_212006 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_211977 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_211978 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_212005];\n                \n                int64_t defunc_1_add_res_212007 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_212006);\n                \n                defunc_0_f_res_212004 = defunc_1_add_res_212007;\n            }\n            \n            double defunc_0_f_res_212008;\n            \n            if (cond_212003) {\n                defunc_0_f_res_212008 = 0.0;\n            } else {\n                int64_t i_212009 = add64(x_211986, i_228562);\n                double defunc_0_add_arg_212010;\n                \n                defunc_0_add_arg_212010 = ((__global\n                                            double *) mem_229639)[gtid_211977 *\n                                                                  (defunc_0_f_res_203721 *\n           ",
            "                                                        n_p_203574) +\n                                                                  gtid_211978 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_212009];\n                defunc_0_f_res_212008 = defunc_0_add_arg_212010;\n            }\n            \n            int64_t binop_p_212011 = sub64(defunc_0_f_res_212004,\n                                           defunc_0_m_fun_res_211989);\n            double defunc_0_f_res_212012 = sitofp_i64_f64(binop_p_212011);\n            double abs_res_212013 = fabs(defunc_0_f_res_212012);\n            double tmp1_212014 = abs_res_212013 / x_211987;\n            double x_212015 = tmp1_212014 * tmp1_212014;\n            double y_212016 = tmp1_212014 * x_212015;\n            double tmp2_212017 = 1.0 - y_212016;\n            double x_212018 = tmp2_212017 * tmp2_212017;\n            double tmp3_212019 = tmp2_212017 * x_212018;\n            double w_j_212020 = defunc_0_f_res_212008 * tmp3_212019;\n            double defunc_1_op_res_212001 = w_j_212020 + redout_228561;\n            double redout_tmp_233244 = defunc_1_op_res_212001;\n            \n            redout_228561 = redout_tmp_233244;\n        }\n        defunc_2_reduce_res_211998 = redout_228561;\n        \n        double a0_212021 = 1.0 / defunc_2_reduce_res_211998;\n        int64_t defunc_0_m_fun_res_212022;\n        \n        if (cond_211988) {\n            defunc_0_m_fun_res_212022 = (int64_t) 0;\n        } else {\n            int64_t y_212023 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_212024 = gtid_211979 == y_212023;\n            int64_t defunc_0_m_fun_res_f_res_212025;\n            \n            if (cond_212024) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212026 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212025 =\n                    de",
            "func_0_m_fun_res_f_res_t_res_212026;\n            } else {\n                int64_t x_212027 = sub64(gtid_211979, (int64_t) 1);\n                int64_t x_212028 = mul64(jump_s_203581, x_212027);\n                int64_t min_arg_212029 = add64((int64_t) 1, x_212028);\n                int64_t min_res_212030 = smin64(defunc_0_f_res_203721,\n                                                min_arg_212029);\n                \n                defunc_0_m_fun_res_f_res_212025 = min_res_212030;\n            }\n            defunc_0_m_fun_res_212022 = defunc_0_m_fun_res_f_res_212025;\n        }\n        \n        double defunc_2_reduce_res_212031;\n        double redout_228563 = 0.0;\n        \n        for (int64_t i_228564 = 0; i_228564 < q_s_203575; i_228564++) {\n            bool cond_212036 = sle64(x_211984, i_228564);\n            int64_t defunc_0_f_res_212037;\n            \n            if (cond_212036) {\n                defunc_0_f_res_212037 = (int64_t) 0;\n            } else {\n                int64_t i_212038 = add64(x_211986, i_228564);\n                int64_t defunc_0_add_arg_212039;\n                \n                defunc_0_add_arg_212039 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_211977 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_211978 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_212038];\n                \n                int64_t defunc_1_add_res_212040 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_212039);\n                \n                defunc_0_f_res_212037 = defunc_1_add_res_212040;\n            }\n            \n            double defunc_0_f_res_212041;\n   ",
            "         \n            if (cond_212036) {\n                defunc_0_f_res_212041 = 0.0;\n            } else {\n                int64_t i_212042 = add64(x_211986, i_228564);\n                double defunc_0_add_arg_212043;\n                \n                defunc_0_add_arg_212043 = ((__global\n                                            double *) mem_229639)[gtid_211977 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_211978 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_212042];\n                defunc_0_f_res_212041 = defunc_0_add_arg_212043;\n            }\n            \n            int64_t binop_p_212044 = sub64(defunc_0_f_res_212037,\n                                           defunc_0_m_fun_res_212022);\n            double defunc_0_f_res_212045 = sitofp_i64_f64(binop_p_212044);\n            double abs_res_212046 = fabs(defunc_0_f_res_212045);\n            double tmp1_212047 = abs_res_212046 / x_211987;\n            double x_212048 = tmp1_212047 * tmp1_212047;\n            double y_212049 = tmp1_212047 * x_212048;\n            double tmp2_212050 = 1.0 - y_212049;\n            double x_212051 = tmp2_212050 * tmp2_212050;\n            double tmp3_212052 = tmp2_212050 * x_212051;\n            double tmp4_212053 = defunc_0_f_res_212041 * tmp3_212052;\n            double defunc_0_f_res_212054;\n            \n            if (cond_212036) {\n                defunc_0_f_res_212054 = 0.0;\n            } else {\n                int64_t i_212055 = add64(x_211986, i_228564);\n                double defunc_0_add_arg_212056;\n                \n                defunc_0_add_arg_212056 = ((__global\n                                            double *) mem_229634)[gtid_211977 *\n                             ",
            "                                     (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_211978 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_212055];\n                defunc_0_f_res_212054 = defunc_0_add_arg_212056;\n            }\n            \n            double x_212057 = a0_212021 * tmp4_212053;\n            double defunc_9_fit_fun_res_212058 = defunc_0_f_res_212054 *\n                   x_212057;\n            double defunc_1_op_res_212034 = defunc_9_fit_fun_res_212058 +\n                   redout_228563;\n            double redout_tmp_233245 = defunc_1_op_res_212034;\n            \n            redout_228563 = redout_tmp_233245;\n        }\n        defunc_2_reduce_res_212031 = redout_228563;\n        ((__global double *) mem_229789)[gtid_211977 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_211978 * s_n_m_203726 +\n                                         gtid_211979] =\n            defunc_2_reduce_res_212031;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211969\n}\n__kernel void mainzisegmap_212069(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_229795, __global\n                                  unsigned char *mem_229799)\n{\n    #define segmap_group_sizze_212062 (mainzisegmap_group_sizze_211322)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block",
            "_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233246;\n    int32_t local_tid_233247;\n    int64_t group_sizze_233250;\n    int32_t wave_sizze_233249;\n    int32_t group_tid_233248;\n    \n    global_tid_233246 = get_global_id(0);\n    local_tid_233247 = get_local_id(0);\n    group_sizze_233250 = get_local_size(0);\n    wave_sizze_233249 = LOCKSTEP_WIDTH;\n    group_tid_233248 = get_group_id(0);\n    \n    int32_t phys_tid_212069 = global_tid_233246;\n    int64_t global_tid_233251 = sext_i32_i64(group_tid_233248) *\n            segmap_group_sizze_212062 + sext_i32_i64(local_tid_233247);\n    int64_t slice_233252 = s_n_m_203726;\n    int64_t slice_233253 = n_p_203574 * slice_233252;\n    int64_t slice_233254 = partition_sizze_203667 * slice_233253;\n    int64_t gtid_212066 = squot64(global_tid_233251, slice_233253);\n    int64_t remnant_233255 = global_tid_233251 - gtid_212066 * slice_233253;\n    int64_t gtid_212067 = squot64(remnant_233255, slice_233252);\n    int64_t remnant_233256 = remnant_233255 - gtid_212067 * slice_233252;\n    int64_t gtid_212068 = remnant_233256;\n    int64_t remnant_233257 = remnant_233256 - gtid_212068;\n    \n    if ((slt64(gtid_212066, partition_sizze_203667) && slt64(gtid_212067,\n                                                             n_p_203574)) &&\n        slt64(gtid_212068, s_n_m_203726)) {\n        bool cond_212071 = gtid_212068 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_212072;\n        \n        if (cond_212071) {\n            defunc_0_m_fun_res_212072 = (int64_t) 0;\n        } else {\n            int64_t y_212073 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_212074 = gtid_212068 == y_212073;\n            int64_t defunc_0_m_fun_res_f_res_212075;\n            \n            if (cond_212074) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212076 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212075 =\n              ",
            "      defunc_0_m_fun_res_f_res_t_res_212076;\n            } else {\n                int64_t x_212077 = sub64(gtid_212068, (int64_t) 1);\n                int64_t x_212078 = mul64(jump_s_203581, x_212077);\n                int64_t min_arg_212079 = add64((int64_t) 1, x_212078);\n                int64_t min_res_212080 = smin64(defunc_0_f_res_203721,\n                                                min_arg_212079);\n                \n                defunc_0_m_fun_res_f_res_212075 = min_res_212080;\n            }\n            defunc_0_m_fun_res_212072 = defunc_0_m_fun_res_f_res_212075;\n        }\n        ((__global int64_t *) mem_229795)[gtid_212066 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_212067 * s_n_m_203726 +\n                                          gtid_212068] =\n            defunc_0_m_fun_res_212072;\n        ((__global bool *) mem_229799)[gtid_212066 * (s_n_m_203726 *\n                                                      n_p_203574) +\n                                       gtid_212067 * s_n_m_203726 +\n                                       gtid_212068] = cond_212071;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212062\n}\n__kernel void mainzisegmap_212141(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_229805, __global\n                                  unsigned char *mem_229811, __global\n                                  unsigned char *mem_229816)\n{\n    #define segmap_group_sizze_212134 (mainzisegmap_group_sizze_211236)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int bloc",
            "k_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233334;\n    int32_t local_tid_233335;\n    int64_t group_sizze_233338;\n    int32_t wave_sizze_233337;\n    int32_t group_tid_233336;\n    \n    global_tid_233334 = get_global_id(0);\n    local_tid_233335 = get_local_id(0);\n    group_sizze_233338 = get_local_size(0);\n    wave_sizze_233337 = LOCKSTEP_WIDTH;\n    group_tid_233336 = get_group_id(0);\n    \n    int32_t phys_tid_212141 = global_tid_233334;\n    int64_t global_tid_233339 = sext_i32_i64(group_tid_233336) *\n            segmap_group_sizze_212134 + sext_i32_i64(local_tid_233335);\n    int64_t slice_233340 = s_n_m_203726;\n    int64_t slice_233341 = n_p_203574 * slice_233340;\n    int64_t slice_233342 = partition_sizze_203667 * slice_233341;\n    int64_t gtid_212138 = squot64(global_tid_233339, slice_233341);\n    int64_t remnant_233343 = global_tid_233339 - gtid_212138 * slice_233341;\n    int64_t gtid_212139 = squot64(remnant_233343, slice_233340);\n    int64_t remnant_233344 = remnant_233343 - gtid_212139 * slice_233340;\n    int64_t gtid_212140 = remnant_233344;\n    int64_t remnant_233345 = remnant_233344 - gtid_212140;\n    \n    if ((slt64(gtid_212138, partition_sizze_203667) && slt64(gtid_212139,\n                                                             n_p_203574)) &&\n        slt64(gtid_212140, s_n_m_203726)) {\n        bool index_primexp_228808 = gtid_212140 == (int64_t) 0;\n        double defunc_2_reduce_res_212144;\n        \n        defunc_2_reduce_res_212144 = ((__global\n                                       double *) mem_229805)[gtid_212138 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212139 *\n                                                             s_n_m_203726 +\n                                                             gtid_212140];\n        \n   ",
            "     double a0_212145 = 1.0 / defunc_2_reduce_res_212144;\n        int64_t defunc_0_m_fun_res_212146;\n        \n        if (index_primexp_228808) {\n            defunc_0_m_fun_res_212146 = (int64_t) 0;\n        } else {\n            int64_t y_212147 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_212148 = gtid_212140 == y_212147;\n            int64_t defunc_0_m_fun_res_f_res_212149;\n            \n            if (cond_212148) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212150 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212149 =\n                    defunc_0_m_fun_res_f_res_t_res_212150;\n            } else {\n                int64_t x_212151 = sub64(gtid_212140, (int64_t) 1);\n                int64_t x_212152 = mul64(jump_s_203581, x_212151);\n                int64_t min_arg_212153 = add64((int64_t) 1, x_212152);\n                int64_t min_res_212154 = smin64(defunc_0_f_res_203721,\n                                                min_arg_212153);\n                \n                defunc_0_m_fun_res_f_res_212149 = min_res_212154;\n            }\n            defunc_0_m_fun_res_212146 = defunc_0_m_fun_res_f_res_212149;\n        }\n        ((__global double *) mem_229811)[gtid_212138 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_212139 * s_n_m_203726 +\n                                         gtid_212140] = a0_212145;\n        ((__global int64_t *) mem_229816)[gtid_212138 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_212139 * s_n_m_203726 +\n                                          gtid_212140] =\n            defunc_0_m_fun_res_212146;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212134\n}\n__kernel void mainzisegmap_212355(__global int *global_failure,\n                                  int64_t n_",
            "p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_212350,\n                                  int64_t num_threads_232231, __global\n                                  unsigned char *mem_229842, __global\n                                  unsigned char *mem_229845, __global\n                                  unsigned char *mem_229849, __global\n                                  unsigned char *mem_229853, __global\n                                  unsigned char *mem_229857, __global\n                                  unsigned char *mem_229861, __global\n                                  unsigned char *mem_229954, __global\n                                  unsigned char *mem_229958, __global\n                                  unsigned char *color_232103, __global\n                                  unsigned char *color_232104)\n{\n    #define segmap_group_sizze_212349 (mainzisegmap_group_sizze_212223)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233430;\n    int32_t local_tid_233431;\n    int64_t group_sizze_233434;\n    int32_t wave_sizze_233433;\n    int32_t group_tid_233432;\n    \n    global_tid_233430 = get_global_id(0);\n    local_tid_233431 = get_local_id(0);\n    group_sizze_233434 = get_local_size(0);\n    wave_sizze_233433 = LOCKSTEP_WIDTH;\n    group_tid_233432 = get_group_id(0);\n    \n    int32_t phys_tid_212355 = global_tid_233430;\n    int32_t phys_group_id_233435;\n    \n    phys_group_id_233435 = get_group_id(0);\n    for (int32_t i_233436 = 0; i_233436 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n  ",
            "                                        segmap_group_sizze_212349)) -\n                   phys_group_id_233435, sext_i64_i32(num_groups_212350));\n         i_233436++) {\n        int32_t virt_group_id_233437 = phys_group_id_233435 + i_233436 *\n                sext_i64_i32(num_groups_212350);\n        int64_t global_tid_233438 = sext_i32_i64(virt_group_id_233437) *\n                segmap_group_sizze_212349 + sext_i32_i64(local_tid_233431);\n        int64_t slice_233439 = partition_sizze_203667;\n        int64_t gtid_212354 = global_tid_233438;\n        int64_t remnant_233440 = global_tid_233438 - gtid_212354;\n        \n        if (slt64(gtid_212354, partition_sizze_203667)) {\n            for (int64_t i_229033 = 0; i_229033 < n_p_203574; i_229033++) {\n                int64_t x_212367;\n                \n                x_212367 = ((__global int64_t *) mem_229845)[i_229033 *\n                                                             partition_sizze_203667 +\n                                                             gtid_212354];\n                for (int64_t i_229040 = 0; i_229040 < s_n_m_203726;\n                     i_229040++) {\n                    int64_t x_212373;\n                    \n                    x_212373 = ((__global int64_t *) mem_229853)[i_229033 *\n                                                                 (partition_sizze_203667 *\n                                                                  s_n_m_203726) +\n                                                                 i_229040 *\n                                                                 partition_sizze_203667 +\n                                                                 gtid_212354];\n                    \n                    double x_212374;\n                    \n                    x_212374 = ((__global double *) mem_229842)[i_229033 *\n                                                                (partition_sizze_203667 *\n                                                                ",
            " s_n_m_203726) +\n                                                                i_229040 *\n                                                                partition_sizze_203667 +\n                                                                gtid_212354];\n                    \n                    bool cond_212375 = i_229040 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_212376;\n                    \n                    if (cond_212375) {\n                        defunc_0_m_fun_res_212376 = (int64_t) 0;\n                    } else {\n                        int64_t y_212377 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_212378 = i_229040 == y_212377;\n                        int64_t defunc_0_m_fun_res_f_res_212379;\n                        \n                        if (cond_212378) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212380 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212379 =\n                                defunc_0_m_fun_res_f_res_t_res_212380;\n                        } else {\n                            int64_t x_212381 = sub64(i_229040, (int64_t) 1);\n                            int64_t x_212382 = mul64(jump_s_203581, x_212381);\n                            int64_t min_arg_212383 = add64((int64_t) 1,\n                                                           x_212382);\n                            int64_t min_res_212384 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_212383);\n                            \n                            defunc_0_m_fun_res_f_res_212379 = min_res_212384;\n                        }\n                        defunc_0_m_fun_res_212376 =\n                            defunc_0_m_fun_res_f_res_212379;\n                    }\n                    \n                    double defunc_2_reduce_res_212385;\n    ",
            "                double defunc_2_reduce_res_212386;\n                    double defunc_2_reduce_res_212387;\n                    double redout_228579;\n                    double redout_228580;\n                    double redout_228581;\n                    \n                    redout_228579 = 0.0;\n                    redout_228580 = 0.0;\n                    redout_228581 = 0.0;\n                    for (int64_t i_228582 = 0; i_228582 < q_s_203575;\n                         i_228582++) {\n                        bool cond_212398 = sle64(x_212367, i_228582);\n                        int64_t defunc_0_f_res_212399;\n                        \n                        if (cond_212398) {\n                            defunc_0_f_res_212399 = (int64_t) 0;\n                        } else {\n                            int64_t i_212400 = add64(x_212373, i_228582);\n                            int64_t defunc_0_add_arg_212401;\n                            \n                            defunc_0_add_arg_212401 = ((__global\n                                                        int64_t *) mem_229861)[i_229033 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_212400 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_212354];\n                            \n                            int64_t defunc_1_add_res_212402 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212401);\n                            \n                            defunc_0_f_res_212399 = defunc_1_add_res_212402;\n                        }\n                        \n                        double defunc_0_f_res_2",
            "12403;\n                        \n                        if (cond_212398) {\n                            defunc_0_f_res_212403 = 0.0;\n                        } else {\n                            int64_t i_212404 = add64(x_212373, i_228582);\n                            double defunc_0_add_arg_212405;\n                            \n                            defunc_0_add_arg_212405 = ((__global\n                                                        double *) mem_229849)[i_229033 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_212404 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_212354];\n                            defunc_0_f_res_212403 = defunc_0_add_arg_212405;\n                        }\n                        \n                        int64_t binop_p_212406 = sub64(defunc_0_f_res_212399,\n                                                       defunc_0_m_fun_res_212376);\n                        double defunc_0_f_res_212407 =\n                               sitofp_i64_f64(binop_p_212406);\n                        double abs_res_212408 = fabs(defunc_0_f_res_212407);\n                        double tmp1_212409 = abs_res_212408 / x_212374;\n                        double x_212410 = tmp1_212409 * tmp1_212409;\n                        double y_212411 = tmp1_212409 * x_212410;\n                        double tmp2_212412 = 1.0 - y_212411;\n                        double x_212413 = tmp2_212412 * tmp2_212412;\n                        double tmp3_212414 = tmp2_212412 * x_212413;\n                        double w_j_212415 = defunc_0_f_res_212403 * tmp3_212414;\n                        double xw_j_212416 = defunc_0_f",
            "_res_212407 * w_j_212415;\n                        double x2w_j_212417 = defunc_0_f_res_212407 *\n                               xw_j_212416;\n                        double defunc_1_op_res_212390 = w_j_212415 +\n                               redout_228579;\n                        double defunc_1_op_res_212393 = xw_j_212416 +\n                               redout_228580;\n                        double defunc_1_op_res_212396 = x2w_j_212417 +\n                               redout_228581;\n                        double redout_tmp_233445 = defunc_1_op_res_212390;\n                        double redout_tmp_233446 = defunc_1_op_res_212393;\n                        double redout_tmp_233447 = defunc_1_op_res_212396;\n                        \n                        redout_228579 = redout_tmp_233445;\n                        redout_228580 = redout_tmp_233446;\n                        redout_228581 = redout_tmp_233447;\n                    }\n                    defunc_2_reduce_res_212385 = redout_228579;\n                    defunc_2_reduce_res_212386 = redout_228580;\n                    defunc_2_reduce_res_212387 = redout_228581;\n                    \n                    double x_212418 = defunc_2_reduce_res_212385 *\n                           defunc_2_reduce_res_212387;\n                    double y_212419 = defunc_2_reduce_res_212386 *\n                           defunc_2_reduce_res_212386;\n                    double y_212420 = x_212418 - y_212419;\n                    double det1_212421 = 1.0 / y_212420;\n                    double a11_212422 = defunc_2_reduce_res_212387 *\n                           det1_212421;\n                    double x_212423 = 0.0 - defunc_2_reduce_res_212386;\n                    double b11_212424 = det1_212421 * x_212423;\n                    double c11_212425 = defunc_2_reduce_res_212385 *\n                           det1_212421;\n                    int64_t defunc_0_m_fun_res_212426;\n                    \n                    if (cond_212375) {\n                     ",
            "   defunc_0_m_fun_res_212426 = (int64_t) 0;\n                    } else {\n                        int64_t y_212427 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_212428 = i_229040 == y_212427;\n                        int64_t defunc_0_m_fun_res_f_res_212429;\n                        \n                        if (cond_212428) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212430 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212429 =\n                                defunc_0_m_fun_res_f_res_t_res_212430;\n                        } else {\n                            int64_t x_212431 = sub64(i_229040, (int64_t) 1);\n                            int64_t x_212432 = mul64(jump_s_203581, x_212431);\n                            int64_t min_arg_212433 = add64((int64_t) 1,\n                                                           x_212432);\n                            int64_t min_res_212434 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_212433);\n                            \n                            defunc_0_m_fun_res_f_res_212429 = min_res_212434;\n                        }\n                        defunc_0_m_fun_res_212426 =\n                            defunc_0_m_fun_res_f_res_212429;\n                    }\n                    \n                    double defunc_2_reduce_res_212435;\n                    double defunc_2_reduce_res_212436;\n                    double redout_228583;\n                    double redout_228584;\n                    \n                    redout_228583 = 0.0;\n                    redout_228584 = 0.0;\n                    for (int64_t i_228585 = 0; i_228585 < q_s_203575;\n                         i_228585++) {\n                        bool cond_212444 = sle64(x_212367, i_228585);\n                        int64_t defunc_0_f_res_212445;\n        ",
            "                \n                        if (cond_212444) {\n                            defunc_0_f_res_212445 = (int64_t) 0;\n                        } else {\n                            int64_t i_212446 = add64(x_212373, i_228585);\n                            int64_t defunc_0_add_arg_212447;\n                            \n                            defunc_0_add_arg_212447 = ((__global\n                                                        int64_t *) mem_229861)[i_229033 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_212446 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_212354];\n                            \n                            int64_t defunc_1_add_res_212448 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212447);\n                            \n                            defunc_0_f_res_212445 = defunc_1_add_res_212448;\n                        }\n                        \n                        double defunc_0_f_res_212449;\n                        \n                        if (cond_212444) {\n                            defunc_0_f_res_212449 = 0.0;\n                        } else {\n                            int64_t i_212450 = add64(x_212373, i_228585);\n                            double defunc_0_add_arg_212451;\n                            \n                            defunc_0_add_arg_212451 = ((__global\n                                                        double *) mem_229849)[i_229033 *\n                                                                              (partition_sizze_203667 *\n                                ",
            "                                               defunc_0_f_res_203721) +\n                                                                              i_212450 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_212354];\n                            defunc_0_f_res_212449 = defunc_0_add_arg_212451;\n                        }\n                        \n                        int64_t binop_p_212452 = sub64(defunc_0_f_res_212445,\n                                                       defunc_0_m_fun_res_212426);\n                        double defunc_0_f_res_212453 =\n                               sitofp_i64_f64(binop_p_212452);\n                        double abs_res_212454 = fabs(defunc_0_f_res_212453);\n                        double tmp1_212455 = abs_res_212454 / x_212374;\n                        double x_212456 = tmp1_212455 * tmp1_212455;\n                        double y_212457 = tmp1_212455 * x_212456;\n                        double tmp2_212458 = 1.0 - y_212457;\n                        double x_212459 = tmp2_212458 * tmp2_212458;\n                        double tmp3_212460 = tmp2_212458 * x_212459;\n                        double tmp4_212461 = defunc_0_f_res_212449 *\n                               tmp3_212460;\n                        double defunc_1_f_res_212462 = defunc_0_f_res_212453 *\n                               tmp4_212461;\n                        double defunc_0_f_res_212463;\n                        \n                        if (cond_212444) {\n                            defunc_0_f_res_212463 = 0.0;\n                        } else {\n                            int64_t i_212464 = add64(x_212373, i_228585);\n                            double defunc_0_add_arg_212465;\n                            \n                            defunc_0_add_arg_212465 = ((__global\n                                                        double *) mem_229857)[",
            "i_229033 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_212464 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_212354];\n                            defunc_0_f_res_212463 = defunc_0_add_arg_212465;\n                        }\n                        \n                        double x_212466 = a11_212422 * tmp4_212461;\n                        double y_212467 = b11_212424 * defunc_1_f_res_212462;\n                        double x_212468 = x_212466 + y_212467;\n                        double defunc_9_fit_fun_res_212469 =\n                               defunc_0_f_res_212463 * x_212468;\n                        double x_212470 = b11_212424 * tmp4_212461;\n                        double y_212471 = c11_212425 * defunc_1_f_res_212462;\n                        double x_212472 = x_212470 + y_212471;\n                        double defunc_9_slope_fun_res_212473 =\n                               defunc_0_f_res_212463 * x_212472;\n                        double defunc_1_op_res_212439 =\n                               defunc_9_fit_fun_res_212469 + redout_228583;\n                        double defunc_1_op_res_212442 =\n                               defunc_9_slope_fun_res_212473 + redout_228584;\n                        double redout_tmp_233448 = defunc_1_op_res_212439;\n                        double redout_tmp_233449 = defunc_1_op_res_212442;\n                        \n                        redout_228583 = redout_tmp_233448;\n                        redout_228584 = redout_tmp_233449;\n                    }\n                    defunc_2_reduce_res_212435 = redout_228583;\n                    defunc_2_reduce_res_212436 = red",
            "out_228584;\n                    ((__global double *) color_232104)[phys_tid_212355 +\n                                                       (i_229033 *\n                                                        (num_threads_232231 *\n                                                         s_n_m_203726) +\n                                                        i_229040 *\n                                                        num_threads_232231)] =\n                        defunc_2_reduce_res_212435;\n                    ((__global double *) color_232103)[phys_tid_212355 +\n                                                       (i_229033 *\n                                                        (num_threads_232231 *\n                                                         s_n_m_203726) +\n                                                        i_229040 *\n                                                        num_threads_232231)] =\n                        defunc_2_reduce_res_212436;\n                }\n            }\n            for (int64_t i_233450 = 0; i_233450 < n_p_203574; i_233450++) {\n                for (int64_t i_233451 = 0; i_233451 < s_n_m_203726;\n                     i_233451++) {\n                    double tmp_233452;\n                    \n                    tmp_233452 = ((__global\n                                   double *) color_232104)[phys_tid_212355 +\n                                                           (i_233450 *\n                                                            (num_threads_232231 *\n                                                             s_n_m_203726) +\n                                                            i_233451 *\n                                                            num_threads_232231)];\n                    ((__global double *) mem_229954)[gtid_212354 + (i_233450 *\n                                                                    (partition_sizze_203667 *\n                                                              ",
            "       s_n_m_203726) +\n                                                                    i_233451 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233452;\n                }\n            }\n            for (int64_t i_233453 = 0; i_233453 < n_p_203574; i_233453++) {\n                for (int64_t i_233454 = 0; i_233454 < s_n_m_203726;\n                     i_233454++) {\n                    double tmp_233455;\n                    \n                    tmp_233455 = ((__global\n                                   double *) color_232103)[phys_tid_212355 +\n                                                           (i_233453 *\n                                                            (num_threads_232231 *\n                                                             s_n_m_203726) +\n                                                            i_233454 *\n                                                            num_threads_232231)];\n                    ((__global double *) mem_229958)[gtid_212354 + (i_233453 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233454 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233455;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212349\n}\n__kernel void mainzisegmap_213809(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                      ",
            "            int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_213787,\n                                  int64_t num_threads_232234, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *mem_229962, __global\n                                  unsigned char *mem_229966, __global\n                                  unsigned char *mem_229970, __global\n                                  unsigned char *mem_229974, __global\n                                  unsigned char *mem_229978, __global\n                                  unsigned char *mem_230013, __global\n                                  unsigned char *mem_230017, __global\n                                  unsigned char *color_232105, __global\n                                  unsigned char *color_232106)\n{\n    #define segmap_group_sizze_213786 (mainzisegmap_group_sizze_212479)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233456;\n    int32_t local_tid_233457;\n    int64_t group_sizze_233460;\n    int32_t wave_sizze_233459;\n    int32_t group_tid_233458;\n    \n    global_tid_233456 = get_global_id(0);\n    local_tid_233457 = get_local_id(0);\n    group_sizze_233460 = get_local_size(0);\n    wave_sizze_233459 = LOCKSTEP_WIDTH;\n    group_tid_233458 = get_group_id(0);\n    \n    int32_t phys_tid_213809 = global_tid_233456;\n    int32_t phys_group_id_233461;\n    \n    phys_group_id_233461 = get_group_id(0);\n    for (int32_t i_233462 = 0; i_233462 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574,\n                                          segmap_group_sizze_213786)) -\n                   phys_group_id_233461, sext_i64_i32(num_groups_213787));\n         i_233462++) {\n        int32_t virt_group_id_233463 = phys_group_id_23",
            "3461 + i_233462 *\n                sext_i64_i32(num_groups_213787);\n        int64_t global_tid_233464 = sext_i32_i64(virt_group_id_233463) *\n                segmap_group_sizze_213786 + sext_i32_i64(local_tid_233457);\n        int64_t slice_233465 = n_p_203574;\n        int64_t slice_233466 = partition_sizze_203667 * slice_233465;\n        int64_t gtid_213807 = squot64(global_tid_233464, slice_233465);\n        int64_t remnant_233467 = global_tid_233464 - gtid_213807 * slice_233465;\n        int64_t gtid_213808 = remnant_233467;\n        int64_t remnant_233468 = remnant_233467 - gtid_213808;\n        \n        if (slt64(gtid_213807, partition_sizze_203667) && slt64(gtid_213808,\n                                                                n_p_203574)) {\n            int64_t x_213813;\n            \n            x_213813 = ((__global int64_t *) ext_mem_229372)[gtid_213807 *\n                                                             n_p_203574 +\n                                                             gtid_213808];\n            for (int64_t i_229047 = 0; i_229047 < s_n_m_203726; i_229047++) {\n                int64_t x_213819;\n                \n                x_213819 = ((__global int64_t *) mem_229962)[i_229047 *\n                                                             (n_p_203574 *\n                                                              partition_sizze_203667) +\n                                                             gtid_213807 *\n                                                             n_p_203574 +\n                                                             gtid_213808];\n                \n                double x_213820;\n                \n                x_213820 = ((__global double *) mem_229966)[i_229047 *\n                                                            (n_p_203574 *\n                                                             partition_sizze_203667) +\n                                                            gtid_213807 *\n                ",
            "                                            n_p_203574 +\n                                                            gtid_213808];\n                \n                bool cond_213821 = i_229047 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_213822;\n                \n                if (cond_213821) {\n                    defunc_0_m_fun_res_213822 = (int64_t) 0;\n                } else {\n                    int64_t y_213823 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_213824 = i_229047 == y_213823;\n                    int64_t defunc_0_m_fun_res_f_res_213825;\n                    \n                    if (cond_213824) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213826 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213825 =\n                            defunc_0_m_fun_res_f_res_t_res_213826;\n                    } else {\n                        int64_t x_213827 = sub64(i_229047, (int64_t) 1);\n                        int64_t x_213828 = mul64(jump_s_203581, x_213827);\n                        int64_t min_arg_213829 = add64((int64_t) 1, x_213828);\n                        int64_t min_res_213830 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_213829);\n                        \n                        defunc_0_m_fun_res_f_res_213825 = min_res_213830;\n                    }\n                    defunc_0_m_fun_res_213822 = defunc_0_m_fun_res_f_res_213825;\n                }\n                \n                double defunc_2_reduce_res_213831;\n                double defunc_2_reduce_res_213832;\n                double defunc_2_reduce_res_213833;\n                double redout_228590;\n                double redout_228591;\n                double redout_228592;\n                \n                redout_228590 = 0.0;\n                redout_228591 = 0.0;\n                redout_228592 = 0.0;\n              ",
            "  for (int64_t i_228593 = 0; i_228593 < q_s_203575; i_228593++) {\n                    bool cond_213844 = sle64(x_213813, i_228593);\n                    int64_t defunc_0_f_res_213845;\n                    \n                    if (cond_213844) {\n                        defunc_0_f_res_213845 = (int64_t) 0;\n                    } else {\n                        int64_t i_213846 = add64(x_213819, i_228593);\n                        int64_t defunc_0_add_arg_213847;\n                        \n                        defunc_0_add_arg_213847 = ((__global\n                                                    int64_t *) mem_229970)[i_213846 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_213807 *\n                                                                           n_p_203574 +\n                                                                           gtid_213808];\n                        \n                        int64_t defunc_1_add_res_213848 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213847);\n                        \n                        defunc_0_f_res_213845 = defunc_1_add_res_213848;\n                    }\n                    \n                    double defunc_0_f_res_213849;\n                    \n                    if (cond_213844) {\n                        defunc_0_f_res_213849 = 0.0;\n                    } else {\n                        int64_t i_213850 = add64(x_213819, i_228593);\n                        double defunc_0_add_arg_213851;\n                        \n                        defunc_0_add_arg_213851 = ((__global\n                                                    double *) mem_229974)[i_213850 *\n                                                                          (n_p_203574 *\n ",
            "                                                                          partition_sizze_203667) +\n                                                                          gtid_213807 *\n                                                                          n_p_203574 +\n                                                                          gtid_213808];\n                        defunc_0_f_res_213849 = defunc_0_add_arg_213851;\n                    }\n                    \n                    int64_t binop_p_213852 = sub64(defunc_0_f_res_213845,\n                                                   defunc_0_m_fun_res_213822);\n                    double defunc_0_f_res_213853 =\n                           sitofp_i64_f64(binop_p_213852);\n                    double abs_res_213854 = fabs(defunc_0_f_res_213853);\n                    double tmp1_213855 = abs_res_213854 / x_213820;\n                    double x_213856 = tmp1_213855 * tmp1_213855;\n                    double y_213857 = tmp1_213855 * x_213856;\n                    double tmp2_213858 = 1.0 - y_213857;\n                    double x_213859 = tmp2_213858 * tmp2_213858;\n                    double tmp3_213860 = tmp2_213858 * x_213859;\n                    double w_j_213861 = defunc_0_f_res_213849 * tmp3_213860;\n                    double xw_j_213862 = defunc_0_f_res_213853 * w_j_213861;\n                    double x2w_j_213863 = defunc_0_f_res_213853 * xw_j_213862;\n                    double defunc_1_op_res_213836 = w_j_213861 + redout_228590;\n                    double defunc_1_op_res_213839 = xw_j_213862 + redout_228591;\n                    double defunc_1_op_res_213842 = x2w_j_213863 +\n                           redout_228592;\n                    double redout_tmp_233471 = defunc_1_op_res_213836;\n                    double redout_tmp_233472 = defunc_1_op_res_213839;\n                    double redout_tmp_233473 = defunc_1_op_res_213842;\n                    \n                    redout_228590 = redout_tmp_233471;\n           ",
            "         redout_228591 = redout_tmp_233472;\n                    redout_228592 = redout_tmp_233473;\n                }\n                defunc_2_reduce_res_213831 = redout_228590;\n                defunc_2_reduce_res_213832 = redout_228591;\n                defunc_2_reduce_res_213833 = redout_228592;\n                \n                double x_213864 = defunc_2_reduce_res_213831 *\n                       defunc_2_reduce_res_213833;\n                double y_213865 = defunc_2_reduce_res_213832 *\n                       defunc_2_reduce_res_213832;\n                double y_213866 = x_213864 - y_213865;\n                double det1_213867 = 1.0 / y_213866;\n                double a11_213868 = defunc_2_reduce_res_213833 * det1_213867;\n                double x_213869 = 0.0 - defunc_2_reduce_res_213832;\n                double b11_213870 = det1_213867 * x_213869;\n                double c11_213871 = defunc_2_reduce_res_213831 * det1_213867;\n                int64_t defunc_0_m_fun_res_213872;\n                \n                if (cond_213821) {\n                    defunc_0_m_fun_res_213872 = (int64_t) 0;\n                } else {\n                    int64_t y_213873 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_213874 = i_229047 == y_213873;\n                    int64_t defunc_0_m_fun_res_f_res_213875;\n                    \n                    if (cond_213874) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213876 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213875 =\n                            defunc_0_m_fun_res_f_res_t_res_213876;\n                    } else {\n                        int64_t x_213877 = sub64(i_229047, (int64_t) 1);\n                        int64_t x_213878 = mul64(jump_s_203581, x_213877);\n                        int64_t min_arg_213879 = add64((int64_t) 1, x_213878);\n                        int64_t min_res_213880 = smin64(defunc_0_f_res_2",
            "03721,\n                                                        min_arg_213879);\n                        \n                        defunc_0_m_fun_res_f_res_213875 = min_res_213880;\n                    }\n                    defunc_0_m_fun_res_213872 = defunc_0_m_fun_res_f_res_213875;\n                }\n                \n                double defunc_2_reduce_res_213881;\n                double defunc_2_reduce_res_213882;\n                double redout_228594;\n                double redout_228595;\n                \n                redout_228594 = 0.0;\n                redout_228595 = 0.0;\n                for (int64_t i_228596 = 0; i_228596 < q_s_203575; i_228596++) {\n                    bool cond_213890 = sle64(x_213813, i_228596);\n                    int64_t defunc_0_f_res_213891;\n                    \n                    if (cond_213890) {\n                        defunc_0_f_res_213891 = (int64_t) 0;\n                    } else {\n                        int64_t i_213892 = add64(x_213819, i_228596);\n                        int64_t defunc_0_add_arg_213893;\n                        \n                        defunc_0_add_arg_213893 = ((__global\n                                                    int64_t *) mem_229970)[i_213892 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_213807 *\n                                                                           n_p_203574 +\n                                                                           gtid_213808];\n                        \n                        int64_t defunc_1_add_res_213894 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213893);\n                        \n                        defunc_0_f_res_213891 = defunc_1_add_res_213894;\n                    }",
            "\n                    \n                    double defunc_0_f_res_213895;\n                    \n                    if (cond_213890) {\n                        defunc_0_f_res_213895 = 0.0;\n                    } else {\n                        int64_t i_213896 = add64(x_213819, i_228596);\n                        double defunc_0_add_arg_213897;\n                        \n                        defunc_0_add_arg_213897 = ((__global\n                                                    double *) mem_229974)[i_213896 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_213807 *\n                                                                          n_p_203574 +\n                                                                          gtid_213808];\n                        defunc_0_f_res_213895 = defunc_0_add_arg_213897;\n                    }\n                    \n                    int64_t binop_p_213898 = sub64(defunc_0_f_res_213891,\n                                                   defunc_0_m_fun_res_213872);\n                    double defunc_0_f_res_213899 =\n                           sitofp_i64_f64(binop_p_213898);\n                    double abs_res_213900 = fabs(defunc_0_f_res_213899);\n                    double tmp1_213901 = abs_res_213900 / x_213820;\n                    double x_213902 = tmp1_213901 * tmp1_213901;\n                    double y_213903 = tmp1_213901 * x_213902;\n                    double tmp2_213904 = 1.0 - y_213903;\n                    double x_213905 = tmp2_213904 * tmp2_213904;\n                    double tmp3_213906 = tmp2_213904 * x_213905;\n                    double tmp4_213907 = defunc_0_f_res_213895 * tmp3_213906;\n                    double defunc_1_f_res_213908 = defunc_0_f_res_213899 *\n                           tmp4_213907;\n          ",
            "          double defunc_0_f_res_213909;\n                    \n                    if (cond_213890) {\n                        defunc_0_f_res_213909 = 0.0;\n                    } else {\n                        int64_t i_213910 = add64(x_213819, i_228596);\n                        double defunc_0_add_arg_213911;\n                        \n                        defunc_0_add_arg_213911 = ((__global\n                                                    double *) mem_229978)[i_213910 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_213807 *\n                                                                          n_p_203574 +\n                                                                          gtid_213808];\n                        defunc_0_f_res_213909 = defunc_0_add_arg_213911;\n                    }\n                    \n                    double x_213912 = a11_213868 * tmp4_213907;\n                    double y_213913 = b11_213870 * defunc_1_f_res_213908;\n                    double x_213914 = x_213912 + y_213913;\n                    double defunc_9_fit_fun_res_213915 = defunc_0_f_res_213909 *\n                           x_213914;\n                    double x_213916 = b11_213870 * tmp4_213907;\n                    double y_213917 = c11_213871 * defunc_1_f_res_213908;\n                    double x_213918 = x_213916 + y_213917;\n                    double defunc_9_slope_fun_res_213919 =\n                           defunc_0_f_res_213909 * x_213918;\n                    double defunc_1_op_res_213885 =\n                           defunc_9_fit_fun_res_213915 + redout_228594;\n                    double defunc_1_op_res_213888 =\n                           defunc_9_slope_fun_res_213919 + redout_228595;\n                    double redout_tmp_233474 = defunc_1_op_res_213885;\n",
            "                    double redout_tmp_233475 = defunc_1_op_res_213888;\n                    \n                    redout_228594 = redout_tmp_233474;\n                    redout_228595 = redout_tmp_233475;\n                }\n                defunc_2_reduce_res_213881 = redout_228594;\n                defunc_2_reduce_res_213882 = redout_228595;\n                ((__global double *) color_232106)[phys_tid_213809 + i_229047 *\n                                                   num_threads_232234] =\n                    defunc_2_reduce_res_213881;\n                ((__global double *) color_232105)[phys_tid_213809 + i_229047 *\n                                                   num_threads_232234] =\n                    defunc_2_reduce_res_213882;\n            }\n            for (int64_t i_233476 = 0; i_233476 < s_n_m_203726; i_233476++) {\n                double tmp_233477;\n                \n                tmp_233477 = ((__global\n                               double *) color_232106)[phys_tid_213809 +\n                                                       i_233476 *\n                                                       num_threads_232234];\n                ((__global double *) mem_230013)[gtid_213807 * n_p_203574 +\n                                                 gtid_213808 + i_233476 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233477;\n            }\n            for (int64_t i_233478 = 0; i_233478 < s_n_m_203726; i_233478++) {\n                double tmp_233479;\n                \n                tmp_233479 = ((__global\n                               double *) color_232105)[phys_tid_213809 +\n                                                       i_233478 *\n                                                       num_threads_232234];\n                ((__global double *) mem_230017)[gtid_213807 * n_p_203574 +\n                                                 gtid_213808 +",
            " i_233478 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233479;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_213786\n}\n__kernel void mainzisegmap_214084(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *ext_mem_229470, __global\n                                  unsigned char *ext_mem_229471, __global\n                                  unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639, __global\n                                  unsigned char *mem_230070, __global\n                                  unsigned char *mem_230075)\n{\n    #define segmap_group_sizze_214071 (mainzisegmap_group_sizze_212912)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233562;\n    int32_t local_tid_233563;\n    int64_t group_sizze_233566;\n    int32_t wave_sizze_233565;\n    int32_t group_tid_233564;\n    \n    global_tid_233562 = get_global_id(0);\n    local_tid_233563 = get_local_id(0);\n    group_sizze_233566 = get_local_size(0);\n    wave_sizze_233565 = LOCKSTEP_WIDTH;\n    group_tid_233564 = get_group_id(0);\n    \n    int32_t phys_tid_214084 = global_tid_23",
            "3562;\n    int64_t global_tid_233567 = sext_i32_i64(group_tid_233564) *\n            segmap_group_sizze_214071 + sext_i32_i64(local_tid_233563);\n    int64_t slice_233568 = s_n_m_203726;\n    int64_t slice_233569 = n_p_203574 * slice_233568;\n    int64_t slice_233570 = partition_sizze_203667 * slice_233569;\n    int64_t gtid_214081 = squot64(global_tid_233567, slice_233569);\n    int64_t remnant_233571 = global_tid_233567 - gtid_214081 * slice_233569;\n    int64_t gtid_214082 = squot64(remnant_233571, slice_233568);\n    int64_t remnant_233572 = remnant_233571 - gtid_214082 * slice_233568;\n    int64_t gtid_214083 = remnant_233572;\n    int64_t remnant_233573 = remnant_233572 - gtid_214083;\n    \n    if ((slt64(gtid_214081, partition_sizze_203667) && slt64(gtid_214082,\n                                                             n_p_203574)) &&\n        slt64(gtid_214083, s_n_m_203726)) {\n        int64_t x_214088;\n        \n        x_214088 = ((__global int64_t *) ext_mem_229372)[gtid_214081 *\n                                                         n_p_203574 +\n                                                         gtid_214082];\n        \n        int64_t x_214090;\n        \n        x_214090 = ((__global int64_t *) ext_mem_229471)[gtid_214081 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_214082 *\n                                                         s_n_m_203726 +\n                                                         gtid_214083];\n        \n        double x_214091;\n        \n        x_214091 = ((__global double *) ext_mem_229470)[gtid_214081 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_214082 *\n                                                        s_n_m_20",
            "3726 +\n                                                        gtid_214083];\n        \n        bool cond_214092 = gtid_214083 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_214093;\n        \n        if (cond_214092) {\n            defunc_0_m_fun_res_214093 = (int64_t) 0;\n        } else {\n            int64_t y_214094 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214095 = gtid_214083 == y_214094;\n            int64_t defunc_0_m_fun_res_f_res_214096;\n            \n            if (cond_214095) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214097 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214096 =\n                    defunc_0_m_fun_res_f_res_t_res_214097;\n            } else {\n                int64_t x_214098 = sub64(gtid_214083, (int64_t) 1);\n                int64_t x_214099 = mul64(jump_s_203581, x_214098);\n                int64_t min_arg_214100 = add64((int64_t) 1, x_214099);\n                int64_t min_res_214101 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214100);\n                \n                defunc_0_m_fun_res_f_res_214096 = min_res_214101;\n            }\n            defunc_0_m_fun_res_214093 = defunc_0_m_fun_res_f_res_214096;\n        }\n        \n        double defunc_2_reduce_res_214102;\n        double defunc_2_reduce_res_214103;\n        double defunc_2_reduce_res_214104;\n        double redout_228609;\n        double redout_228610;\n        double redout_228611;\n        \n        redout_228609 = 0.0;\n        redout_228610 = 0.0;\n        redout_228611 = 0.0;\n        for (int64_t i_228612 = 0; i_228612 < q_s_203575; i_228612++) {\n            bool cond_214115 = sle64(x_214088, i_228612);\n            int64_t defunc_0_f_res_214116;\n            \n            if (cond_214115) {\n                defunc_0_f_res_214116 = (int64_t) 0;\n            } else {\n                int64_t i_214117 = add64(x_214090, i_228612);\n                in",
            "t64_t defunc_0_add_arg_214118;\n                \n                defunc_0_add_arg_214118 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_214081 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_214082 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_214117];\n                \n                int64_t defunc_1_add_res_214119 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214118);\n                \n                defunc_0_f_res_214116 = defunc_1_add_res_214119;\n            }\n            \n            double defunc_0_f_res_214120;\n            \n            if (cond_214115) {\n                defunc_0_f_res_214120 = 0.0;\n            } else {\n                int64_t i_214121 = add64(x_214090, i_228612);\n                double defunc_0_add_arg_214122;\n                \n                defunc_0_add_arg_214122 = ((__global\n                                            double *) mem_229639)[gtid_214081 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_214082 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_214121];\n                defunc_0_f_res_214120 = defunc_0_add_arg_214122;\n            }\n            \n            int64_t binop_p_214123 = sub64(defunc_0_f_res_214116,\n                                           defunc_0_m_fun_res_214093);\n            double defunc_0_f_res",
            "_214124 = sitofp_i64_f64(binop_p_214123);\n            double abs_res_214125 = fabs(defunc_0_f_res_214124);\n            double tmp1_214126 = abs_res_214125 / x_214091;\n            double x_214127 = tmp1_214126 * tmp1_214126;\n            double y_214128 = tmp1_214126 * x_214127;\n            double tmp2_214129 = 1.0 - y_214128;\n            double x_214130 = tmp2_214129 * tmp2_214129;\n            double tmp3_214131 = tmp2_214129 * x_214130;\n            double w_j_214132 = defunc_0_f_res_214120 * tmp3_214131;\n            double xw_j_214133 = defunc_0_f_res_214124 * w_j_214132;\n            double x2w_j_214134 = defunc_0_f_res_214124 * xw_j_214133;\n            double defunc_1_op_res_214107 = w_j_214132 + redout_228609;\n            double defunc_1_op_res_214110 = xw_j_214133 + redout_228610;\n            double defunc_1_op_res_214113 = x2w_j_214134 + redout_228611;\n            double redout_tmp_233574 = defunc_1_op_res_214107;\n            double redout_tmp_233575 = defunc_1_op_res_214110;\n            double redout_tmp_233576 = defunc_1_op_res_214113;\n            \n            redout_228609 = redout_tmp_233574;\n            redout_228610 = redout_tmp_233575;\n            redout_228611 = redout_tmp_233576;\n        }\n        defunc_2_reduce_res_214102 = redout_228609;\n        defunc_2_reduce_res_214103 = redout_228610;\n        defunc_2_reduce_res_214104 = redout_228611;\n        \n        double x_214135 = defunc_2_reduce_res_214102 *\n               defunc_2_reduce_res_214104;\n        double y_214136 = defunc_2_reduce_res_214103 *\n               defunc_2_reduce_res_214103;\n        double y_214137 = x_214135 - y_214136;\n        double det1_214138 = 1.0 / y_214137;\n        double a11_214139 = defunc_2_reduce_res_214104 * det1_214138;\n        double x_214140 = 0.0 - defunc_2_reduce_res_214103;\n        double b11_214141 = det1_214138 * x_214140;\n        double c11_214142 = defunc_2_reduce_res_214102 * det1_214138;\n        int64_t defunc_0_m_fun_res_214143;\n        \n        if (cond_2140",
            "92) {\n            defunc_0_m_fun_res_214143 = (int64_t) 0;\n        } else {\n            int64_t y_214144 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214145 = gtid_214083 == y_214144;\n            int64_t defunc_0_m_fun_res_f_res_214146;\n            \n            if (cond_214145) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214147 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214146 =\n                    defunc_0_m_fun_res_f_res_t_res_214147;\n            } else {\n                int64_t x_214148 = sub64(gtid_214083, (int64_t) 1);\n                int64_t x_214149 = mul64(jump_s_203581, x_214148);\n                int64_t min_arg_214150 = add64((int64_t) 1, x_214149);\n                int64_t min_res_214151 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214150);\n                \n                defunc_0_m_fun_res_f_res_214146 = min_res_214151;\n            }\n            defunc_0_m_fun_res_214143 = defunc_0_m_fun_res_f_res_214146;\n        }\n        \n        double defunc_2_reduce_res_214152;\n        double defunc_2_reduce_res_214153;\n        double redout_228613;\n        double redout_228614;\n        \n        redout_228613 = 0.0;\n        redout_228614 = 0.0;\n        for (int64_t i_228615 = 0; i_228615 < q_s_203575; i_228615++) {\n            bool cond_214161 = sle64(x_214088, i_228615);\n            int64_t defunc_0_f_res_214162;\n            \n            if (cond_214161) {\n                defunc_0_f_res_214162 = (int64_t) 0;\n            } else {\n                int64_t i_214163 = add64(x_214090, i_228615);\n                int64_t defunc_0_add_arg_214164;\n                \n                defunc_0_add_arg_214164 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_214081 *\n                                                                       (defunc_0_f_res_203721 *\n                                  ",
            "                                      n_p_203574) +\n                                                                       gtid_214082 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_214163];\n                \n                int64_t defunc_1_add_res_214165 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214164);\n                \n                defunc_0_f_res_214162 = defunc_1_add_res_214165;\n            }\n            \n            double defunc_0_f_res_214166;\n            \n            if (cond_214161) {\n                defunc_0_f_res_214166 = 0.0;\n            } else {\n                int64_t i_214167 = add64(x_214090, i_228615);\n                double defunc_0_add_arg_214168;\n                \n                defunc_0_add_arg_214168 = ((__global\n                                            double *) mem_229639)[gtid_214081 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_214082 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_214167];\n                defunc_0_f_res_214166 = defunc_0_add_arg_214168;\n            }\n            \n            int64_t binop_p_214169 = sub64(defunc_0_f_res_214162,\n                                           defunc_0_m_fun_res_214143);\n            double defunc_0_f_res_214170 = sitofp_i64_f64(binop_p_214169);\n            double abs_res_214171 = fabs(defunc_0_f_res_214170);\n            double tmp1_214172 = abs_res_214171 / x_214091;\n            double x_214173 = tmp1_214172 * tmp1_214172;\n            double y_214174 = tmp1_214172 * x_214173;\n            double tmp2_214175 = 1.0 -",
            " y_214174;\n            double x_214176 = tmp2_214175 * tmp2_214175;\n            double tmp3_214177 = tmp2_214175 * x_214176;\n            double tmp4_214178 = defunc_0_f_res_214166 * tmp3_214177;\n            double defunc_1_f_res_214179 = defunc_0_f_res_214170 * tmp4_214178;\n            double defunc_0_f_res_214180;\n            \n            if (cond_214161) {\n                defunc_0_f_res_214180 = 0.0;\n            } else {\n                int64_t i_214181 = add64(x_214090, i_228615);\n                double defunc_0_add_arg_214182;\n                \n                defunc_0_add_arg_214182 = ((__global\n                                            double *) mem_229634)[gtid_214081 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_214082 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_214181];\n                defunc_0_f_res_214180 = defunc_0_add_arg_214182;\n            }\n            \n            double x_214183 = a11_214139 * tmp4_214178;\n            double y_214184 = b11_214141 * defunc_1_f_res_214179;\n            double x_214185 = x_214183 + y_214184;\n            double defunc_9_fit_fun_res_214186 = defunc_0_f_res_214180 *\n                   x_214185;\n            double x_214187 = b11_214141 * tmp4_214178;\n            double y_214188 = c11_214142 * defunc_1_f_res_214179;\n            double x_214189 = x_214187 + y_214188;\n            double defunc_9_slope_fun_res_214190 = defunc_0_f_res_214180 *\n                   x_214189;\n            double defunc_1_op_res_214156 = defunc_9_fit_fun_res_214186 +\n                   redout_228613;\n            double defunc_1_op_res_214159 = defunc_9_slope_fun_res_214190 +\n                   redout_228614;\n            double redout_tmp_23",
            "3577 = defunc_1_op_res_214156;\n            double redout_tmp_233578 = defunc_1_op_res_214159;\n            \n            redout_228613 = redout_tmp_233577;\n            redout_228614 = redout_tmp_233578;\n        }\n        defunc_2_reduce_res_214152 = redout_228613;\n        defunc_2_reduce_res_214153 = redout_228614;\n        ((__global double *) mem_230070)[gtid_214081 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214082 * s_n_m_203726 +\n                                         gtid_214083] =\n            defunc_2_reduce_res_214152;\n        ((__global double *) mem_230075)[gtid_214081 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214082 * s_n_m_203726 +\n                                         gtid_214083] =\n            defunc_2_reduce_res_214153;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214071\n}\n__kernel void mainzisegmap_214201(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230081, __global\n                                  unsigned char *mem_230085)\n{\n    #define segmap_group_sizze_214194 (mainzisegmap_group_sizze_213247)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233579;\n    int32_t local_tid_233580;\n    int64_t group_sizze_233583;\n    int32_t wave_sizze_233582;\n    int32_t group_tid_233581;\n    \n    global_tid_233579 = get_global_id(0);\n    local_tid_233580 = get_local_id(0);\n  ",
            "  group_sizze_233583 = get_local_size(0);\n    wave_sizze_233582 = LOCKSTEP_WIDTH;\n    group_tid_233581 = get_group_id(0);\n    \n    int32_t phys_tid_214201 = global_tid_233579;\n    int64_t global_tid_233584 = sext_i32_i64(group_tid_233581) *\n            segmap_group_sizze_214194 + sext_i32_i64(local_tid_233580);\n    int64_t slice_233585 = s_n_m_203726;\n    int64_t slice_233586 = n_p_203574 * slice_233585;\n    int64_t slice_233587 = partition_sizze_203667 * slice_233586;\n    int64_t gtid_214198 = squot64(global_tid_233584, slice_233586);\n    int64_t remnant_233588 = global_tid_233584 - gtid_214198 * slice_233586;\n    int64_t gtid_214199 = squot64(remnant_233588, slice_233585);\n    int64_t remnant_233589 = remnant_233588 - gtid_214199 * slice_233585;\n    int64_t gtid_214200 = remnant_233589;\n    int64_t remnant_233590 = remnant_233589 - gtid_214200;\n    \n    if ((slt64(gtid_214198, partition_sizze_203667) && slt64(gtid_214199,\n                                                             n_p_203574)) &&\n        slt64(gtid_214200, s_n_m_203726)) {\n        bool cond_214203 = gtid_214200 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_214204;\n        \n        if (cond_214203) {\n            defunc_0_m_fun_res_214204 = (int64_t) 0;\n        } else {\n            int64_t y_214205 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214206 = gtid_214200 == y_214205;\n            int64_t defunc_0_m_fun_res_f_res_214207;\n            \n            if (cond_214206) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214208 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214207 =\n                    defunc_0_m_fun_res_f_res_t_res_214208;\n            } else {\n                int64_t x_214209 = sub64(gtid_214200, (int64_t) 1);\n                int64_t x_214210 = mul64(jump_s_203581, x_214209);\n                int64_t min_arg_214211 = add64((int64_t) 1, x_214210);\n                int64_t min_res_214212",
            " = smin64(defunc_0_f_res_203721,\n                                                min_arg_214211);\n                \n                defunc_0_m_fun_res_f_res_214207 = min_res_214212;\n            }\n            defunc_0_m_fun_res_214204 = defunc_0_m_fun_res_f_res_214207;\n        }\n        ((__global int64_t *) mem_230081)[gtid_214198 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_214199 * s_n_m_203726 +\n                                          gtid_214200] =\n            defunc_0_m_fun_res_214204;\n        ((__global bool *) mem_230085)[gtid_214198 * (s_n_m_203726 *\n                                                      n_p_203574) +\n                                       gtid_214199 * s_n_m_203726 +\n                                       gtid_214200] = cond_214203;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214194\n}\n__kernel void mainzisegmap_214285(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230091, __global\n                                  unsigned char *mem_230096, __global\n                                  unsigned char *mem_230101, __global\n                                  unsigned char *mem_230107, __global\n                                  unsigned char *mem_230112, __global\n                                  unsigned char *mem_230117, __global\n                                  unsigned char *mem_230122)\n{\n    #define segmap_group_sizze_214276 (mainzisegmap_group_sizze_213144)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*glob",
            "al_failure >= 0)\n        return;\n    \n    int32_t global_tid_233695;\n    int32_t local_tid_233696;\n    int64_t group_sizze_233699;\n    int32_t wave_sizze_233698;\n    int32_t group_tid_233697;\n    \n    global_tid_233695 = get_global_id(0);\n    local_tid_233696 = get_local_id(0);\n    group_sizze_233699 = get_local_size(0);\n    wave_sizze_233698 = LOCKSTEP_WIDTH;\n    group_tid_233697 = get_group_id(0);\n    \n    int32_t phys_tid_214285 = global_tid_233695;\n    int64_t global_tid_233700 = sext_i32_i64(group_tid_233697) *\n            segmap_group_sizze_214276 + sext_i32_i64(local_tid_233696);\n    int64_t slice_233701 = s_n_m_203726;\n    int64_t slice_233702 = n_p_203574 * slice_233701;\n    int64_t slice_233703 = partition_sizze_203667 * slice_233702;\n    int64_t gtid_214282 = squot64(global_tid_233700, slice_233702);\n    int64_t remnant_233704 = global_tid_233700 - gtid_214282 * slice_233702;\n    int64_t gtid_214283 = squot64(remnant_233704, slice_233701);\n    int64_t remnant_233705 = remnant_233704 - gtid_214283 * slice_233701;\n    int64_t gtid_214284 = remnant_233705;\n    int64_t remnant_233706 = remnant_233705 - gtid_214284;\n    \n    if ((slt64(gtid_214282, partition_sizze_203667) && slt64(gtid_214283,\n                                                             n_p_203574)) &&\n        slt64(gtid_214284, s_n_m_203726)) {\n        bool index_primexp_228814 = gtid_214284 == (int64_t) 0;\n        double defunc_2_reduce_res_214288;\n        \n        defunc_2_reduce_res_214288 = ((__global\n                                       double *) mem_230091)[gtid_214282 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214283 *\n                                                             s_n_m_203726 +\n                                                             gtid_214284];\n        \n        double defunc_2_reduce_re",
            "s_214289;\n        \n        defunc_2_reduce_res_214289 = ((__global\n                                       double *) mem_230096)[gtid_214282 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214283 *\n                                                             s_n_m_203726 +\n                                                             gtid_214284];\n        \n        double defunc_2_reduce_res_214290;\n        \n        defunc_2_reduce_res_214290 = ((__global\n                                       double *) mem_230101)[gtid_214282 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214283 *\n                                                             s_n_m_203726 +\n                                                             gtid_214284];\n        \n        double x_214291 = defunc_2_reduce_res_214288 *\n               defunc_2_reduce_res_214290;\n        double y_214292 = defunc_2_reduce_res_214289 *\n               defunc_2_reduce_res_214289;\n        double y_214293 = x_214291 - y_214292;\n        double det1_214294 = 1.0 / y_214293;\n        double a11_214295 = defunc_2_reduce_res_214290 * det1_214294;\n        double x_214296 = 0.0 - defunc_2_reduce_res_214289;\n        double b11_214297 = det1_214294 * x_214296;\n        double c11_214298 = defunc_2_reduce_res_214288 * det1_214294;\n        int64_t defunc_0_m_fun_res_214299;\n        \n        if (index_primexp_228814) {\n            defunc_0_m_fun_res_214299 = (int64_t) 0;\n        } else {\n            int64_t y_214300 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214301 = gtid_214284 == y_214300;\n            int64_t defunc_0_m_fun_res_f_res_214302;\n            \n            if (cond_2",
            "14301) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214303 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214302 =\n                    defunc_0_m_fun_res_f_res_t_res_214303;\n            } else {\n                int64_t x_214304 = sub64(gtid_214284, (int64_t) 1);\n                int64_t x_214305 = mul64(jump_s_203581, x_214304);\n                int64_t min_arg_214306 = add64((int64_t) 1, x_214305);\n                int64_t min_res_214307 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214306);\n                \n                defunc_0_m_fun_res_f_res_214302 = min_res_214307;\n            }\n            defunc_0_m_fun_res_214299 = defunc_0_m_fun_res_f_res_214302;\n        }\n        ((__global double *) mem_230107)[gtid_214282 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214283 * s_n_m_203726 +\n                                         gtid_214284] = a11_214295;\n        ((__global double *) mem_230112)[gtid_214282 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214283 * s_n_m_203726 +\n                                         gtid_214284] = b11_214297;\n        ((__global double *) mem_230117)[gtid_214282 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_214283 * s_n_m_203726 +\n                                         gtid_214284] = c11_214298;\n        ((__global int64_t *) mem_230122)[gtid_214282 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_214283 * s_n_m_203726 +\n                                          gtid_214284] =\n            defunc_0_m_fun_res_214299;\n    }\n    \n  error_0:\n    return;\n    #undef se",
            "gmap_group_sizze_214276\n}\n__kernel void mainzisegmap_214560(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_214555,\n                                  int64_t num_threads_232243, __global\n                                  unsigned char *mem_230169, __global\n                                  unsigned char *mem_230172, __global\n                                  unsigned char *mem_230176, __global\n                                  unsigned char *mem_230180, __global\n                                  unsigned char *mem_230184, __global\n                                  unsigned char *mem_230188, __global\n                                  unsigned char *mem_230281, __global\n                                  unsigned char *mem_230285, __global\n                                  unsigned char *color_232115, __global\n                                  unsigned char *color_232116)\n{\n    #define segmap_group_sizze_214554 (mainzisegmap_group_sizze_214396)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233805;\n    int32_t local_tid_233806;\n    int64_t group_sizze_233809;\n    int32_t wave_sizze_233808;\n    int32_t group_tid_233807;\n    \n    global_tid_233805 = get_global_id(0);\n    local_tid_233806 = get_local_id(0);\n    group_sizze_233809 = get_local_size(0);\n    wave_sizze_233808 = LOCKSTEP_WIDTH;\n    group_tid_233807 = get_group_id(0);\n    \n    int32_t phys_tid_214560 = global_tid_233805;\n    int32_t phys_group_id_233810;\n    \n    phys_group_id_23",
            "3810 = get_group_id(0);\n    for (int32_t i_233811 = 0; i_233811 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_214554)) -\n                   phys_group_id_233810, sext_i64_i32(num_groups_214555));\n         i_233811++) {\n        int32_t virt_group_id_233812 = phys_group_id_233810 + i_233811 *\n                sext_i64_i32(num_groups_214555);\n        int64_t global_tid_233813 = sext_i32_i64(virt_group_id_233812) *\n                segmap_group_sizze_214554 + sext_i32_i64(local_tid_233806);\n        int64_t slice_233814 = partition_sizze_203667;\n        int64_t gtid_214559 = global_tid_233813;\n        int64_t remnant_233815 = global_tid_233813 - gtid_214559;\n        \n        if (slt64(gtid_214559, partition_sizze_203667)) {\n            for (int64_t i_229054 = 0; i_229054 < n_p_203574; i_229054++) {\n                int64_t x_214572;\n                \n                x_214572 = ((__global int64_t *) mem_230172)[i_229054 *\n                                                             partition_sizze_203667 +\n                                                             gtid_214559];\n                for (int64_t i_229061 = 0; i_229061 < s_n_m_203726;\n                     i_229061++) {\n                    int64_t x_214578;\n                    \n                    x_214578 = ((__global int64_t *) mem_230180)[i_229054 *\n                                                                 (partition_sizze_203667 *\n                                                                  s_n_m_203726) +\n                                                                 i_229061 *\n                                                                 partition_sizze_203667 +\n                                                                 gtid_214559];\n                    \n                    double x_214579;\n                    \n                    x_214579 = ((__global double *) mem_230169)[i_229054 *\n                    ",
            "                                            (partition_sizze_203667 *\n                                                                 s_n_m_203726) +\n                                                                i_229061 *\n                                                                partition_sizze_203667 +\n                                                                gtid_214559];\n                    \n                    bool cond_214580 = i_229061 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_214581;\n                    \n                    if (cond_214580) {\n                        defunc_0_m_fun_res_214581 = (int64_t) 0;\n                    } else {\n                        int64_t y_214582 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_214583 = i_229061 == y_214582;\n                        int64_t defunc_0_m_fun_res_f_res_214584;\n                        \n                        if (cond_214583) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214585 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214584 =\n                                defunc_0_m_fun_res_f_res_t_res_214585;\n                        } else {\n                            int64_t x_214586 = sub64(i_229061, (int64_t) 1);\n                            int64_t x_214587 = mul64(jump_s_203581, x_214586);\n                            int64_t min_arg_214588 = add64((int64_t) 1,\n                                                           x_214587);\n                            int64_t min_res_214589 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_214588);\n                            \n                            defunc_0_m_fun_res_f_res_214584 = min_res_214589;\n                        }\n                        defunc_0_m_fun_res_214581 =\n                            d",
            "efunc_0_m_fun_res_f_res_214584;\n                    }\n                    \n                    double defunc_2_reduce_res_214590;\n                    double defunc_2_reduce_res_214591;\n                    double defunc_2_reduce_res_214592;\n                    double defunc_2_reduce_res_214593;\n                    double defunc_2_reduce_res_214594;\n                    double redout_228630;\n                    double redout_228631;\n                    double redout_228632;\n                    double redout_228633;\n                    double redout_228634;\n                    \n                    redout_228630 = 0.0;\n                    redout_228631 = 0.0;\n                    redout_228632 = 0.0;\n                    redout_228633 = 0.0;\n                    redout_228634 = 0.0;\n                    for (int64_t i_228635 = 0; i_228635 < q_s_203575;\n                         i_228635++) {\n                        bool cond_214611 = sle64(x_214572, i_228635);\n                        int64_t defunc_0_f_res_214612;\n                        \n                        if (cond_214611) {\n                            defunc_0_f_res_214612 = (int64_t) 0;\n                        } else {\n                            int64_t i_214613 = add64(x_214578, i_228635);\n                            int64_t defunc_0_add_arg_214614;\n                            \n                            defunc_0_add_arg_214614 = ((__global\n                                                        int64_t *) mem_230188)[i_229054 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_214613 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_214559]",
            ";\n                            \n                            int64_t defunc_1_add_res_214615 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214614);\n                            \n                            defunc_0_f_res_214612 = defunc_1_add_res_214615;\n                        }\n                        \n                        double defunc_0_f_res_214616;\n                        \n                        if (cond_214611) {\n                            defunc_0_f_res_214616 = 0.0;\n                        } else {\n                            int64_t i_214617 = add64(x_214578, i_228635);\n                            double defunc_0_add_arg_214618;\n                            \n                            defunc_0_add_arg_214618 = ((__global\n                                                        double *) mem_230176)[i_229054 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_214617 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_214559];\n                            defunc_0_f_res_214616 = defunc_0_add_arg_214618;\n                        }\n                        \n                        int64_t binop_p_214619 = sub64(defunc_0_f_res_214612,\n                                                       defunc_0_m_fun_res_214581);\n                        double defunc_0_f_res_214620 =\n                               sitofp_i64_f64(binop_p_214619);\n                        double abs_res_214621 = fabs(defunc_0_f_res_214620);\n                        double tmp1_214622 = abs_res_214621 / x_214579;\n                        double x_214623 = tmp1_214622 * tmp1",
            "_214622;\n                        double y_214624 = tmp1_214622 * x_214623;\n                        double tmp2_214625 = 1.0 - y_214624;\n                        double x_214626 = tmp2_214625 * tmp2_214625;\n                        double tmp3_214627 = tmp2_214625 * x_214626;\n                        double w_j_214628 = defunc_0_f_res_214616 * tmp3_214627;\n                        double xw_j_214629 = defunc_0_f_res_214620 * w_j_214628;\n                        double x2w_j_214630 = defunc_0_f_res_214620 *\n                               xw_j_214629;\n                        double x3w_j_214631 = defunc_0_f_res_214620 *\n                               x2w_j_214630;\n                        double x4w_j_214632 = defunc_0_f_res_214620 *\n                               x3w_j_214631;\n                        double defunc_1_op_res_214597 = w_j_214628 +\n                               redout_228630;\n                        double defunc_1_op_res_214600 = xw_j_214629 +\n                               redout_228631;\n                        double defunc_1_op_res_214603 = x2w_j_214630 +\n                               redout_228632;\n                        double defunc_1_op_res_214606 = x3w_j_214631 +\n                               redout_228633;\n                        double defunc_1_op_res_214609 = x4w_j_214632 +\n                               redout_228634;\n                        double redout_tmp_233820 = defunc_1_op_res_214597;\n                        double redout_tmp_233821 = defunc_1_op_res_214600;\n                        double redout_tmp_233822 = defunc_1_op_res_214603;\n                        double redout_tmp_233823 = defunc_1_op_res_214606;\n                        double redout_tmp_233824 = defunc_1_op_res_214609;\n                        \n                        redout_228630 = redout_tmp_233820;\n                        redout_228631 = redout_tmp_233821;\n                        redout_228632 = redout_tmp_233822;\n                        redout_228633 = redout_tmp_233823;\n  ",
            "                      redout_228634 = redout_tmp_233824;\n                    }\n                    defunc_2_reduce_res_214590 = redout_228630;\n                    defunc_2_reduce_res_214591 = redout_228631;\n                    defunc_2_reduce_res_214592 = redout_228632;\n                    defunc_2_reduce_res_214593 = redout_228633;\n                    defunc_2_reduce_res_214594 = redout_228634;\n                    \n                    double x_214633 = defunc_2_reduce_res_214592 *\n                           defunc_2_reduce_res_214594;\n                    double y_214634 = defunc_2_reduce_res_214593 *\n                           defunc_2_reduce_res_214593;\n                    double a12_214635 = x_214633 - y_214634;\n                    double x_214636 = defunc_2_reduce_res_214592 *\n                           defunc_2_reduce_res_214593;\n                    double y_214637 = defunc_2_reduce_res_214591 *\n                           defunc_2_reduce_res_214594;\n                    double b12_214638 = x_214636 - y_214637;\n                    double x_214639 = defunc_2_reduce_res_214591 *\n                           defunc_2_reduce_res_214593;\n                    double y_214640 = defunc_2_reduce_res_214592 *\n                           defunc_2_reduce_res_214592;\n                    double c12_214641 = x_214639 - y_214640;\n                    double x_214642 = defunc_2_reduce_res_214590 *\n                           defunc_2_reduce_res_214594;\n                    double b2_214643 = x_214642 - y_214640;\n                    double x_214644 = defunc_2_reduce_res_214591 *\n                           defunc_2_reduce_res_214592;\n                    double y_214645 = defunc_2_reduce_res_214590 *\n                           defunc_2_reduce_res_214593;\n                    double c2_214646 = x_214644 - y_214645;\n                    double x_214647 = defunc_2_reduce_res_214590 * a12_214635;\n                    double y_214648 = defunc_2_reduce_res_214591 * b12_214638;\n                    d",
            "ouble x_214649 = x_214647 + y_214648;\n                    double y_214650 = defunc_2_reduce_res_214592 * c12_214641;\n                    double y_214651 = x_214649 + y_214650;\n                    double det_214652 = 1.0 / y_214651;\n                    double a12_214653 = a12_214635 * det_214652;\n                    double b12_214654 = b12_214638 * det_214652;\n                    double c12_214655 = c12_214641 * det_214652;\n                    double b2_214656 = b2_214643 * det_214652;\n                    double c2_214657 = c2_214646 * det_214652;\n                    int64_t defunc_0_m_fun_res_214658;\n                    \n                    if (cond_214580) {\n                        defunc_0_m_fun_res_214658 = (int64_t) 0;\n                    } else {\n                        int64_t y_214659 = sub64(s_n_m_203726, (int64_t) 1);\n                        bool cond_214660 = i_229061 == y_214659;\n                        int64_t defunc_0_m_fun_res_f_res_214661;\n                        \n                        if (cond_214660) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214662 =\n                                    sub64(pad_css_len_203722, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214661 =\n                                defunc_0_m_fun_res_f_res_t_res_214662;\n                        } else {\n                            int64_t x_214663 = sub64(i_229061, (int64_t) 1);\n                            int64_t x_214664 = mul64(jump_s_203581, x_214663);\n                            int64_t min_arg_214665 = add64((int64_t) 1,\n                                                           x_214664);\n                            int64_t min_res_214666 =\n                                    smin64(defunc_0_f_res_203721,\n                                           min_arg_214665);\n                            \n                            defunc_0_m_fun_res_f_res_214661 = min_res_214666;\n                        }\n      ",
            "                  defunc_0_m_fun_res_214658 =\n                            defunc_0_m_fun_res_f_res_214661;\n                    }\n                    \n                    double defunc_2_reduce_res_214667;\n                    double defunc_2_reduce_res_214668;\n                    double redout_228636;\n                    double redout_228637;\n                    \n                    redout_228636 = 0.0;\n                    redout_228637 = 0.0;\n                    for (int64_t i_228638 = 0; i_228638 < q_s_203575;\n                         i_228638++) {\n                        bool cond_214676 = sle64(x_214572, i_228638);\n                        int64_t defunc_0_f_res_214677;\n                        \n                        if (cond_214676) {\n                            defunc_0_f_res_214677 = (int64_t) 0;\n                        } else {\n                            int64_t i_214678 = add64(x_214578, i_228638);\n                            int64_t defunc_0_add_arg_214679;\n                            \n                            defunc_0_add_arg_214679 = ((__global\n                                                        int64_t *) mem_230188)[i_229054 *\n                                                                               (partition_sizze_203667 *\n                                                                                defunc_0_f_res_203721) +\n                                                                               i_214678 *\n                                                                               partition_sizze_203667 +\n                                                                               gtid_214559];\n                            \n                            int64_t defunc_1_add_res_214680 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214679);\n                            \n                            defunc_0_f_res_214677 = defunc_1_add_res_214680;\n                        }\n ",
            "                       \n                        double defunc_0_f_res_214681;\n                        \n                        if (cond_214676) {\n                            defunc_0_f_res_214681 = 0.0;\n                        } else {\n                            int64_t i_214682 = add64(x_214578, i_228638);\n                            double defunc_0_add_arg_214683;\n                            \n                            defunc_0_add_arg_214683 = ((__global\n                                                        double *) mem_230176)[i_229054 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_214682 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_214559];\n                            defunc_0_f_res_214681 = defunc_0_add_arg_214683;\n                        }\n                        \n                        int64_t binop_p_214684 = sub64(defunc_0_f_res_214677,\n                                                       defunc_0_m_fun_res_214658);\n                        double defunc_0_f_res_214685 =\n                               sitofp_i64_f64(binop_p_214684);\n                        double abs_res_214686 = fabs(defunc_0_f_res_214685);\n                        double tmp1_214687 = abs_res_214686 / x_214579;\n                        double x_214688 = tmp1_214687 * tmp1_214687;\n                        double y_214689 = tmp1_214687 * x_214688;\n                        double tmp2_214690 = 1.0 - y_214689;\n                        double x_214691 = tmp2_214690 * tmp2_214690;\n                        double tmp3_214692 = tmp2_214690 * x_214691;\n                        double tmp4_214693 = defunc_0_f_res_21468",
            "1 *\n                               tmp3_214692;\n                        double defunc_1_f_res_214694 = defunc_0_f_res_214685 *\n                               tmp4_214693;\n                        double defunc_1_f_res_214695 = defunc_0_f_res_214685 *\n                               defunc_1_f_res_214694;\n                        double defunc_0_f_res_214696;\n                        \n                        if (cond_214676) {\n                            defunc_0_f_res_214696 = 0.0;\n                        } else {\n                            int64_t i_214697 = add64(x_214578, i_228638);\n                            double defunc_0_add_arg_214698;\n                            \n                            defunc_0_add_arg_214698 = ((__global\n                                                        double *) mem_230184)[i_229054 *\n                                                                              (partition_sizze_203667 *\n                                                                               defunc_0_f_res_203721) +\n                                                                              i_214697 *\n                                                                              partition_sizze_203667 +\n                                                                              gtid_214559];\n                            defunc_0_f_res_214696 = defunc_0_add_arg_214698;\n                        }\n                        \n                        double x_214699 = a12_214653 * tmp4_214693;\n                        double y_214700 = b12_214654 * defunc_1_f_res_214694;\n                        double x_214701 = x_214699 + y_214700;\n                        double y_214702 = c12_214655 * defunc_1_f_res_214695;\n                        double x_214703 = x_214701 + y_214702;\n                        double defunc_9_fit_fun_res_214704 =\n                               defunc_0_f_res_214696 * x_214703;\n                        double x_214705 = b12_214654 * tmp4_214693;\n   ",
            "                     double y_214706 = b2_214656 * defunc_1_f_res_214694;\n                        double x_214707 = x_214705 + y_214706;\n                        double y_214708 = c2_214657 * defunc_1_f_res_214695;\n                        double x_214709 = x_214707 + y_214708;\n                        double defunc_9_slope_fun_res_214710 =\n                               defunc_0_f_res_214696 * x_214709;\n                        double defunc_1_op_res_214671 =\n                               defunc_9_fit_fun_res_214704 + redout_228636;\n                        double defunc_1_op_res_214674 =\n                               defunc_9_slope_fun_res_214710 + redout_228637;\n                        double redout_tmp_233825 = defunc_1_op_res_214671;\n                        double redout_tmp_233826 = defunc_1_op_res_214674;\n                        \n                        redout_228636 = redout_tmp_233825;\n                        redout_228637 = redout_tmp_233826;\n                    }\n                    defunc_2_reduce_res_214667 = redout_228636;\n                    defunc_2_reduce_res_214668 = redout_228637;\n                    ((__global double *) color_232116)[phys_tid_214560 +\n                                                       (i_229054 *\n                                                        (num_threads_232243 *\n                                                         s_n_m_203726) +\n                                                        i_229061 *\n                                                        num_threads_232243)] =\n                        defunc_2_reduce_res_214667;\n                    ((__global double *) color_232115)[phys_tid_214560 +\n                                                       (i_229054 *\n                                                        (num_threads_232243 *\n                                                         s_n_m_203726) +\n                                                        i_229061 *\n                                       ",
            "                 num_threads_232243)] =\n                        defunc_2_reduce_res_214668;\n                }\n            }\n            for (int64_t i_233827 = 0; i_233827 < n_p_203574; i_233827++) {\n                for (int64_t i_233828 = 0; i_233828 < s_n_m_203726;\n                     i_233828++) {\n                    double tmp_233829;\n                    \n                    tmp_233829 = ((__global\n                                   double *) color_232116)[phys_tid_214560 +\n                                                           (i_233827 *\n                                                            (num_threads_232243 *\n                                                             s_n_m_203726) +\n                                                            i_233828 *\n                                                            num_threads_232243)];\n                    ((__global double *) mem_230281)[gtid_214559 + (i_233827 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233828 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233829;\n                }\n            }\n            for (int64_t i_233830 = 0; i_233830 < n_p_203574; i_233830++) {\n                for (int64_t i_233831 = 0; i_233831 < s_n_m_203726;\n                     i_233831++) {\n                    double tmp_233832;\n                    \n                    tmp_233832 = ((__global\n                                   double *) color_232115)[phys_tid_214560 +\n                                                           (i_233830 *\n                                                            (num_threads_232243 *\n                                                             s_n_m_203726) +\n                                           ",
            "                 i_233831 *\n                                                            num_threads_232243)];\n                    ((__global double *) mem_230285)[gtid_214559 + (i_233830 *\n                                                                    (partition_sizze_203667 *\n                                                                     s_n_m_203726) +\n                                                                    i_233831 *\n                                                                    partition_sizze_203667)] =\n                        tmp_233832;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214554\n}\n__kernel void mainzisegmap_216352(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726,\n                                  int64_t num_groups_216330,\n                                  int64_t num_threads_232246, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *mem_230289, __global\n                                  unsigned char *mem_230293, __global\n                                  unsigned char *mem_230297, __global\n                                  unsigned char *mem_230301, __global\n                                  unsigned char *mem_230305, __global\n                                  unsigned char *mem_230340, __global\n                                  unsigned char *mem_230344, __global\n                                  unsigned char *color_232117, __global\n                                  ",
            "unsigned char *color_232118)\n{\n    #define segmap_group_sizze_216329 (mainzisegmap_group_sizze_214716)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233833;\n    int32_t local_tid_233834;\n    int64_t group_sizze_233837;\n    int32_t wave_sizze_233836;\n    int32_t group_tid_233835;\n    \n    global_tid_233833 = get_global_id(0);\n    local_tid_233834 = get_local_id(0);\n    group_sizze_233837 = get_local_size(0);\n    wave_sizze_233836 = LOCKSTEP_WIDTH;\n    group_tid_233835 = get_group_id(0);\n    \n    int32_t phys_tid_216352 = global_tid_233833;\n    int32_t phys_group_id_233838;\n    \n    phys_group_id_233838 = get_group_id(0);\n    for (int32_t i_233839 = 0; i_233839 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574,\n                                          segmap_group_sizze_216329)) -\n                   phys_group_id_233838, sext_i64_i32(num_groups_216330));\n         i_233839++) {\n        int32_t virt_group_id_233840 = phys_group_id_233838 + i_233839 *\n                sext_i64_i32(num_groups_216330);\n        int64_t global_tid_233841 = sext_i32_i64(virt_group_id_233840) *\n                segmap_group_sizze_216329 + sext_i32_i64(local_tid_233834);\n        int64_t slice_233842 = n_p_203574;\n        int64_t slice_233843 = partition_sizze_203667 * slice_233842;\n        int64_t gtid_216350 = squot64(global_tid_233841, slice_233842);\n        int64_t remnant_233844 = global_tid_233841 - gtid_216350 * slice_233842;\n        int64_t gtid_216351 = remnant_233844;\n        int64_t remnant_233845 = remnant_233844 - gtid_216351;\n        \n        if (slt64(gtid_216350, partition_sizze_203667) && slt64(gtid_216351,\n                                                                n_p_203574)) {\n            int64_t x_216356;\n            \n            x_216356 = ((__global int64_t *) ext_mem_229372)[gtid_216350 *\n                        ",
            "                                     n_p_203574 +\n                                                             gtid_216351];\n            for (int64_t i_229068 = 0; i_229068 < s_n_m_203726; i_229068++) {\n                int64_t x_216362;\n                \n                x_216362 = ((__global int64_t *) mem_230289)[i_229068 *\n                                                             (n_p_203574 *\n                                                              partition_sizze_203667) +\n                                                             gtid_216350 *\n                                                             n_p_203574 +\n                                                             gtid_216351];\n                \n                double x_216363;\n                \n                x_216363 = ((__global double *) mem_230293)[i_229068 *\n                                                            (n_p_203574 *\n                                                             partition_sizze_203667) +\n                                                            gtid_216350 *\n                                                            n_p_203574 +\n                                                            gtid_216351];\n                \n                bool cond_216364 = i_229068 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_216365;\n                \n                if (cond_216364) {\n                    defunc_0_m_fun_res_216365 = (int64_t) 0;\n                } else {\n                    int64_t y_216366 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_216367 = i_229068 == y_216366;\n                    int64_t defunc_0_m_fun_res_f_res_216368;\n                    \n                    if (cond_216367) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216369 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216368 =\n                   ",
            "         defunc_0_m_fun_res_f_res_t_res_216369;\n                    } else {\n                        int64_t x_216370 = sub64(i_229068, (int64_t) 1);\n                        int64_t x_216371 = mul64(jump_s_203581, x_216370);\n                        int64_t min_arg_216372 = add64((int64_t) 1, x_216371);\n                        int64_t min_res_216373 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_216372);\n                        \n                        defunc_0_m_fun_res_f_res_216368 = min_res_216373;\n                    }\n                    defunc_0_m_fun_res_216365 = defunc_0_m_fun_res_f_res_216368;\n                }\n                \n                double defunc_2_reduce_res_216374;\n                double defunc_2_reduce_res_216375;\n                double defunc_2_reduce_res_216376;\n                double defunc_2_reduce_res_216377;\n                double defunc_2_reduce_res_216378;\n                double redout_228643;\n                double redout_228644;\n                double redout_228645;\n                double redout_228646;\n                double redout_228647;\n                \n                redout_228643 = 0.0;\n                redout_228644 = 0.0;\n                redout_228645 = 0.0;\n                redout_228646 = 0.0;\n                redout_228647 = 0.0;\n                for (int64_t i_228648 = 0; i_228648 < q_s_203575; i_228648++) {\n                    bool cond_216395 = sle64(x_216356, i_228648);\n                    int64_t defunc_0_f_res_216396;\n                    \n                    if (cond_216395) {\n                        defunc_0_f_res_216396 = (int64_t) 0;\n                    } else {\n                        int64_t i_216397 = add64(x_216362, i_228648);\n                        int64_t defunc_0_add_arg_216398;\n                        \n                        defunc_0_add_arg_216398 = ((__global\n                                                    int64_t *) mem_230297)[i_216397 *\n              ",
            "                                                             (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_216350 *\n                                                                           n_p_203574 +\n                                                                           gtid_216351];\n                        \n                        int64_t defunc_1_add_res_216399 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216398);\n                        \n                        defunc_0_f_res_216396 = defunc_1_add_res_216399;\n                    }\n                    \n                    double defunc_0_f_res_216400;\n                    \n                    if (cond_216395) {\n                        defunc_0_f_res_216400 = 0.0;\n                    } else {\n                        int64_t i_216401 = add64(x_216362, i_228648);\n                        double defunc_0_add_arg_216402;\n                        \n                        defunc_0_add_arg_216402 = ((__global\n                                                    double *) mem_230301)[i_216401 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_216350 *\n                                                                          n_p_203574 +\n                                                                          gtid_216351];\n                        defunc_0_f_res_216400 = defunc_0_add_arg_216402;\n                    }\n                    \n                    int64_t binop_p_216403 = sub64(defunc_0_f_res_216396,\n                                                   defunc_0_m_fun_res_216365);\n              ",
            "      double defunc_0_f_res_216404 =\n                           sitofp_i64_f64(binop_p_216403);\n                    double abs_res_216405 = fabs(defunc_0_f_res_216404);\n                    double tmp1_216406 = abs_res_216405 / x_216363;\n                    double x_216407 = tmp1_216406 * tmp1_216406;\n                    double y_216408 = tmp1_216406 * x_216407;\n                    double tmp2_216409 = 1.0 - y_216408;\n                    double x_216410 = tmp2_216409 * tmp2_216409;\n                    double tmp3_216411 = tmp2_216409 * x_216410;\n                    double w_j_216412 = defunc_0_f_res_216400 * tmp3_216411;\n                    double xw_j_216413 = defunc_0_f_res_216404 * w_j_216412;\n                    double x2w_j_216414 = defunc_0_f_res_216404 * xw_j_216413;\n                    double x3w_j_216415 = defunc_0_f_res_216404 * x2w_j_216414;\n                    double x4w_j_216416 = defunc_0_f_res_216404 * x3w_j_216415;\n                    double defunc_1_op_res_216381 = w_j_216412 + redout_228643;\n                    double defunc_1_op_res_216384 = xw_j_216413 + redout_228644;\n                    double defunc_1_op_res_216387 = x2w_j_216414 +\n                           redout_228645;\n                    double defunc_1_op_res_216390 = x3w_j_216415 +\n                           redout_228646;\n                    double defunc_1_op_res_216393 = x4w_j_216416 +\n                           redout_228647;\n                    double redout_tmp_233848 = defunc_1_op_res_216381;\n                    double redout_tmp_233849 = defunc_1_op_res_216384;\n                    double redout_tmp_233850 = defunc_1_op_res_216387;\n                    double redout_tmp_233851 = defunc_1_op_res_216390;\n                    double redout_tmp_233852 = defunc_1_op_res_216393;\n                    \n                    redout_228643 = redout_tmp_233848;\n                    redout_228644 = redout_tmp_233849;\n                    redout_228645 = redout_tmp_233850;\n                    redout_",
            "228646 = redout_tmp_233851;\n                    redout_228647 = redout_tmp_233852;\n                }\n                defunc_2_reduce_res_216374 = redout_228643;\n                defunc_2_reduce_res_216375 = redout_228644;\n                defunc_2_reduce_res_216376 = redout_228645;\n                defunc_2_reduce_res_216377 = redout_228646;\n                defunc_2_reduce_res_216378 = redout_228647;\n                \n                double x_216417 = defunc_2_reduce_res_216376 *\n                       defunc_2_reduce_res_216378;\n                double y_216418 = defunc_2_reduce_res_216377 *\n                       defunc_2_reduce_res_216377;\n                double a12_216419 = x_216417 - y_216418;\n                double x_216420 = defunc_2_reduce_res_216376 *\n                       defunc_2_reduce_res_216377;\n                double y_216421 = defunc_2_reduce_res_216375 *\n                       defunc_2_reduce_res_216378;\n                double b12_216422 = x_216420 - y_216421;\n                double x_216423 = defunc_2_reduce_res_216375 *\n                       defunc_2_reduce_res_216377;\n                double y_216424 = defunc_2_reduce_res_216376 *\n                       defunc_2_reduce_res_216376;\n                double c12_216425 = x_216423 - y_216424;\n                double x_216426 = defunc_2_reduce_res_216374 *\n                       defunc_2_reduce_res_216378;\n                double b2_216427 = x_216426 - y_216424;\n                double x_216428 = defunc_2_reduce_res_216375 *\n                       defunc_2_reduce_res_216376;\n                double y_216429 = defunc_2_reduce_res_216374 *\n                       defunc_2_reduce_res_216377;\n                double c2_216430 = x_216428 - y_216429;\n                double x_216431 = defunc_2_reduce_res_216374 * a12_216419;\n                double y_216432 = defunc_2_reduce_res_216375 * b12_216422;\n                double x_216433 = x_216431 + y_216432;\n                double y_216434 = defunc_2_reduce_res_216376 * c12_2",
            "16425;\n                double y_216435 = x_216433 + y_216434;\n                double det_216436 = 1.0 / y_216435;\n                double a12_216437 = a12_216419 * det_216436;\n                double b12_216438 = b12_216422 * det_216436;\n                double c12_216439 = c12_216425 * det_216436;\n                double b2_216440 = b2_216427 * det_216436;\n                double c2_216441 = c2_216430 * det_216436;\n                int64_t defunc_0_m_fun_res_216442;\n                \n                if (cond_216364) {\n                    defunc_0_m_fun_res_216442 = (int64_t) 0;\n                } else {\n                    int64_t y_216443 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_216444 = i_229068 == y_216443;\n                    int64_t defunc_0_m_fun_res_f_res_216445;\n                    \n                    if (cond_216444) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216446 =\n                                sub64(pad_css_len_203722, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216445 =\n                            defunc_0_m_fun_res_f_res_t_res_216446;\n                    } else {\n                        int64_t x_216447 = sub64(i_229068, (int64_t) 1);\n                        int64_t x_216448 = mul64(jump_s_203581, x_216447);\n                        int64_t min_arg_216449 = add64((int64_t) 1, x_216448);\n                        int64_t min_res_216450 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_216449);\n                        \n                        defunc_0_m_fun_res_f_res_216445 = min_res_216450;\n                    }\n                    defunc_0_m_fun_res_216442 = defunc_0_m_fun_res_f_res_216445;\n                }\n                \n                double defunc_2_reduce_res_216451;\n                double defunc_2_reduce_res_216452;\n                double redout_228649;\n                double redout_228650;\n                \n       ",
            "         redout_228649 = 0.0;\n                redout_228650 = 0.0;\n                for (int64_t i_228651 = 0; i_228651 < q_s_203575; i_228651++) {\n                    bool cond_216460 = sle64(x_216356, i_228651);\n                    int64_t defunc_0_f_res_216461;\n                    \n                    if (cond_216460) {\n                        defunc_0_f_res_216461 = (int64_t) 0;\n                    } else {\n                        int64_t i_216462 = add64(x_216362, i_228651);\n                        int64_t defunc_0_add_arg_216463;\n                        \n                        defunc_0_add_arg_216463 = ((__global\n                                                    int64_t *) mem_230297)[i_216462 *\n                                                                           (n_p_203574 *\n                                                                            partition_sizze_203667) +\n                                                                           gtid_216350 *\n                                                                           n_p_203574 +\n                                                                           gtid_216351];\n                        \n                        int64_t defunc_1_add_res_216464 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216463);\n                        \n                        defunc_0_f_res_216461 = defunc_1_add_res_216464;\n                    }\n                    \n                    double defunc_0_f_res_216465;\n                    \n                    if (cond_216460) {\n                        defunc_0_f_res_216465 = 0.0;\n                    } else {\n                        int64_t i_216466 = add64(x_216362, i_228651);\n                        double defunc_0_add_arg_216467;\n                        \n                        defunc_0_add_arg_216467 = ((__global\n                                                    double *) mem_230301)[i_216466 *\n        ",
            "                                                                  (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_216350 *\n                                                                          n_p_203574 +\n                                                                          gtid_216351];\n                        defunc_0_f_res_216465 = defunc_0_add_arg_216467;\n                    }\n                    \n                    int64_t binop_p_216468 = sub64(defunc_0_f_res_216461,\n                                                   defunc_0_m_fun_res_216442);\n                    double defunc_0_f_res_216469 =\n                           sitofp_i64_f64(binop_p_216468);\n                    double abs_res_216470 = fabs(defunc_0_f_res_216469);\n                    double tmp1_216471 = abs_res_216470 / x_216363;\n                    double x_216472 = tmp1_216471 * tmp1_216471;\n                    double y_216473 = tmp1_216471 * x_216472;\n                    double tmp2_216474 = 1.0 - y_216473;\n                    double x_216475 = tmp2_216474 * tmp2_216474;\n                    double tmp3_216476 = tmp2_216474 * x_216475;\n                    double tmp4_216477 = defunc_0_f_res_216465 * tmp3_216476;\n                    double defunc_1_f_res_216478 = defunc_0_f_res_216469 *\n                           tmp4_216477;\n                    double defunc_1_f_res_216479 = defunc_0_f_res_216469 *\n                           defunc_1_f_res_216478;\n                    double defunc_0_f_res_216480;\n                    \n                    if (cond_216460) {\n                        defunc_0_f_res_216480 = 0.0;\n                    } else {\n                        int64_t i_216481 = add64(x_216362, i_228651);\n                        double defunc_0_add_arg_216482;\n                        \n                        defunc_0_add_arg_216482 = ((__global\n",
            "                                                    double *) mem_230305)[i_216481 *\n                                                                          (n_p_203574 *\n                                                                           partition_sizze_203667) +\n                                                                          gtid_216350 *\n                                                                          n_p_203574 +\n                                                                          gtid_216351];\n                        defunc_0_f_res_216480 = defunc_0_add_arg_216482;\n                    }\n                    \n                    double x_216483 = a12_216437 * tmp4_216477;\n                    double y_216484 = b12_216438 * defunc_1_f_res_216478;\n                    double x_216485 = x_216483 + y_216484;\n                    double y_216486 = c12_216439 * defunc_1_f_res_216479;\n                    double x_216487 = x_216485 + y_216486;\n                    double defunc_9_fit_fun_res_216488 = defunc_0_f_res_216480 *\n                           x_216487;\n                    double x_216489 = b12_216438 * tmp4_216477;\n                    double y_216490 = b2_216440 * defunc_1_f_res_216478;\n                    double x_216491 = x_216489 + y_216490;\n                    double y_216492 = c2_216441 * defunc_1_f_res_216479;\n                    double x_216493 = x_216491 + y_216492;\n                    double defunc_9_slope_fun_res_216494 =\n                           defunc_0_f_res_216480 * x_216493;\n                    double defunc_1_op_res_216455 =\n                           defunc_9_fit_fun_res_216488 + redout_228649;\n                    double defunc_1_op_res_216458 =\n                           defunc_9_slope_fun_res_216494 + redout_228650;\n                    double redout_tmp_233853 = defunc_1_op_res_216455;\n                    double redout_tmp_233854 = defunc_1_op_res_216458;\n                    \n                    redout_228649 = re",
            "dout_tmp_233853;\n                    redout_228650 = redout_tmp_233854;\n                }\n                defunc_2_reduce_res_216451 = redout_228649;\n                defunc_2_reduce_res_216452 = redout_228650;\n                ((__global double *) color_232118)[phys_tid_216352 + i_229068 *\n                                                   num_threads_232246] =\n                    defunc_2_reduce_res_216451;\n                ((__global double *) color_232117)[phys_tid_216352 + i_229068 *\n                                                   num_threads_232246] =\n                    defunc_2_reduce_res_216452;\n            }\n            for (int64_t i_233855 = 0; i_233855 < s_n_m_203726; i_233855++) {\n                double tmp_233856;\n                \n                tmp_233856 = ((__global\n                               double *) color_232118)[phys_tid_216352 +\n                                                       i_233855 *\n                                                       num_threads_232246];\n                ((__global double *) mem_230340)[gtid_216350 * n_p_203574 +\n                                                 gtid_216351 + i_233855 *\n                                                 (n_p_203574 *\n                                                  partition_sizze_203667)] =\n                    tmp_233856;\n            }\n            for (int64_t i_233857 = 0; i_233857 < s_n_m_203726; i_233857++) {\n                double tmp_233858;\n                \n                tmp_233858 = ((__global\n                               double *) color_232117)[phys_tid_216352 +\n                                                       i_233857 *\n                                                       num_threads_232246];\n                ((__global double *) mem_230344)[gtid_216350 * n_p_203574 +\n                                                 gtid_216351 + i_233857 *\n                                                 (n_p_203574 *\n                                                  parti",
            "tion_sizze_203667)] =\n                    tmp_233858;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216329\n}\n__kernel void mainzisegmap_216697(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t q_s_203575,\n                                  int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_229372, __global\n                                  unsigned char *ext_mem_229373, __global\n                                  unsigned char *ext_mem_229470, __global\n                                  unsigned char *ext_mem_229471, __global\n                                  unsigned char *mem_229634, __global\n                                  unsigned char *mem_229639, __global\n                                  unsigned char *mem_230409, __global\n                                  unsigned char *mem_230414)\n{\n    #define segmap_group_sizze_216684 (mainzisegmap_group_sizze_215257)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233957;\n    int32_t local_tid_233958;\n    int64_t group_sizze_233961;\n    int32_t wave_sizze_233960;\n    int32_t group_tid_233959;\n    \n    global_tid_233957 = get_global_id(0);\n    local_tid_233958 = get_local_id(0);\n    group_sizze_233961 = get_local_size(0);\n    wave_sizze_233960 = LOCKSTEP_WIDTH;\n    group_tid_233959 = get_group_id(0);\n    \n    int32_t phys_tid_216697 = global_tid_233957;\n    int64_t global_tid_233962 = sext_i32_i64(group_tid_233959) *\n            segmap_group_sizze_216684 + sext_i32_i64(local_",
            "tid_233958);\n    int64_t slice_233963 = s_n_m_203726;\n    int64_t slice_233964 = n_p_203574 * slice_233963;\n    int64_t slice_233965 = partition_sizze_203667 * slice_233964;\n    int64_t gtid_216694 = squot64(global_tid_233962, slice_233964);\n    int64_t remnant_233966 = global_tid_233962 - gtid_216694 * slice_233964;\n    int64_t gtid_216695 = squot64(remnant_233966, slice_233963);\n    int64_t remnant_233967 = remnant_233966 - gtid_216695 * slice_233963;\n    int64_t gtid_216696 = remnant_233967;\n    int64_t remnant_233968 = remnant_233967 - gtid_216696;\n    \n    if ((slt64(gtid_216694, partition_sizze_203667) && slt64(gtid_216695,\n                                                             n_p_203574)) &&\n        slt64(gtid_216696, s_n_m_203726)) {\n        int64_t x_216701;\n        \n        x_216701 = ((__global int64_t *) ext_mem_229372)[gtid_216694 *\n                                                         n_p_203574 +\n                                                         gtid_216695];\n        \n        int64_t x_216703;\n        \n        x_216703 = ((__global int64_t *) ext_mem_229471)[gtid_216694 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_216695 *\n                                                         s_n_m_203726 +\n                                                         gtid_216696];\n        \n        double x_216704;\n        \n        x_216704 = ((__global double *) ext_mem_229470)[gtid_216694 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_216695 *\n                                                        s_n_m_203726 +\n                                                        gtid_216696];\n        \n        bool cond_216705 = gtid_216696 == (i",
            "nt64_t) 0;\n        int64_t defunc_0_m_fun_res_216706;\n        \n        if (cond_216705) {\n            defunc_0_m_fun_res_216706 = (int64_t) 0;\n        } else {\n            int64_t y_216707 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216708 = gtid_216696 == y_216707;\n            int64_t defunc_0_m_fun_res_f_res_216709;\n            \n            if (cond_216708) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216710 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216709 =\n                    defunc_0_m_fun_res_f_res_t_res_216710;\n            } else {\n                int64_t x_216711 = sub64(gtid_216696, (int64_t) 1);\n                int64_t x_216712 = mul64(jump_s_203581, x_216711);\n                int64_t min_arg_216713 = add64((int64_t) 1, x_216712);\n                int64_t min_res_216714 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216713);\n                \n                defunc_0_m_fun_res_f_res_216709 = min_res_216714;\n            }\n            defunc_0_m_fun_res_216706 = defunc_0_m_fun_res_f_res_216709;\n        }\n        \n        double defunc_2_reduce_res_216715;\n        double defunc_2_reduce_res_216716;\n        double defunc_2_reduce_res_216717;\n        double defunc_2_reduce_res_216718;\n        double defunc_2_reduce_res_216719;\n        double redout_228664;\n        double redout_228665;\n        double redout_228666;\n        double redout_228667;\n        double redout_228668;\n        \n        redout_228664 = 0.0;\n        redout_228665 = 0.0;\n        redout_228666 = 0.0;\n        redout_228667 = 0.0;\n        redout_228668 = 0.0;\n        for (int64_t i_228669 = 0; i_228669 < q_s_203575; i_228669++) {\n            bool cond_216736 = sle64(x_216701, i_228669);\n            int64_t defunc_0_f_res_216737;\n            \n            if (cond_216736) {\n                defunc_0_f_res_216737 = (int64_t) 0;\n            } else {\n      ",
            "          int64_t i_216738 = add64(x_216703, i_228669);\n                int64_t defunc_0_add_arg_216739;\n                \n                defunc_0_add_arg_216739 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_216694 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gtid_216695 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_216738];\n                \n                int64_t defunc_1_add_res_216740 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216739);\n                \n                defunc_0_f_res_216737 = defunc_1_add_res_216740;\n            }\n            \n            double defunc_0_f_res_216741;\n            \n            if (cond_216736) {\n                defunc_0_f_res_216741 = 0.0;\n            } else {\n                int64_t i_216742 = add64(x_216703, i_228669);\n                double defunc_0_add_arg_216743;\n                \n                defunc_0_add_arg_216743 = ((__global\n                                            double *) mem_229639)[gtid_216694 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_216695 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_216742];\n                defunc_0_f_res_216741 = defunc_0_add_arg_216743;\n            }\n            \n            int64_t binop_p_216744 = sub64(defunc_0_f_res_216737,\n                              ",
            "             defunc_0_m_fun_res_216706);\n            double defunc_0_f_res_216745 = sitofp_i64_f64(binop_p_216744);\n            double abs_res_216746 = fabs(defunc_0_f_res_216745);\n            double tmp1_216747 = abs_res_216746 / x_216704;\n            double x_216748 = tmp1_216747 * tmp1_216747;\n            double y_216749 = tmp1_216747 * x_216748;\n            double tmp2_216750 = 1.0 - y_216749;\n            double x_216751 = tmp2_216750 * tmp2_216750;\n            double tmp3_216752 = tmp2_216750 * x_216751;\n            double w_j_216753 = defunc_0_f_res_216741 * tmp3_216752;\n            double xw_j_216754 = defunc_0_f_res_216745 * w_j_216753;\n            double x2w_j_216755 = defunc_0_f_res_216745 * xw_j_216754;\n            double x3w_j_216756 = defunc_0_f_res_216745 * x2w_j_216755;\n            double x4w_j_216757 = defunc_0_f_res_216745 * x3w_j_216756;\n            double defunc_1_op_res_216722 = w_j_216753 + redout_228664;\n            double defunc_1_op_res_216725 = xw_j_216754 + redout_228665;\n            double defunc_1_op_res_216728 = x2w_j_216755 + redout_228666;\n            double defunc_1_op_res_216731 = x3w_j_216756 + redout_228667;\n            double defunc_1_op_res_216734 = x4w_j_216757 + redout_228668;\n            double redout_tmp_233969 = defunc_1_op_res_216722;\n            double redout_tmp_233970 = defunc_1_op_res_216725;\n            double redout_tmp_233971 = defunc_1_op_res_216728;\n            double redout_tmp_233972 = defunc_1_op_res_216731;\n            double redout_tmp_233973 = defunc_1_op_res_216734;\n            \n            redout_228664 = redout_tmp_233969;\n            redout_228665 = redout_tmp_233970;\n            redout_228666 = redout_tmp_233971;\n            redout_228667 = redout_tmp_233972;\n            redout_228668 = redout_tmp_233973;\n        }\n        defunc_2_reduce_res_216715 = redout_228664;\n        defunc_2_reduce_res_216716 = redout_228665;\n        defunc_2_reduce_res_216717 = redout_228666;\n        defunc_2_reduce_res_216718 =",
            " redout_228667;\n        defunc_2_reduce_res_216719 = redout_228668;\n        \n        double x_216758 = defunc_2_reduce_res_216717 *\n               defunc_2_reduce_res_216719;\n        double y_216759 = defunc_2_reduce_res_216718 *\n               defunc_2_reduce_res_216718;\n        double a12_216760 = x_216758 - y_216759;\n        double x_216761 = defunc_2_reduce_res_216717 *\n               defunc_2_reduce_res_216718;\n        double y_216762 = defunc_2_reduce_res_216716 *\n               defunc_2_reduce_res_216719;\n        double b12_216763 = x_216761 - y_216762;\n        double x_216764 = defunc_2_reduce_res_216716 *\n               defunc_2_reduce_res_216718;\n        double y_216765 = defunc_2_reduce_res_216717 *\n               defunc_2_reduce_res_216717;\n        double c12_216766 = x_216764 - y_216765;\n        double x_216767 = defunc_2_reduce_res_216715 *\n               defunc_2_reduce_res_216719;\n        double b2_216768 = x_216767 - y_216765;\n        double x_216769 = defunc_2_reduce_res_216716 *\n               defunc_2_reduce_res_216717;\n        double y_216770 = defunc_2_reduce_res_216715 *\n               defunc_2_reduce_res_216718;\n        double c2_216771 = x_216769 - y_216770;\n        double x_216772 = defunc_2_reduce_res_216715 * a12_216760;\n        double y_216773 = defunc_2_reduce_res_216716 * b12_216763;\n        double x_216774 = x_216772 + y_216773;\n        double y_216775 = defunc_2_reduce_res_216717 * c12_216766;\n        double y_216776 = x_216774 + y_216775;\n        double det_216777 = 1.0 / y_216776;\n        double a12_216778 = a12_216760 * det_216777;\n        double b12_216779 = b12_216763 * det_216777;\n        double c12_216780 = c12_216766 * det_216777;\n        double b2_216781 = b2_216768 * det_216777;\n        double c2_216782 = c2_216771 * det_216777;\n        int64_t defunc_0_m_fun_res_216783;\n        \n        if (cond_216705) {\n            defunc_0_m_fun_res_216783 = (int64_t) 0;\n        } else {\n            int64_t y_216784 = sub64(s_n_m_203726",
            ", (int64_t) 1);\n            bool cond_216785 = gtid_216696 == y_216784;\n            int64_t defunc_0_m_fun_res_f_res_216786;\n            \n            if (cond_216785) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216787 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216786 =\n                    defunc_0_m_fun_res_f_res_t_res_216787;\n            } else {\n                int64_t x_216788 = sub64(gtid_216696, (int64_t) 1);\n                int64_t x_216789 = mul64(jump_s_203581, x_216788);\n                int64_t min_arg_216790 = add64((int64_t) 1, x_216789);\n                int64_t min_res_216791 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216790);\n                \n                defunc_0_m_fun_res_f_res_216786 = min_res_216791;\n            }\n            defunc_0_m_fun_res_216783 = defunc_0_m_fun_res_f_res_216786;\n        }\n        \n        double defunc_2_reduce_res_216792;\n        double defunc_2_reduce_res_216793;\n        double redout_228670;\n        double redout_228671;\n        \n        redout_228670 = 0.0;\n        redout_228671 = 0.0;\n        for (int64_t i_228672 = 0; i_228672 < q_s_203575; i_228672++) {\n            bool cond_216801 = sle64(x_216701, i_228672);\n            int64_t defunc_0_f_res_216802;\n            \n            if (cond_216801) {\n                defunc_0_f_res_216802 = (int64_t) 0;\n            } else {\n                int64_t i_216803 = add64(x_216703, i_228672);\n                int64_t defunc_0_add_arg_216804;\n                \n                defunc_0_add_arg_216804 = ((__global\n                                            int64_t *) ext_mem_229373)[gtid_216694 *\n                                                                       (defunc_0_f_res_203721 *\n                                                                        n_p_203574) +\n                                                                       gt",
            "id_216695 *\n                                                                       defunc_0_f_res_203721 +\n                                                                       i_216803];\n                \n                int64_t defunc_1_add_res_216805 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216804);\n                \n                defunc_0_f_res_216802 = defunc_1_add_res_216805;\n            }\n            \n            double defunc_0_f_res_216806;\n            \n            if (cond_216801) {\n                defunc_0_f_res_216806 = 0.0;\n            } else {\n                int64_t i_216807 = add64(x_216703, i_228672);\n                double defunc_0_add_arg_216808;\n                \n                defunc_0_add_arg_216808 = ((__global\n                                            double *) mem_229639)[gtid_216694 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_216695 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_216807];\n                defunc_0_f_res_216806 = defunc_0_add_arg_216808;\n            }\n            \n            int64_t binop_p_216809 = sub64(defunc_0_f_res_216802,\n                                           defunc_0_m_fun_res_216783);\n            double defunc_0_f_res_216810 = sitofp_i64_f64(binop_p_216809);\n            double abs_res_216811 = fabs(defunc_0_f_res_216810);\n            double tmp1_216812 = abs_res_216811 / x_216704;\n            double x_216813 = tmp1_216812 * tmp1_216812;\n            double y_216814 = tmp1_216812 * x_216813;\n            double tmp2_216815 = 1.0 - y_216814;\n            double x_216816 = tmp2_216815 * tmp2_216815;\n            double tmp3_216817 = tmp2_216815 * x_216816;\n",
            "            double tmp4_216818 = defunc_0_f_res_216806 * tmp3_216817;\n            double defunc_1_f_res_216819 = defunc_0_f_res_216810 * tmp4_216818;\n            double defunc_1_f_res_216820 = defunc_0_f_res_216810 *\n                   defunc_1_f_res_216819;\n            double defunc_0_f_res_216821;\n            \n            if (cond_216801) {\n                defunc_0_f_res_216821 = 0.0;\n            } else {\n                int64_t i_216822 = add64(x_216703, i_228672);\n                double defunc_0_add_arg_216823;\n                \n                defunc_0_add_arg_216823 = ((__global\n                                            double *) mem_229634)[gtid_216694 *\n                                                                  (defunc_0_f_res_203721 *\n                                                                   n_p_203574) +\n                                                                  gtid_216695 *\n                                                                  defunc_0_f_res_203721 +\n                                                                  i_216822];\n                defunc_0_f_res_216821 = defunc_0_add_arg_216823;\n            }\n            \n            double x_216824 = a12_216778 * tmp4_216818;\n            double y_216825 = b12_216779 * defunc_1_f_res_216819;\n            double x_216826 = x_216824 + y_216825;\n            double y_216827 = c12_216780 * defunc_1_f_res_216820;\n            double x_216828 = x_216826 + y_216827;\n            double defunc_9_fit_fun_res_216829 = defunc_0_f_res_216821 *\n                   x_216828;\n            double x_216830 = b12_216779 * tmp4_216818;\n            double y_216831 = b2_216781 * defunc_1_f_res_216819;\n            double x_216832 = x_216830 + y_216831;\n            double y_216833 = c2_216782 * defunc_1_f_res_216820;\n            double x_216834 = x_216832 + y_216833;\n            double defunc_9_slope_fun_res_216835 = defunc_0_f_res_216821 *\n                   x_216834;\n            double defunc_1_op_res",
            "_216796 = defunc_9_fit_fun_res_216829 +\n                   redout_228670;\n            double defunc_1_op_res_216799 = defunc_9_slope_fun_res_216835 +\n                   redout_228671;\n            double redout_tmp_233974 = defunc_1_op_res_216796;\n            double redout_tmp_233975 = defunc_1_op_res_216799;\n            \n            redout_228670 = redout_tmp_233974;\n            redout_228671 = redout_tmp_233975;\n        }\n        defunc_2_reduce_res_216792 = redout_228670;\n        defunc_2_reduce_res_216793 = redout_228671;\n        ((__global double *) mem_230409)[gtid_216694 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216695 * s_n_m_203726 +\n                                         gtid_216696] =\n            defunc_2_reduce_res_216792;\n        ((__global double *) mem_230414)[gtid_216694 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216695 * s_n_m_203726 +\n                                         gtid_216696] =\n            defunc_2_reduce_res_216793;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216684\n}\n__kernel void mainzisegmap_216846(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230420, __global\n                                  unsigned char *mem_230424)\n{\n    #define segmap_group_sizze_216839 (mainzisegmap_group_sizze_215674)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_2339",
            "76;\n    int32_t local_tid_233977;\n    int64_t group_sizze_233980;\n    int32_t wave_sizze_233979;\n    int32_t group_tid_233978;\n    \n    global_tid_233976 = get_global_id(0);\n    local_tid_233977 = get_local_id(0);\n    group_sizze_233980 = get_local_size(0);\n    wave_sizze_233979 = LOCKSTEP_WIDTH;\n    group_tid_233978 = get_group_id(0);\n    \n    int32_t phys_tid_216846 = global_tid_233976;\n    int64_t global_tid_233981 = sext_i32_i64(group_tid_233978) *\n            segmap_group_sizze_216839 + sext_i32_i64(local_tid_233977);\n    int64_t slice_233982 = s_n_m_203726;\n    int64_t slice_233983 = n_p_203574 * slice_233982;\n    int64_t slice_233984 = partition_sizze_203667 * slice_233983;\n    int64_t gtid_216843 = squot64(global_tid_233981, slice_233983);\n    int64_t remnant_233985 = global_tid_233981 - gtid_216843 * slice_233983;\n    int64_t gtid_216844 = squot64(remnant_233985, slice_233982);\n    int64_t remnant_233986 = remnant_233985 - gtid_216844 * slice_233982;\n    int64_t gtid_216845 = remnant_233986;\n    int64_t remnant_233987 = remnant_233986 - gtid_216845;\n    \n    if ((slt64(gtid_216843, partition_sizze_203667) && slt64(gtid_216844,\n                                                             n_p_203574)) &&\n        slt64(gtid_216845, s_n_m_203726)) {\n        bool cond_216848 = gtid_216845 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216849;\n        \n        if (cond_216848) {\n            defunc_0_m_fun_res_216849 = (int64_t) 0;\n        } else {\n            int64_t y_216850 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216851 = gtid_216845 == y_216850;\n            int64_t defunc_0_m_fun_res_f_res_216852;\n            \n            if (cond_216851) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216853 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216852 =\n                    defunc_0_m_fun_res_f_res_t_res_216853;\n            } else {\n                int64_t x_21",
            "6854 = sub64(gtid_216845, (int64_t) 1);\n                int64_t x_216855 = mul64(jump_s_203581, x_216854);\n                int64_t min_arg_216856 = add64((int64_t) 1, x_216855);\n                int64_t min_res_216857 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216856);\n                \n                defunc_0_m_fun_res_f_res_216852 = min_res_216857;\n            }\n            defunc_0_m_fun_res_216849 = defunc_0_m_fun_res_f_res_216852;\n        }\n        ((__global int64_t *) mem_230420)[gtid_216843 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_216844 * s_n_m_203726 +\n                                          gtid_216845] =\n            defunc_0_m_fun_res_216849;\n        ((__global bool *) mem_230424)[gtid_216843 * (s_n_m_203726 *\n                                                      n_p_203574) +\n                                       gtid_216844 * s_n_m_203726 +\n                                       gtid_216845] = cond_216848;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216839\n}\n__kernel void mainzisegmap_216942(__global int *global_failure,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *mem_230430, __global\n                                  unsigned char *mem_230435, __global\n                                  unsigned char *mem_230440, __global\n                                  unsigned char *mem_230445, __global\n                                  unsigned char *mem_230450, __global\n                                  unsigned char *mem_230456, __global\n                                ",
            "  unsigned char *mem_230461, __global\n                                  unsigned char *mem_230466, __global\n                                  unsigned char *mem_230471, __global\n                                  unsigned char *mem_230476, __global\n                                  unsigned char *mem_230481)\n{\n    #define segmap_group_sizze_216931 (mainzisegmap_group_sizze_215544)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234120;\n    int32_t local_tid_234121;\n    int64_t group_sizze_234124;\n    int32_t wave_sizze_234123;\n    int32_t group_tid_234122;\n    \n    global_tid_234120 = get_global_id(0);\n    local_tid_234121 = get_local_id(0);\n    group_sizze_234124 = get_local_size(0);\n    wave_sizze_234123 = LOCKSTEP_WIDTH;\n    group_tid_234122 = get_group_id(0);\n    \n    int32_t phys_tid_216942 = global_tid_234120;\n    int64_t global_tid_234125 = sext_i32_i64(group_tid_234122) *\n            segmap_group_sizze_216931 + sext_i32_i64(local_tid_234121);\n    int64_t slice_234126 = s_n_m_203726;\n    int64_t slice_234127 = n_p_203574 * slice_234126;\n    int64_t slice_234128 = partition_sizze_203667 * slice_234127;\n    int64_t gtid_216939 = squot64(global_tid_234125, slice_234127);\n    int64_t remnant_234129 = global_tid_234125 - gtid_216939 * slice_234127;\n    int64_t gtid_216940 = squot64(remnant_234129, slice_234126);\n    int64_t remnant_234130 = remnant_234129 - gtid_216940 * slice_234126;\n    int64_t gtid_216941 = remnant_234130;\n    int64_t remnant_234131 = remnant_234130 - gtid_216941;\n    \n    if ((slt64(gtid_216939, partition_sizze_203667) && slt64(gtid_216940,\n                                                             n_p_203574)) &&\n        slt64(gtid_216941, s_n_m_203726)) {\n        bool index_primexp_228820 = gtid_216941 == (int64_t) 0;\n        double defunc_2_reduce_res_216945;\n        \n        defunc_2_reduce_res_216945 = ((__global\n",
            "                                       double *) mem_230430)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216946;\n        \n        defunc_2_reduce_res_216946 = ((__global\n                                       double *) mem_230435)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216947;\n        \n        defunc_2_reduce_res_216947 = ((__global\n                                       double *) mem_230440)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216948;\n        \n        defunc_2_reduce_res_216948 = ((__global\n                                       double *) mem_230445)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n        ",
            "                                                     s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double defunc_2_reduce_res_216949;\n        \n        defunc_2_reduce_res_216949 = ((__global\n                                       double *) mem_230450)[gtid_216939 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216940 *\n                                                             s_n_m_203726 +\n                                                             gtid_216941];\n        \n        double x_216950 = defunc_2_reduce_res_216947 *\n               defunc_2_reduce_res_216949;\n        double y_216951 = defunc_2_reduce_res_216948 *\n               defunc_2_reduce_res_216948;\n        double a12_216952 = x_216950 - y_216951;\n        double x_216953 = defunc_2_reduce_res_216947 *\n               defunc_2_reduce_res_216948;\n        double y_216954 = defunc_2_reduce_res_216946 *\n               defunc_2_reduce_res_216949;\n        double b12_216955 = x_216953 - y_216954;\n        double x_216956 = defunc_2_reduce_res_216946 *\n               defunc_2_reduce_res_216948;\n        double y_216957 = defunc_2_reduce_res_216947 *\n               defunc_2_reduce_res_216947;\n        double c12_216958 = x_216956 - y_216957;\n        double x_216959 = defunc_2_reduce_res_216945 *\n               defunc_2_reduce_res_216949;\n        double b2_216960 = x_216959 - y_216957;\n        double x_216961 = defunc_2_reduce_res_216946 *\n               defunc_2_reduce_res_216947;\n        double y_216962 = defunc_2_reduce_res_216945 *\n               defunc_2_reduce_res_216948;\n        double c2_216963 = x_216961 - y_216962;\n        double x_216964 = defunc_2_reduce_res_216945 * a12_216952;\n        double y_216965 = defunc_2_reduce_res_216946 * b12_216955;\n        double x_216966 = ",
            "x_216964 + y_216965;\n        double y_216967 = defunc_2_reduce_res_216947 * c12_216958;\n        double y_216968 = x_216966 + y_216967;\n        double det_216969 = 1.0 / y_216968;\n        double a12_216970 = a12_216952 * det_216969;\n        double b12_216971 = b12_216955 * det_216969;\n        double c12_216972 = c12_216958 * det_216969;\n        double b2_216973 = b2_216960 * det_216969;\n        double c2_216974 = c2_216963 * det_216969;\n        int64_t defunc_0_m_fun_res_216975;\n        \n        if (index_primexp_228820) {\n            defunc_0_m_fun_res_216975 = (int64_t) 0;\n        } else {\n            int64_t y_216976 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216977 = gtid_216941 == y_216976;\n            int64_t defunc_0_m_fun_res_f_res_216978;\n            \n            if (cond_216977) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216979 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216978 =\n                    defunc_0_m_fun_res_f_res_t_res_216979;\n            } else {\n                int64_t x_216980 = sub64(gtid_216941, (int64_t) 1);\n                int64_t x_216981 = mul64(jump_s_203581, x_216980);\n                int64_t min_arg_216982 = add64((int64_t) 1, x_216981);\n                int64_t min_res_216983 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216982);\n                \n                defunc_0_m_fun_res_f_res_216978 = min_res_216983;\n            }\n            defunc_0_m_fun_res_216975 = defunc_0_m_fun_res_f_res_216978;\n        }\n        ((__global double *) mem_230456)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = a12_216970;\n        ((__global double *) mem_230461)[gtid_216939 * (s_n_m_203726 *\n                                     ",
            "                   n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = b12_216971;\n        ((__global double *) mem_230466)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = c12_216972;\n        ((__global double *) mem_230471)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = b2_216973;\n        ((__global double *) mem_230476)[gtid_216939 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216940 * s_n_m_203726 +\n                                         gtid_216941] = c2_216974;\n        ((__global int64_t *) mem_230481)[gtid_216939 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_216940 * s_n_m_203726 +\n                                          gtid_216941] =\n            defunc_0_m_fun_res_216975;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216931\n}\n__kernel void mainzisegmap_218503(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203574, int64_t jump_s_203581,\n                                  int64_t partition_sizze_203667,\n                                  int64_t defunc_0_f_res_203721,\n                                  int64_t pad_css_len_203722,\n                                  int64_t s_n_m_203726, __global\n                                  unsigned char *ext_mem_230594, __global\n     ",
            "                             unsigned char *ext_mem_230595, __global\n                                  unsigned char *mem_230601)\n{\n    #define segmap_group_sizze_218497 (mainzisegmap_group_sizze_218205)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234308;\n    int32_t local_tid_234309;\n    int64_t group_sizze_234312;\n    int32_t wave_sizze_234311;\n    int32_t group_tid_234310;\n    \n    global_tid_234308 = get_global_id(0);\n    local_tid_234309 = get_local_id(0);\n    group_sizze_234312 = get_local_size(0);\n    wave_sizze_234311 = LOCKSTEP_WIDTH;\n    group_tid_234310 = get_group_id(0);\n    \n    int32_t phys_tid_218503 = global_tid_234308;\n    int64_t global_tid_234313 = sext_i32_i64(group_tid_234310) *\n            segmap_group_sizze_218497 + sext_i32_i64(local_tid_234309);\n    int64_t slice_234314 = pad_css_len_203722;\n    int64_t slice_234315 = n_p_203574 * slice_234314;\n    int64_t slice_234316 = partition_sizze_203667 * slice_234315;\n    int64_t gtid_218500 = squot64(global_tid_234313, slice_234315);\n    int64_t remnant_234317 = global_tid_234313 - gtid_218500 * slice_234315;\n    int64_t gtid_218501 = squot64(remnant_234317, slice_234314);\n    int64_t remnant_234318 = remnant_234317 - gtid_218501 * slice_234314;\n    int64_t gtid_218502 = remnant_234318;\n    int64_t remnant_234319 = remnant_234318 - gtid_218502;\n    \n    if ((slt64(gtid_218500, partition_sizze_203667) && slt64(gtid_218501,\n                                                             n_p_203574)) &&\n        slt64(gtid_218502, pad_css_len_203722)) {\n        bool cond_218507 = gtid_218502 == (int64_t) 0;\n        double defunc_0_f_res_218508;\n        \n        if (cond_218507) {\n            bool y_218509 = slt64((int64_t) 0, s_n_m_203726);\n            bool index_certs_218510;\n            \n            if (!y_218509) {\n                {\n                    if (atomic_cmpxchg_i32_",
            "global(global_failure, -1, 38) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) (int64_t) 0;\n                        global_failure_args[1] = (int64_t) s_n_m_203726;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double head_res_218511;\n            \n            head_res_218511 = ((__global double *) ext_mem_230595)[gtid_218500 *\n                                                                   (s_n_m_203726 *\n                                                                    n_p_203574) +\n                                                                   gtid_218501 *\n                                                                   s_n_m_203726];\n            defunc_0_f_res_218508 = head_res_218511;\n        } else {\n            int64_t y_218512 = sub64(pad_css_len_203722, (int64_t) 1);\n            bool cond_218513 = gtid_218502 == y_218512;\n            double defunc_0_f_res_f_res_218514;\n            \n            if (cond_218513) {\n                int64_t i_218515 = sub64(s_n_m_203726, (int64_t) 1);\n                bool x_218516 = sle64((int64_t) 0, i_218515);\n                bool y_218517 = slt64(i_218515, s_n_m_203726);\n                bool bounds_check_218518 = x_218516 && y_218517;\n                bool index_certs_218519;\n                \n                if (!bounds_check_218518) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 39) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) i_218515;\n                            global_failure_args[1] = (int64_t) s_n_m_203726;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double last_res_218520;\n                \n                last_res_218520 = ((__global\n                            ",
            "        double *) ext_mem_230595)[gtid_218500 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_218501 *\n                                                              s_n_m_203726 +\n                                                              i_218515];\n                defunc_0_f_res_f_res_218514 = last_res_218520;\n            } else {\n                int64_t x_218521 = sub64(gtid_218502, (int64_t) 1);\n                bool zzero_218522 = jump_s_203581 == (int64_t) 0;\n                bool nonzzero_218523 = !zzero_218522;\n                bool nonzzero_cert_218524;\n                \n                if (!nonzzero_218523) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                            -1) {\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t x_218525 = sdiv64(x_218521, jump_s_203581);\n                int64_t m_v_218526 = add64((int64_t) 1, x_218525);\n                int64_t j_218527;\n                \n                if (cond_218507) {\n                    j_218527 = (int64_t) 0;\n                } else {\n                    int64_t y_218528 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_218529 = m_v_218526 == y_218528;\n                    int64_t j_f_res_218530;\n                    \n                    if (cond_218529) {\n                        j_f_res_218530 = x_218525;\n                    } else {\n                        j_f_res_218530 = m_v_218526;\n                    }\n                    j_218527 = j_f_res_218530;\n                }\n                \n                bool cond_218531 = j_218527 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218532;\n                \n                if (co",
            "nd_218531) {\n                    defunc_0_m_fun_res_218532 = (int64_t) 0;\n                } else {\n                    int64_t y_218533 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_218534 = j_218527 == y_218533;\n                    int64_t defunc_0_m_fun_res_f_res_218535;\n                    \n                    if (cond_218534) {\n                        defunc_0_m_fun_res_f_res_218535 = y_218512;\n                    } else {\n                        int64_t x_218536 = sub64(j_218527, (int64_t) 1);\n                        int64_t x_218537 = mul64(jump_s_203581, x_218536);\n                        int64_t min_arg_218538 = add64((int64_t) 1, x_218537);\n                        int64_t min_res_218539 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_218538);\n                        \n                        defunc_0_m_fun_res_f_res_218535 = min_res_218539;\n                    }\n                    defunc_0_m_fun_res_218532 = defunc_0_m_fun_res_f_res_218535;\n                }\n                \n                int64_t defunc_0_m_fun_arg_218540 = add64((int64_t) 1,\n                                                          j_218527);\n                bool cond_218541 = defunc_0_m_fun_arg_218540 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218542;\n                \n                if (cond_218541) {\n                    defunc_0_m_fun_res_218542 = (int64_t) 0;\n                } else {\n                    int64_t y_218543 = sub64(s_n_m_203726, (int64_t) 1);\n                    bool cond_218544 = defunc_0_m_fun_arg_218540 == y_218543;\n                    int64_t defunc_0_m_fun_res_f_res_218545;\n                    \n                    if (cond_218544) {\n                        defunc_0_m_fun_res_f_res_218545 = y_218512;\n                    } else {\n                        int64_t x_218546 = mul64(jump_s_203581, j_218527);\n                        int64_t min_arg_218547 = add64((int64_t) 1, x_218546);\n    ",
            "                    int64_t min_res_218548 = smin64(defunc_0_f_res_203721,\n                                                        min_arg_218547);\n                        \n                        defunc_0_m_fun_res_f_res_218545 = min_res_218548;\n                    }\n                    defunc_0_m_fun_res_218542 = defunc_0_m_fun_res_f_res_218545;\n                }\n                \n                int64_t i64_arg_218549 = sub64(defunc_0_m_fun_res_218542,\n                                               defunc_0_m_fun_res_218532);\n                double i64_res_218550 = sitofp_i64_f64(i64_arg_218549);\n                int64_t i64_arg_218551 = sub64(gtid_218502,\n                                               defunc_0_m_fun_res_218532);\n                double i64_res_218552 = sitofp_i64_f64(i64_arg_218551);\n                double u_218553 = i64_res_218552 / i64_res_218550;\n                double u2_218554 = u_218553 * u_218553;\n                double u3_218555 = u_218553 * u2_218554;\n                double x_218556 = 2.0 * u3_218555;\n                double y_218557 = 3.0 * u2_218554;\n                double x_218558 = x_218556 - y_218557;\n                double x_218559 = 1.0 + x_218558;\n                bool x_218560 = sle64((int64_t) 0, j_218527);\n                bool y_218561 = slt64(j_218527, s_n_m_203726);\n                bool bounds_check_218562 = x_218560 && y_218561;\n                bool index_certs_218563;\n                \n                if (!bounds_check_218562) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) j_218527;\n                            global_failure_args[1] = (int64_t) s_n_m_203726;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218564;\n                \n                y_218564 =",
            " ((__global double *) ext_mem_230595)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                j_218527];\n                \n                double x_218565 = x_218559 * y_218564;\n                double x_218566 = y_218557 - x_218556;\n                bool x_218567 = sle64((int64_t) 0, defunc_0_m_fun_arg_218540);\n                bool y_218568 = slt64(defunc_0_m_fun_arg_218540, s_n_m_203726);\n                bool bounds_check_218569 = x_218567 && y_218568;\n                bool index_certs_218570;\n                \n                if (!bounds_check_218569) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 42) ==\n                            -1) {\n                            global_failure_args[0] =\n                                (int64_t) defunc_0_m_fun_arg_218540;\n                            global_failure_args[1] = (int64_t) s_n_m_203726;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218571;\n                \n                y_218571 = ((__global double *) ext_mem_230595)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                defunc_0_m_fun_arg_218540];\n                \n                double y_218572 = x_218566 * y_218571;\n               ",
            " double x_218573 = x_218565 + y_218572;\n                double y_218574 = 2.0 * u2_218554;\n                double x_218575 = u3_218555 - y_218574;\n                double x_218576 = u_218553 + x_218575;\n                double y_218577;\n                \n                y_218577 = ((__global double *) ext_mem_230594)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                j_218527];\n                \n                double x_218578 = x_218576 * y_218577;\n                double y_218579 = i64_res_218550 * x_218578;\n                double x_218580 = x_218573 + y_218579;\n                double x_218581 = u3_218555 - u2_218554;\n                double y_218582;\n                \n                y_218582 = ((__global double *) ext_mem_230594)[gtid_218500 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_218501 *\n                                                                s_n_m_203726 +\n                                                                defunc_0_m_fun_arg_218540];\n                \n                double x_218583 = x_218581 * y_218582;\n                double y_218584 = i64_res_218550 * x_218583;\n                double defunc_4_interpolate_proc_res_218585 = x_218580 +\n                       y_218584;\n                \n                defunc_0_f_res_f_res_218514 =\n                    defunc_4_interpolate_proc_res_218585;\n            }\n            defunc_0_f_res_218508 = defunc_0_f_res_f_res_218514;\n        }\n        ((__global double *) mem_230601)[gtid_218",
            "500 * (pad_css_len_203722 *\n                                                        n_p_203574) +\n                                         gtid_218501 * pad_css_len_203722 +\n                                         gtid_218502] = defunc_0_f_res_218508;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218497\n}\n__kernel void mainzisegmap_218652(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667,\n                                  int64_t C_len_203724,\n                                  int64_t css_results_l_204200, __global\n                                  unsigned char *ext_mem_230602, __global\n                                  unsigned char *mem_230608)\n{\n    #define segmap_group_sizze_218647 (mainzisegmap_group_sizze_218601)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234320;\n    int32_t local_tid_234321;\n    int64_t group_sizze_234324;\n    int32_t wave_sizze_234323;\n    int32_t group_tid_234322;\n    \n    global_tid_234320 = get_global_id(0);\n    local_tid_234321 = get_local_id(0);\n    group_sizze_234324 = get_local_size(0);\n    wave_sizze_234323 = LOCKSTEP_WIDTH;\n    group_tid_234322 = get_group_id(0);\n    \n    int32_t phys_tid_218652 = global_tid_234320;\n    int64_t global_tid_234325 = sext_i32_i64(group_tid_234322) *\n            segmap_group_sizze_218647 + sext_i32_i64(local_tid_234321);\n    int64_t slice_234326 = C_len_203724;\n    int64_t slice_234327 = partition_sizze_203667 * slice_234326;\n    int64_t gtid_218650 = squot64(global_tid_234325, slice_234326);\n    int64_t remnant_234328 = global_tid_234325 - gtid_218650 * slice_234326;\n    int64_t gtid_218651 = remnant_234328;\n    int64_t remnan",
            "t_234329 = remnant_234328 - gtid_218651;\n    \n    if (slt64(gtid_218650, partition_sizze_203667) && slt64(gtid_218651,\n                                                            C_len_203724)) {\n        int64_t i_218655 = smod64(gtid_218651, n_p_203574);\n        bool x_218656 = sle64((int64_t) 0, i_218655);\n        bool y_218657 = slt64(i_218655, n_p_203574);\n        bool bounds_check_218658 = x_218656 && y_218657;\n        int64_t i_218659 = sdiv64(gtid_218651, n_p_203574);\n        bool x_218660 = sle64((int64_t) 0, i_218659);\n        bool y_218661 = slt64(i_218659, css_results_l_204200);\n        bool bounds_check_218662 = x_218660 && y_218661;\n        bool index_ok_218663 = bounds_check_218658 && bounds_check_218662;\n        bool index_certs_218664;\n        \n        if (!index_ok_218663) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = (int64_t) i_218655;\n                    global_failure_args[1] = (int64_t) i_218659;\n                    global_failure_args[2] = (int64_t) n_p_203574;\n                    global_failure_args[3] = (int64_t) css_results_l_204200;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double defunc_0_f_res_218665;\n        \n        defunc_0_f_res_218665 = ((__global\n                                  double *) ext_mem_230602)[gtid_218650 *\n                                                            (css_results_l_204200 *\n                                                             n_p_203574) +\n                                                            i_218655 *\n                                                            css_results_l_204200 +\n                                                            i_218659];\n        ((__global double *) mem_230608)[gtid_218650 * C_len_203724 +\n                                         gtid_218651] = defunc_0_f_res_218665;\n    }\n    \n  error_0:\n    return;\n  ",
            "  #undef segmap_group_sizze_218647\n}\n__kernel void mainzisegmap_218688(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_230611, __global\n                                  unsigned char *mem_230615)\n{\n    #define segmap_group_sizze_218684 (mainzisegmap_group_sizze_218672)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234330;\n    int32_t local_tid_234331;\n    int64_t group_sizze_234334;\n    int32_t wave_sizze_234333;\n    int32_t group_tid_234332;\n    \n    global_tid_234330 = get_global_id(0);\n    local_tid_234331 = get_local_id(0);\n    group_sizze_234334 = get_local_size(0);\n    wave_sizze_234333 = LOCKSTEP_WIDTH;\n    group_tid_234332 = get_group_id(0);\n    \n    int32_t phys_tid_218688 = global_tid_234330;\n    int64_t global_tid_234335 = sext_i32_i64(group_tid_234332) *\n            segmap_group_sizze_218684 + sext_i32_i64(local_tid_234331);\n    int64_t slice_234336 = partition_sizze_203667;\n    int64_t gtid_218687 = global_tid_234335;\n    int64_t remnant_234337 = global_tid_234335 - gtid_218687;\n    \n    if (slt64(gtid_218687, partition_sizze_203667)) {\n        double defunc_2_reduce_res_218690;\n        double redout_229071 = 0.0;\n        \n        for (int64_t i_229072 = 0; i_229072 < n_p_203574; i_229072++) {\n            double x_218694;\n            \n            x_218694 = ((__global double *) mem_230611)[i_229072 *\n                                                        partition_sizze_203667 +\n                                                        gtid_218687];\n            \n            double defunc_1_op_res_218693 = x_218694 + redout_229071;\n            double redout_tmp_234338 = defunc_1_op_res_218693;\n            \n            redout_229071 = redout_tmp_234338;\n        }\n     ",
            "   defunc_2_reduce_res_218690 = redout_229071;\n        ((__global double *) mem_230615)[gtid_218687] =\n            defunc_2_reduce_res_218690;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218684\n}\n__kernel void mainzisegmap_218819(__global int *global_failure,\n                                  int64_t n_p_203574,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_230628, __global\n                                  unsigned char *mem_230632)\n{\n    #define segmap_group_sizze_218815 (mainzisegmap_group_sizze_218803)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234511;\n    int32_t local_tid_234512;\n    int64_t group_sizze_234515;\n    int32_t wave_sizze_234514;\n    int32_t group_tid_234513;\n    \n    global_tid_234511 = get_global_id(0);\n    local_tid_234512 = get_local_id(0);\n    group_sizze_234515 = get_local_size(0);\n    wave_sizze_234514 = LOCKSTEP_WIDTH;\n    group_tid_234513 = get_group_id(0);\n    \n    int32_t phys_tid_218819 = global_tid_234511;\n    int64_t global_tid_234516 = sext_i32_i64(group_tid_234513) *\n            segmap_group_sizze_218815 + sext_i32_i64(local_tid_234512);\n    int64_t slice_234517 = partition_sizze_203667;\n    int64_t gtid_218818 = global_tid_234516;\n    int64_t remnant_234518 = global_tid_234516 - gtid_218818;\n    \n    if (slt64(gtid_218818, partition_sizze_203667)) {\n        double defunc_2_reduce_res_218821;\n        double redout_229073 = 0.0;\n        \n        for (int64_t i_229074 = 0; i_229074 < n_p_203574; i_229074++) {\n            double x_218825;\n            \n            x_218825 = ((__global double *) mem_230628)[i_229074 *\n                                                        partition_sizze_203667 +\n                                                        gtid_218818];\n            \n            double defunc_1_o",
            "p_res_218824 = x_218825 + redout_229073;\n            double redout_tmp_234519 = defunc_1_op_res_218824;\n            \n            redout_229073 = redout_tmp_234519;\n        }\n        defunc_2_reduce_res_218821 = redout_229073;\n        ((__global double *) mem_230632)[gtid_218818] =\n            defunc_2_reduce_res_218821;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218815\n}\n__kernel void mainzisegmap_218950(__global int *global_failure,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_230645, __global\n                                  unsigned char *mem_230649)\n{\n    #define segmap_group_sizze_218946 (mainzisegmap_group_sizze_218934)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234692;\n    int32_t local_tid_234693;\n    int64_t group_sizze_234696;\n    int32_t wave_sizze_234695;\n    int32_t group_tid_234694;\n    \n    global_tid_234692 = get_global_id(0);\n    local_tid_234693 = get_local_id(0);\n    group_sizze_234696 = get_local_size(0);\n    wave_sizze_234695 = LOCKSTEP_WIDTH;\n    group_tid_234694 = get_group_id(0);\n    \n    int32_t phys_tid_218950 = global_tid_234692;\n    int64_t global_tid_234697 = sext_i32_i64(group_tid_234694) *\n            segmap_group_sizze_218946 + sext_i32_i64(local_tid_234693);\n    int64_t slice_234698 = partition_sizze_203667;\n    int64_t gtid_218949 = global_tid_234697;\n    int64_t remnant_234699 = global_tid_234697 - gtid_218949;\n    \n    if (slt64(gtid_218949, partition_sizze_203667)) {\n        double defunc_2_reduce_res_218952;\n        double redout_229075 = 0.0;\n        \n        for (int32_t i_229199 = 0; i_229199 < 3; i_229199++) {\n            int64_t i_229076 = sext_i32_i64(i_229199);\n            double x_218956;\n            \n            x_218956 = ((__global double *) mem_230645)[i_229076 *\n                      ",
            "                                  partition_sizze_203667 +\n                                                        gtid_218949];\n            \n            double defunc_1_op_res_218955 = x_218956 + redout_229075;\n            double redout_tmp_234700 = defunc_1_op_res_218955;\n            \n            redout_229075 = redout_tmp_234700;\n        }\n        defunc_2_reduce_res_218952 = redout_229075;\n        ((__global double *) mem_230649)[gtid_218949] =\n            defunc_2_reduce_res_218952;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218946\n}\n__kernel void mainzisegmap_219139(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t num_groups_219135,\n                                  int64_t num_threads_232269, __global\n                                  unsigned char *mem_230666, __global\n                                  unsigned char *mem_230669, __global\n                                  unsigned char *mem_230672, __global\n                                  unsigned char *mem_230675, __global\n                                  unsigned char *mem_230694, __global\n                                  unsigned char *color_232138)\n{\n    #define segmap_group_sizze_219134 (mainzisegmap_group_sizze_219065)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234888;\n    int32_t local_tid_234889;\n    int64_t group_sizze_234892;\n    int32_t wave_sizze_234891;\n    int32_t group_tid_234890;\n    \n    global_tid_234888 = get_global_id(0);\n    local_tid_234889 = get_local_id(0);\n    group_sizze_234892 = get_local_size(0);\n    wave_sizze_234891 = LOCKSTEP_WIDTH;\n    gr",
            "oup_tid_234890 = get_group_id(0);\n    \n    int32_t phys_tid_219139 = global_tid_234888;\n    int32_t phys_group_id_234893;\n    \n    phys_group_id_234893 = get_group_id(0);\n    for (int32_t i_234894 = 0; i_234894 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_219134)) -\n                   phys_group_id_234893, sext_i64_i32(num_groups_219135));\n         i_234894++) {\n        int32_t virt_group_id_234895 = phys_group_id_234893 + i_234894 *\n                sext_i64_i32(num_groups_219135);\n        int64_t global_tid_234896 = sext_i32_i64(virt_group_id_234895) *\n                segmap_group_sizze_219134 + sext_i32_i64(local_tid_234889);\n        int64_t slice_234897 = partition_sizze_203667;\n        int64_t gtid_219138 = global_tid_234896;\n        int64_t remnant_234898 = global_tid_234896 - gtid_219138;\n        \n        if (slt64(gtid_219138, partition_sizze_203667)) {\n            for (int64_t i_229079 = 0; i_229079 < l_n_m_203733; i_229079++) {\n                int64_t x_219146;\n                \n                x_219146 = ((__global int64_t *) mem_230666)[i_229079 *\n                                                             partition_sizze_203667 +\n                                                             gtid_219138];\n                \n                double x_219147;\n                \n                x_219147 = ((__global double *) mem_230669)[i_229079 *\n                                                            partition_sizze_203667 +\n                                                            gtid_219138];\n                \n                int64_t min_arg_219148 = mul64(jump_t_203582, i_229079);\n                int64_t min_res_219149 = smin64(i_203760, min_arg_219148);\n                int64_t defunc_0_g_res_219150 = add64((int64_t) 1,\n                                                      min_res_219149);\n                double defunc_2_reduce_res_219151;\n                double redout_",
            "228421 = 0.0;\n                \n                for (int64_t i_228422 = 0; i_228422 < q_l_203577; i_228422++) {\n                    bool cond_219156 = sle64(n_203572, i_228422);\n                    int64_t defunc_0_f_res_219157;\n                    \n                    if (cond_219156) {\n                        defunc_0_f_res_219157 = (int64_t) 0;\n                    } else {\n                        int64_t i_219158 = add64(x_219146, i_228422);\n                        int64_t defunc_1_add_res_219159 = add64((int64_t) 1,\n                                                                i_219158);\n                        \n                        defunc_0_f_res_219157 = defunc_1_add_res_219159;\n                    }\n                    \n                    double defunc_0_f_res_219160;\n                    \n                    if (cond_219156) {\n                        defunc_0_f_res_219160 = 0.0;\n                    } else {\n                        int64_t i_219161 = add64(x_219146, i_228422);\n                        double defunc_0_add_arg_219162;\n                        \n                        defunc_0_add_arg_219162 = ((__global\n                                                    double *) mem_230672)[i_219161 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219138];\n                        defunc_0_f_res_219160 = defunc_0_add_arg_219162;\n                    }\n                    \n                    int64_t binop_p_219163 = sub64(defunc_0_f_res_219157,\n                                                   defunc_0_g_res_219150);\n                    double defunc_0_f_res_219164 =\n                           sitofp_i64_f64(binop_p_219163);\n                    double abs_res_219165 = fabs(defunc_0_f_res_219164);\n                    double tmp1_219166 = abs_res_219165 / x_219147;\n                    double x_219167 = tmp1_219166 * tmp1_219166;\n  ",
            "                  double y_219168 = tmp1_219166 * x_219167;\n                    double tmp2_219169 = 1.0 - y_219168;\n                    double x_219170 = tmp2_219169 * tmp2_219169;\n                    double tmp3_219171 = tmp2_219169 * x_219170;\n                    double w_j_219172 = defunc_0_f_res_219160 * tmp3_219171;\n                    double defunc_1_op_res_219154 = w_j_219172 + redout_228421;\n                    double redout_tmp_234900 = defunc_1_op_res_219154;\n                    \n                    redout_228421 = redout_tmp_234900;\n                }\n                defunc_2_reduce_res_219151 = redout_228421;\n                \n                double a0_219173 = 1.0 / defunc_2_reduce_res_219151;\n                double defunc_2_reduce_res_219174;\n                double redout_228423 = 0.0;\n                \n                for (int64_t i_228424 = 0; i_228424 < q_l_203577; i_228424++) {\n                    bool cond_219179 = sle64(n_203572, i_228424);\n                    int64_t defunc_0_f_res_219180;\n                    \n                    if (cond_219179) {\n                        defunc_0_f_res_219180 = (int64_t) 0;\n                    } else {\n                        int64_t i_219181 = add64(x_219146, i_228424);\n                        int64_t defunc_1_add_res_219182 = add64((int64_t) 1,\n                                                                i_219181);\n                        \n                        defunc_0_f_res_219180 = defunc_1_add_res_219182;\n                    }\n                    \n                    double defunc_0_f_res_219183;\n                    \n                    if (cond_219179) {\n                        defunc_0_f_res_219183 = 0.0;\n                    } else {\n                        int64_t i_219184 = add64(x_219146, i_228424);\n                        double defunc_0_add_arg_219185;\n                        \n                        defunc_0_add_arg_219185 = ((__global\n                                                    double ",
            "*) mem_230672)[i_219184 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219138];\n                        defunc_0_f_res_219183 = defunc_0_add_arg_219185;\n                    }\n                    \n                    int64_t binop_p_219186 = sub64(defunc_0_f_res_219180,\n                                                   defunc_0_g_res_219150);\n                    double defunc_0_f_res_219187 =\n                           sitofp_i64_f64(binop_p_219186);\n                    double abs_res_219188 = fabs(defunc_0_f_res_219187);\n                    double tmp1_219189 = abs_res_219188 / x_219147;\n                    double x_219190 = tmp1_219189 * tmp1_219189;\n                    double y_219191 = tmp1_219189 * x_219190;\n                    double tmp2_219192 = 1.0 - y_219191;\n                    double x_219193 = tmp2_219192 * tmp2_219192;\n                    double tmp3_219194 = tmp2_219192 * x_219193;\n                    double tmp4_219195 = defunc_0_f_res_219183 * tmp3_219194;\n                    double defunc_0_f_res_219196;\n                    \n                    if (cond_219179) {\n                        defunc_0_f_res_219196 = 0.0;\n                    } else {\n                        int64_t i_219197 = add64(x_219146, i_228424);\n                        double defunc_0_add_arg_219198;\n                        \n                        defunc_0_add_arg_219198 = ((__global\n                                                    double *) mem_230675)[i_219197 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219138];\n                        defunc_0_f_res_219196 = defunc_0_add_arg_219198;\n                    }\n                    \n                    double x_219199 = a0_219173 * tmp4_219195;\n                    doub",
            "le defunc_9_fit_fun_res_219200 = defunc_0_f_res_219196 *\n                           x_219199;\n                    double defunc_1_op_res_219177 =\n                           defunc_9_fit_fun_res_219200 + redout_228423;\n                    double redout_tmp_234901 = defunc_1_op_res_219177;\n                    \n                    redout_228423 = redout_tmp_234901;\n                }\n                defunc_2_reduce_res_219174 = redout_228423;\n                ((__global double *) color_232138)[phys_tid_219139 + i_229079 *\n                                                   num_threads_232269] =\n                    defunc_2_reduce_res_219174;\n            }\n            for (int64_t i_234902 = 0; i_234902 < l_n_m_203733; i_234902++) {\n                double tmp_234903;\n                \n                tmp_234903 = ((__global\n                               double *) color_232138)[phys_tid_219139 +\n                                                       i_234902 *\n                                                       num_threads_232269];\n                ((__global double *) mem_230694)[gtid_219138 + i_234902 *\n                                                 partition_sizze_203667] =\n                    tmp_234903;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219134\n}\n__kernel void mainzisegmap_219524(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229519, __global\n          ",
            "                        unsigned char *ext_mem_229520, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_230659, __global\n                                  unsigned char *mem_230699)\n{\n    #define segmap_group_sizze_219515 (mainzisegmap_group_sizze_219206)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234904;\n    int32_t local_tid_234905;\n    int64_t group_sizze_234908;\n    int32_t wave_sizze_234907;\n    int32_t group_tid_234906;\n    \n    global_tid_234904 = get_global_id(0);\n    local_tid_234905 = get_local_id(0);\n    group_sizze_234908 = get_local_size(0);\n    wave_sizze_234907 = LOCKSTEP_WIDTH;\n    group_tid_234906 = get_group_id(0);\n    \n    int32_t phys_tid_219524 = global_tid_234904;\n    int64_t global_tid_234909 = sext_i32_i64(group_tid_234906) *\n            segmap_group_sizze_219515 + sext_i32_i64(local_tid_234905);\n    int64_t slice_234910 = l_n_m_203733;\n    int64_t slice_234911 = partition_sizze_203667 * slice_234910;\n    int64_t gtid_219522 = squot64(global_tid_234909, slice_234910);\n    int64_t remnant_234912 = global_tid_234909 - gtid_219522 * slice_234910;\n    int64_t gtid_219523 = remnant_234912;\n    int64_t remnant_234913 = remnant_234912 - gtid_219523;\n    \n    if (slt64(gtid_219522, partition_sizze_203667) && slt64(gtid_219523,\n                                                            l_n_m_203733)) {\n        int64_t x_219528;\n        \n        x_219528 = ((__global int64_t *) ext_mem_229520)[gtid_219522 *\n                                                         l_n_m_203733 +\n                                                         gtid_219523];\n        \n        double x_219529;\n        \n        x_219529 = ((__global double *) ext_mem_229519)[gtid_219522 *\n                                                        l_n_m_203733 +\n       ",
            "                                                 gtid_219523];\n        \n        int64_t min_arg_219530 = mul64(jump_t_203582, gtid_219523);\n        int64_t min_res_219531 = smin64(i_203760, min_arg_219530);\n        int64_t defunc_0_g_res_219532 = add64((int64_t) 1, min_res_219531);\n        double defunc_2_reduce_res_219533;\n        double redout_228429 = 0.0;\n        \n        for (int64_t i_228430 = 0; i_228430 < q_l_203577; i_228430++) {\n            bool cond_219538 = sle64(n_203572, i_228430);\n            int64_t defunc_0_f_res_219539;\n            \n            if (cond_219538) {\n                defunc_0_f_res_219539 = (int64_t) 0;\n            } else {\n                int64_t i_219540 = add64(x_219528, i_228430);\n                int64_t defunc_1_add_res_219541 = add64((int64_t) 1, i_219540);\n                \n                defunc_0_f_res_219539 = defunc_1_add_res_219541;\n            }\n            \n            double defunc_0_f_res_219542;\n            \n            if (cond_219538) {\n                defunc_0_f_res_219542 = 0.0;\n            } else {\n                int64_t i_219543 = add64(x_219528, i_228430);\n                double defunc_0_add_arg_219544;\n                \n                defunc_0_add_arg_219544 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_219522 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_219543 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_219542 = defunc_0_add_arg_219544;\n            }\n            \n            int64_t binop_p_219545 = sub64(defunc_0_f_res_219539,\n                                           defunc_0_g_res_219532);\n            double defunc_0_f_res_219546 = sitofp_i64_f64(binop_p_21954",
            "5);\n            double abs_res_219547 = fabs(defunc_0_f_res_219546);\n            double tmp1_219548 = abs_res_219547 / x_219529;\n            double x_219549 = tmp1_219548 * tmp1_219548;\n            double y_219550 = tmp1_219548 * x_219549;\n            double tmp2_219551 = 1.0 - y_219550;\n            double x_219552 = tmp2_219551 * tmp2_219551;\n            double tmp3_219553 = tmp2_219551 * x_219552;\n            double w_j_219554 = defunc_0_f_res_219542 * tmp3_219553;\n            double defunc_1_op_res_219536 = w_j_219554 + redout_228429;\n            double redout_tmp_234914 = defunc_1_op_res_219536;\n            \n            redout_228429 = redout_tmp_234914;\n        }\n        defunc_2_reduce_res_219533 = redout_228429;\n        \n        double a0_219555 = 1.0 / defunc_2_reduce_res_219533;\n        double defunc_2_reduce_res_219556;\n        double redout_228431 = 0.0;\n        \n        for (int64_t i_228432 = 0; i_228432 < q_l_203577; i_228432++) {\n            bool cond_219561 = sle64(n_203572, i_228432);\n            int64_t defunc_0_f_res_219562;\n            \n            if (cond_219561) {\n                defunc_0_f_res_219562 = (int64_t) 0;\n            } else {\n                int64_t i_219563 = add64(x_219528, i_228432);\n                int64_t defunc_1_add_res_219564 = add64((int64_t) 1, i_219563);\n                \n                defunc_0_f_res_219562 = defunc_1_add_res_219564;\n            }\n            \n            double defunc_0_f_res_219565;\n            \n            if (cond_219561) {\n                defunc_0_f_res_219565 = 0.0;\n            } else {\n                int64_t i_219566 = add64(x_219528, i_228432);\n                double defunc_0_add_arg_219567;\n                \n                defunc_0_add_arg_219567 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_219522 *\n                                                         ",
            "                ctx_param_ext_229597 +\n                                                                         i_219566 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_219565 = defunc_0_add_arg_219567;\n            }\n            \n            int64_t binop_p_219568 = sub64(defunc_0_f_res_219562,\n                                           defunc_0_g_res_219532);\n            double defunc_0_f_res_219569 = sitofp_i64_f64(binop_p_219568);\n            double abs_res_219570 = fabs(defunc_0_f_res_219569);\n            double tmp1_219571 = abs_res_219570 / x_219529;\n            double x_219572 = tmp1_219571 * tmp1_219571;\n            double y_219573 = tmp1_219571 * x_219572;\n            double tmp2_219574 = 1.0 - y_219573;\n            double x_219575 = tmp2_219574 * tmp2_219574;\n            double tmp3_219576 = tmp2_219574 * x_219575;\n            double tmp4_219577 = defunc_0_f_res_219565 * tmp3_219576;\n            double defunc_0_f_res_219578;\n            \n            if (cond_219561) {\n                defunc_0_f_res_219578 = 0.0;\n            } else {\n                int64_t i_219579 = add64(x_219528, i_228432);\n                double defunc_0_add_arg_219580;\n                \n                defunc_0_add_arg_219580 = ((__global\n                                            double *) mem_230659)[gtid_219522 *\n                                                                  n_203572 +\n                                                                  i_219579];\n                defunc_0_f_res_219578 = defunc_0_add_arg_219580;\n            }\n            \n            double x_219581 = a0_219555 * tmp4_219577;\n            double defunc_9_fit_fun_res_219582 = defunc_0_f_res_219578 *\n                   x_219581;\n            double defunc_1_op_res_219559 = defunc_9_fit_fun_res_219582 +\n                   redout_228431;\n            double redout_tmp_234915 = defunc_1_op_res_219559;\n            \n            ",
            "redout_228431 = redout_tmp_234915;\n        }\n        defunc_2_reduce_res_219556 = redout_228431;\n        ((__global double *) mem_230699)[gtid_219522 * l_n_m_203733 +\n                                         gtid_219523] =\n            defunc_2_reduce_res_219556;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219515\n}\n__kernel void mainzisegmap_219641(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, __global\n                                  unsigned char *mem_230704, __global\n                                  unsigned char *mem_230709)\n{\n    #define segmap_group_sizze_219636 (mainzisegmap_group_sizze_219337)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234988;\n    int32_t local_tid_234989;\n    int64_t group_sizze_234992;\n    int32_t wave_sizze_234991;\n    int32_t group_tid_234990;\n    \n    global_tid_234988 = get_global_id(0);\n    local_tid_234989 = get_local_id(0);\n    group_sizze_234992 = get_local_size(0);\n    wave_sizze_234991 = LOCKSTEP_WIDTH;\n    group_tid_234990 = get_group_id(0);\n    \n    int32_t phys_tid_219641 = global_tid_234988;\n    int64_t global_tid_234993 = sext_i32_i64(group_tid_234990) *\n            segmap_group_sizze_219636 + sext_i32_i64(local_tid_234989);\n    int64_t slice_234994 = l_n_m_203733;\n    int64_t slice_234995 = partition_sizze_203667 * slice_234994;\n    int64_t gtid_219639 = squot64(global_tid_234993, slice_234994);\n    int64_t remnant_234996 = global_tid_234993 - gtid_219639 * slice_234994;\n    int64_t gtid_219640 = remnant_234996;\n    int64_t remnant_234997 = remnant_234996 - gtid_219640;\n    \n    if (slt64(gtid_219639, partition_sizze_203667) && slt64(gtid_219640,\n                                                            l_n_m_203733)) {\n        double defunc_2_reduce_res_219642;\n      ",
            "  \n        defunc_2_reduce_res_219642 = ((__global\n                                       double *) mem_230704)[gtid_219639 *\n                                                             l_n_m_203733 +\n                                                             gtid_219640];\n        \n        double a0_219643 = 1.0 / defunc_2_reduce_res_219642;\n        \n        ((__global double *) mem_230709)[gtid_219639 * l_n_m_203733 +\n                                         gtid_219640] = a0_219643;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219636\n}\n__kernel void mainzisegmap_219802(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t num_groups_219797,\n                                  int64_t num_threads_232275, __global\n                                  unsigned char *mem_230724, __global\n                                  unsigned char *mem_230727, __global\n                                  unsigned char *mem_230730, __global\n                                  unsigned char *mem_230733, __global\n                                  unsigned char *mem_230767, __global\n                                  unsigned char *mem_230770, __global\n                                  unsigned char *color_232139, __global\n                                  unsigned char *color_232140)\n{\n    #define segmap_group_sizze_219796 (mainzisegmap_group_sizze_219698)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235087;\n    int32_t local_tid_235088;\n    int64_t group_sizze_235091;\n    int32_t wave_sizze_235090;\n    int32_t group_tid_235089;\n    \n    global_tid_235087 = get_gl",
            "obal_id(0);\n    local_tid_235088 = get_local_id(0);\n    group_sizze_235091 = get_local_size(0);\n    wave_sizze_235090 = LOCKSTEP_WIDTH;\n    group_tid_235089 = get_group_id(0);\n    \n    int32_t phys_tid_219802 = global_tid_235087;\n    int32_t phys_group_id_235092;\n    \n    phys_group_id_235092 = get_group_id(0);\n    for (int32_t i_235093 = 0; i_235093 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_219796)) -\n                   phys_group_id_235092, sext_i64_i32(num_groups_219797));\n         i_235093++) {\n        int32_t virt_group_id_235094 = phys_group_id_235092 + i_235093 *\n                sext_i64_i32(num_groups_219797);\n        int64_t global_tid_235095 = sext_i32_i64(virt_group_id_235094) *\n                segmap_group_sizze_219796 + sext_i32_i64(local_tid_235088);\n        int64_t slice_235096 = partition_sizze_203667;\n        int64_t gtid_219801 = global_tid_235095;\n        int64_t remnant_235097 = global_tid_235095 - gtid_219801;\n        \n        if (slt64(gtid_219801, partition_sizze_203667)) {\n            for (int64_t i_229085 = 0; i_229085 < l_n_m_203733; i_229085++) {\n                int64_t x_219810;\n                \n                x_219810 = ((__global int64_t *) mem_230724)[i_229085 *\n                                                             partition_sizze_203667 +\n                                                             gtid_219801];\n                \n                double x_219811;\n                \n                x_219811 = ((__global double *) mem_230727)[i_229085 *\n                                                            partition_sizze_203667 +\n                                                            gtid_219801];\n                \n                int64_t min_arg_219812 = mul64(jump_t_203582, i_229085);\n                int64_t min_res_219813 = smin64(i_203760, min_arg_219812);\n                int64_t defunc_0_g_res_219814 = add64((int64_t) 1,\n          ",
            "                                            min_res_219813);\n                double defunc_2_reduce_res_219815;\n                double defunc_2_reduce_res_219816;\n                double defunc_2_reduce_res_219817;\n                double redout_228445;\n                double redout_228446;\n                double redout_228447;\n                \n                redout_228445 = 0.0;\n                redout_228446 = 0.0;\n                redout_228447 = 0.0;\n                for (int64_t i_228448 = 0; i_228448 < q_l_203577; i_228448++) {\n                    bool cond_219828 = sle64(n_203572, i_228448);\n                    int64_t defunc_0_f_res_219829;\n                    \n                    if (cond_219828) {\n                        defunc_0_f_res_219829 = (int64_t) 0;\n                    } else {\n                        int64_t i_219830 = add64(x_219810, i_228448);\n                        int64_t defunc_1_add_res_219831 = add64((int64_t) 1,\n                                                                i_219830);\n                        \n                        defunc_0_f_res_219829 = defunc_1_add_res_219831;\n                    }\n                    \n                    double defunc_0_f_res_219832;\n                    \n                    if (cond_219828) {\n                        defunc_0_f_res_219832 = 0.0;\n                    } else {\n                        int64_t i_219833 = add64(x_219810, i_228448);\n                        double defunc_0_add_arg_219834;\n                        \n                        defunc_0_add_arg_219834 = ((__global\n                                                    double *) mem_230730)[i_219833 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219801];\n                        defunc_0_f_res_219832 = defunc_0_add_arg_219834;\n                    }\n                    \n                    int64_t binop_p_219835",
            " = sub64(defunc_0_f_res_219829,\n                                                   defunc_0_g_res_219814);\n                    double defunc_0_f_res_219836 =\n                           sitofp_i64_f64(binop_p_219835);\n                    double abs_res_219837 = fabs(defunc_0_f_res_219836);\n                    double tmp1_219838 = abs_res_219837 / x_219811;\n                    double x_219839 = tmp1_219838 * tmp1_219838;\n                    double y_219840 = tmp1_219838 * x_219839;\n                    double tmp2_219841 = 1.0 - y_219840;\n                    double x_219842 = tmp2_219841 * tmp2_219841;\n                    double tmp3_219843 = tmp2_219841 * x_219842;\n                    double w_j_219844 = defunc_0_f_res_219832 * tmp3_219843;\n                    double xw_j_219845 = defunc_0_f_res_219836 * w_j_219844;\n                    double x2w_j_219846 = defunc_0_f_res_219836 * xw_j_219845;\n                    double defunc_1_op_res_219820 = w_j_219844 + redout_228445;\n                    double defunc_1_op_res_219823 = xw_j_219845 + redout_228446;\n                    double defunc_1_op_res_219826 = x2w_j_219846 +\n                           redout_228447;\n                    double redout_tmp_235100 = defunc_1_op_res_219820;\n                    double redout_tmp_235101 = defunc_1_op_res_219823;\n                    double redout_tmp_235102 = defunc_1_op_res_219826;\n                    \n                    redout_228445 = redout_tmp_235100;\n                    redout_228446 = redout_tmp_235101;\n                    redout_228447 = redout_tmp_235102;\n                }\n                defunc_2_reduce_res_219815 = redout_228445;\n                defunc_2_reduce_res_219816 = redout_228446;\n                defunc_2_reduce_res_219817 = redout_228447;\n                \n                double x_219847 = defunc_2_reduce_res_219815 *\n                       defunc_2_reduce_res_219817;\n                double y_219848 = defunc_2_reduce_res_219816 *\n                       defunc_2_re",
            "duce_res_219816;\n                double y_219849 = x_219847 - y_219848;\n                double det1_219850 = 1.0 / y_219849;\n                double a11_219851 = defunc_2_reduce_res_219817 * det1_219850;\n                double x_219852 = 0.0 - defunc_2_reduce_res_219816;\n                double b11_219853 = det1_219850 * x_219852;\n                double c11_219854 = defunc_2_reduce_res_219815 * det1_219850;\n                double defunc_2_reduce_res_219855;\n                double defunc_2_reduce_res_219856;\n                double redout_228449;\n                double redout_228450;\n                \n                redout_228449 = 0.0;\n                redout_228450 = 0.0;\n                for (int64_t i_228451 = 0; i_228451 < q_l_203577; i_228451++) {\n                    bool cond_219864 = sle64(n_203572, i_228451);\n                    int64_t defunc_0_f_res_219865;\n                    \n                    if (cond_219864) {\n                        defunc_0_f_res_219865 = (int64_t) 0;\n                    } else {\n                        int64_t i_219866 = add64(x_219810, i_228451);\n                        int64_t defunc_1_add_res_219867 = add64((int64_t) 1,\n                                                                i_219866);\n                        \n                        defunc_0_f_res_219865 = defunc_1_add_res_219867;\n                    }\n                    \n                    double defunc_0_f_res_219868;\n                    \n                    if (cond_219864) {\n                        defunc_0_f_res_219868 = 0.0;\n                    } else {\n                        int64_t i_219869 = add64(x_219810, i_228451);\n                        double defunc_0_add_arg_219870;\n                        \n                        defunc_0_add_arg_219870 = ((__global\n                                                    double *) mem_230730)[i_219869 *\n                                                                          partition_sizze_203667 +\n                        ",
            "                                                  gtid_219801];\n                        defunc_0_f_res_219868 = defunc_0_add_arg_219870;\n                    }\n                    \n                    int64_t binop_p_219871 = sub64(defunc_0_f_res_219865,\n                                                   defunc_0_g_res_219814);\n                    double defunc_0_f_res_219872 =\n                           sitofp_i64_f64(binop_p_219871);\n                    double abs_res_219873 = fabs(defunc_0_f_res_219872);\n                    double tmp1_219874 = abs_res_219873 / x_219811;\n                    double x_219875 = tmp1_219874 * tmp1_219874;\n                    double y_219876 = tmp1_219874 * x_219875;\n                    double tmp2_219877 = 1.0 - y_219876;\n                    double x_219878 = tmp2_219877 * tmp2_219877;\n                    double tmp3_219879 = tmp2_219877 * x_219878;\n                    double tmp4_219880 = defunc_0_f_res_219868 * tmp3_219879;\n                    double defunc_1_f_res_219881 = defunc_0_f_res_219872 *\n                           tmp4_219880;\n                    double defunc_0_f_res_219882;\n                    \n                    if (cond_219864) {\n                        defunc_0_f_res_219882 = 0.0;\n                    } else {\n                        int64_t i_219883 = add64(x_219810, i_228451);\n                        double defunc_0_add_arg_219884;\n                        \n                        defunc_0_add_arg_219884 = ((__global\n                                                    double *) mem_230733)[i_219883 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_219801];\n                        defunc_0_f_res_219882 = defunc_0_add_arg_219884;\n                    }\n                    \n                    double x_219885 = a11_219851 * tmp4_219880;\n                    double y_219886 = b11_219853 * defunc",
            "_1_f_res_219881;\n                    double x_219887 = x_219885 + y_219886;\n                    double defunc_9_fit_fun_res_219888 = defunc_0_f_res_219882 *\n                           x_219887;\n                    double x_219889 = b11_219853 * tmp4_219880;\n                    double y_219890 = c11_219854 * defunc_1_f_res_219881;\n                    double x_219891 = x_219889 + y_219890;\n                    double defunc_9_slope_fun_res_219892 =\n                           defunc_0_f_res_219882 * x_219891;\n                    double defunc_1_op_res_219859 =\n                           defunc_9_fit_fun_res_219888 + redout_228449;\n                    double defunc_1_op_res_219862 =\n                           defunc_9_slope_fun_res_219892 + redout_228450;\n                    double redout_tmp_235103 = defunc_1_op_res_219859;\n                    double redout_tmp_235104 = defunc_1_op_res_219862;\n                    \n                    redout_228449 = redout_tmp_235103;\n                    redout_228450 = redout_tmp_235104;\n                }\n                defunc_2_reduce_res_219855 = redout_228449;\n                defunc_2_reduce_res_219856 = redout_228450;\n                ((__global double *) color_232140)[phys_tid_219802 + i_229085 *\n                                                   num_threads_232275] =\n                    defunc_2_reduce_res_219855;\n                ((__global double *) color_232139)[phys_tid_219802 + i_229085 *\n                                                   num_threads_232275] =\n                    defunc_2_reduce_res_219856;\n            }\n            for (int64_t i_235105 = 0; i_235105 < l_n_m_203733; i_235105++) {\n                double tmp_235106;\n                \n                tmp_235106 = ((__global\n                               double *) color_232140)[phys_tid_219802 +\n                                                       i_235105 *\n                                                       num_threads_232275];\n                ((__global ",
            "double *) mem_230767)[gtid_219801 + i_235105 *\n                                                 partition_sizze_203667] =\n                    tmp_235106;\n            }\n            for (int64_t i_235107 = 0; i_235107 < l_n_m_203733; i_235107++) {\n                double tmp_235108;\n                \n                tmp_235108 = ((__global\n                               double *) color_232139)[phys_tid_219802 +\n                                                       i_235107 *\n                                                       num_threads_232275];\n                ((__global double *) mem_230770)[gtid_219801 + i_235107 *\n                                                 partition_sizze_203667] =\n                    tmp_235108;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219796\n}\n__kernel void mainzisegmap_220323(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229519, __global\n                                  unsigned char *ext_mem_229520, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_230659, __global\n                                  unsigned char *mem_230775, __global\n                                  unsigned char *mem_230779)\n{\n    #define segmap_group_sizze_220312 (mainzisegmap_group_sizze_219898)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const ",
            "int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235109;\n    int32_t local_tid_235110;\n    int64_t group_sizze_235113;\n    int32_t wave_sizze_235112;\n    int32_t group_tid_235111;\n    \n    global_tid_235109 = get_global_id(0);\n    local_tid_235110 = get_local_id(0);\n    group_sizze_235113 = get_local_size(0);\n    wave_sizze_235112 = LOCKSTEP_WIDTH;\n    group_tid_235111 = get_group_id(0);\n    \n    int32_t phys_tid_220323 = global_tid_235109;\n    int64_t global_tid_235114 = sext_i32_i64(group_tid_235111) *\n            segmap_group_sizze_220312 + sext_i32_i64(local_tid_235110);\n    int64_t slice_235115 = l_n_m_203733;\n    int64_t slice_235116 = partition_sizze_203667 * slice_235115;\n    int64_t gtid_220321 = squot64(global_tid_235114, slice_235115);\n    int64_t remnant_235117 = global_tid_235114 - gtid_220321 * slice_235115;\n    int64_t gtid_220322 = remnant_235117;\n    int64_t remnant_235118 = remnant_235117 - gtid_220322;\n    \n    if (slt64(gtid_220321, partition_sizze_203667) && slt64(gtid_220322,\n                                                            l_n_m_203733)) {\n        int64_t x_220327;\n        \n        x_220327 = ((__global int64_t *) ext_mem_229520)[gtid_220321 *\n                                                         l_n_m_203733 +\n                                                         gtid_220322];\n        \n        double x_220328;\n        \n        x_220328 = ((__global double *) ext_mem_229519)[gtid_220321 *\n                                                        l_n_m_203733 +\n                                                        gtid_220322];\n        \n        int64_t min_arg_220329 = mul64(jump_t_203582, gtid_220322);\n        int64_t min_res_220330 = smin64(i_203760, min_arg_220329);\n        int64_t defunc_0_g_res_220331 = add64((int64_t) 1, min_res_220330);\n        double defunc_2_reduce_res_220332;\n        double defunc_2_reduce_res_220333;\n        double defunc_2_reduce_res_220334;\n        ",
            "double redout_228456;\n        double redout_228457;\n        double redout_228458;\n        \n        redout_228456 = 0.0;\n        redout_228457 = 0.0;\n        redout_228458 = 0.0;\n        for (int64_t i_228459 = 0; i_228459 < q_l_203577; i_228459++) {\n            bool cond_220345 = sle64(n_203572, i_228459);\n            int64_t defunc_0_f_res_220346;\n            \n            if (cond_220345) {\n                defunc_0_f_res_220346 = (int64_t) 0;\n            } else {\n                int64_t i_220347 = add64(x_220327, i_228459);\n                int64_t defunc_1_add_res_220348 = add64((int64_t) 1, i_220347);\n                \n                defunc_0_f_res_220346 = defunc_1_add_res_220348;\n            }\n            \n            double defunc_0_f_res_220349;\n            \n            if (cond_220345) {\n                defunc_0_f_res_220349 = 0.0;\n            } else {\n                int64_t i_220350 = add64(x_220327, i_228459);\n                double defunc_0_add_arg_220351;\n                \n                defunc_0_add_arg_220351 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_220321 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_220350 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_220349 = defunc_0_add_arg_220351;\n            }\n            \n            int64_t binop_p_220352 = sub64(defunc_0_f_res_220346,\n                                           defunc_0_g_res_220331);\n            double defunc_0_f_res_220353 = sitofp_i64_f64(binop_p_220352);\n            double abs_res_220354 = fabs(defunc_0_f_res_220353);\n            double tmp1_220355 = abs_res_220354 / x_220328;\n            double x_220356 = tmp1_220355 * tmp1_220355;\n       ",
            "     double y_220357 = tmp1_220355 * x_220356;\n            double tmp2_220358 = 1.0 - y_220357;\n            double x_220359 = tmp2_220358 * tmp2_220358;\n            double tmp3_220360 = tmp2_220358 * x_220359;\n            double w_j_220361 = defunc_0_f_res_220349 * tmp3_220360;\n            double xw_j_220362 = defunc_0_f_res_220353 * w_j_220361;\n            double x2w_j_220363 = defunc_0_f_res_220353 * xw_j_220362;\n            double defunc_1_op_res_220337 = w_j_220361 + redout_228456;\n            double defunc_1_op_res_220340 = xw_j_220362 + redout_228457;\n            double defunc_1_op_res_220343 = x2w_j_220363 + redout_228458;\n            double redout_tmp_235119 = defunc_1_op_res_220337;\n            double redout_tmp_235120 = defunc_1_op_res_220340;\n            double redout_tmp_235121 = defunc_1_op_res_220343;\n            \n            redout_228456 = redout_tmp_235119;\n            redout_228457 = redout_tmp_235120;\n            redout_228458 = redout_tmp_235121;\n        }\n        defunc_2_reduce_res_220332 = redout_228456;\n        defunc_2_reduce_res_220333 = redout_228457;\n        defunc_2_reduce_res_220334 = redout_228458;\n        \n        double x_220364 = defunc_2_reduce_res_220332 *\n               defunc_2_reduce_res_220334;\n        double y_220365 = defunc_2_reduce_res_220333 *\n               defunc_2_reduce_res_220333;\n        double y_220366 = x_220364 - y_220365;\n        double det1_220367 = 1.0 / y_220366;\n        double a11_220368 = defunc_2_reduce_res_220334 * det1_220367;\n        double x_220369 = 0.0 - defunc_2_reduce_res_220333;\n        double b11_220370 = det1_220367 * x_220369;\n        double c11_220371 = defunc_2_reduce_res_220332 * det1_220367;\n        double defunc_2_reduce_res_220372;\n        double defunc_2_reduce_res_220373;\n        double redout_228460;\n        double redout_228461;\n        \n        redout_228460 = 0.0;\n        redout_228461 = 0.0;\n        for (int64_t i_228462 = 0; i_228462 < q_l_203577; i_228462++) {\n            bool co",
            "nd_220381 = sle64(n_203572, i_228462);\n            int64_t defunc_0_f_res_220382;\n            \n            if (cond_220381) {\n                defunc_0_f_res_220382 = (int64_t) 0;\n            } else {\n                int64_t i_220383 = add64(x_220327, i_228462);\n                int64_t defunc_1_add_res_220384 = add64((int64_t) 1, i_220383);\n                \n                defunc_0_f_res_220382 = defunc_1_add_res_220384;\n            }\n            \n            double defunc_0_f_res_220385;\n            \n            if (cond_220381) {\n                defunc_0_f_res_220385 = 0.0;\n            } else {\n                int64_t i_220386 = add64(x_220327, i_228462);\n                double defunc_0_add_arg_220387;\n                \n                defunc_0_add_arg_220387 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_220321 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_220386 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_220385 = defunc_0_add_arg_220387;\n            }\n            \n            int64_t binop_p_220388 = sub64(defunc_0_f_res_220382,\n                                           defunc_0_g_res_220331);\n            double defunc_0_f_res_220389 = sitofp_i64_f64(binop_p_220388);\n            double abs_res_220390 = fabs(defunc_0_f_res_220389);\n            double tmp1_220391 = abs_res_220390 / x_220328;\n            double x_220392 = tmp1_220391 * tmp1_220391;\n            double y_220393 = tmp1_220391 * x_220392;\n            double tmp2_220394 = 1.0 - y_220393;\n            double x_220395 = tmp2_220394 * tmp2_220394;\n            double tmp3_220396 = tmp2_220394 * x_220395;\n            double tmp4_220397 = defunc_0_f_res_220385 * tm",
            "p3_220396;\n            double defunc_1_f_res_220398 = defunc_0_f_res_220389 * tmp4_220397;\n            double defunc_0_f_res_220399;\n            \n            if (cond_220381) {\n                defunc_0_f_res_220399 = 0.0;\n            } else {\n                int64_t i_220400 = add64(x_220327, i_228462);\n                double defunc_0_add_arg_220401;\n                \n                defunc_0_add_arg_220401 = ((__global\n                                            double *) mem_230659)[gtid_220321 *\n                                                                  n_203572 +\n                                                                  i_220400];\n                defunc_0_f_res_220399 = defunc_0_add_arg_220401;\n            }\n            \n            double x_220402 = a11_220368 * tmp4_220397;\n            double y_220403 = b11_220370 * defunc_1_f_res_220398;\n            double x_220404 = x_220402 + y_220403;\n            double defunc_9_fit_fun_res_220405 = defunc_0_f_res_220399 *\n                   x_220404;\n            double x_220406 = b11_220370 * tmp4_220397;\n            double y_220407 = c11_220371 * defunc_1_f_res_220398;\n            double x_220408 = x_220406 + y_220407;\n            double defunc_9_slope_fun_res_220409 = defunc_0_f_res_220399 *\n                   x_220408;\n            double defunc_1_op_res_220376 = defunc_9_fit_fun_res_220405 +\n                   redout_228460;\n            double defunc_1_op_res_220379 = defunc_9_slope_fun_res_220409 +\n                   redout_228461;\n            double redout_tmp_235122 = defunc_1_op_res_220376;\n            double redout_tmp_235123 = defunc_1_op_res_220379;\n            \n            redout_228460 = redout_tmp_235122;\n            redout_228461 = redout_tmp_235123;\n        }\n        defunc_2_reduce_res_220372 = redout_228460;\n        defunc_2_reduce_res_220373 = redout_228461;\n        ((__global double *) mem_230775)[gtid_220321 * l_n_m_203733 +\n                                         gtid_220322] =\n        ",
            "    defunc_2_reduce_res_220372;\n        ((__global double *) mem_230779)[gtid_220321 * l_n_m_203733 +\n                                         gtid_220322] =\n            defunc_2_reduce_res_220373;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220312\n}\n__kernel void mainzisegmap_220480(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, __global\n                                  unsigned char *mem_230784, __global\n                                  unsigned char *mem_230788, __global\n                                  unsigned char *mem_230792, __global\n                                  unsigned char *mem_230797, __global\n                                  unsigned char *mem_230801, __global\n                                  unsigned char *mem_230805)\n{\n    #define segmap_group_sizze_220473 (mainzisegmap_group_sizze_220080)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235224;\n    int32_t local_tid_235225;\n    int64_t group_sizze_235228;\n    int32_t wave_sizze_235227;\n    int32_t group_tid_235226;\n    \n    global_tid_235224 = get_global_id(0);\n    local_tid_235225 = get_local_id(0);\n    group_sizze_235228 = get_local_size(0);\n    wave_sizze_235227 = LOCKSTEP_WIDTH;\n    group_tid_235226 = get_group_id(0);\n    \n    int32_t phys_tid_220480 = global_tid_235224;\n    int64_t global_tid_235229 = sext_i32_i64(group_tid_235226) *\n            segmap_group_sizze_220473 + sext_i32_i64(local_tid_235225);\n    int64_t slice_235230 = l_n_m_203733;\n    int64_t slice_235231 = partition_sizze_203667 * slice_235230;\n    int64_t gtid_220478 = squot64(global_tid_235229, slice_235230);\n    int64_t remnant_235232 = global_tid_235229 - gtid_220478 * slice_235230;\n    int64_t gtid_220479 = remnant_235232;\n    int64_t remnant_235233 = remnant_235232 - gt",
            "id_220479;\n    \n    if (slt64(gtid_220478, partition_sizze_203667) && slt64(gtid_220479,\n                                                            l_n_m_203733)) {\n        double defunc_2_reduce_res_220481;\n        \n        defunc_2_reduce_res_220481 = ((__global\n                                       double *) mem_230784)[gtid_220478 *\n                                                             l_n_m_203733 +\n                                                             gtid_220479];\n        \n        double defunc_2_reduce_res_220482;\n        \n        defunc_2_reduce_res_220482 = ((__global\n                                       double *) mem_230788)[gtid_220478 *\n                                                             l_n_m_203733 +\n                                                             gtid_220479];\n        \n        double defunc_2_reduce_res_220483;\n        \n        defunc_2_reduce_res_220483 = ((__global\n                                       double *) mem_230792)[gtid_220478 *\n                                                             l_n_m_203733 +\n                                                             gtid_220479];\n        \n        double x_220484 = defunc_2_reduce_res_220481 *\n               defunc_2_reduce_res_220483;\n        double y_220485 = defunc_2_reduce_res_220482 *\n               defunc_2_reduce_res_220482;\n        double y_220486 = x_220484 - y_220485;\n        double det1_220487 = 1.0 / y_220486;\n        double a11_220488 = defunc_2_reduce_res_220483 * det1_220487;\n        double x_220489 = 0.0 - defunc_2_reduce_res_220482;\n        double b11_220490 = det1_220487 * x_220489;\n        double c11_220491 = defunc_2_reduce_res_220481 * det1_220487;\n        \n        ((__global double *) mem_230797)[gtid_220478 * l_n_m_203733 +\n                                         gtid_220479] = a11_220488;\n        ((__global double *) mem_230801)[gtid_220478 * l_n_m_203733 +\n                                         gtid_220479] = b11_220490;\n    ",
            "    ((__global double *) mem_230805)[gtid_220478 * l_n_m_203733 +\n                                         gtid_220479] = c11_220491;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220473\n}\n__kernel void mainzisegmap_220699(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t num_groups_220694,\n                                  int64_t num_threads_232282, __global\n                                  unsigned char *mem_230831, __global\n                                  unsigned char *mem_230834, __global\n                                  unsigned char *mem_230837, __global\n                                  unsigned char *mem_230840, __global\n                                  unsigned char *mem_230874, __global\n                                  unsigned char *mem_230877, __global\n                                  unsigned char *color_232141, __global\n                                  unsigned char *color_232142)\n{\n    #define segmap_group_sizze_220693 (mainzisegmap_group_sizze_220563)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235337;\n    int32_t local_tid_235338;\n    int64_t group_sizze_235341;\n    int32_t wave_sizze_235340;\n    int32_t group_tid_235339;\n    \n    global_tid_235337 = get_global_id(0);\n    local_tid_235338 = get_local_id(0);\n    group_sizze_235341 = get_local_size(0);\n    wave_sizze_235340 = LOCKSTEP_WIDTH;\n    group_tid_235339 = get_group_id(0);\n    \n    int32_t phys_tid_220699 = global_tid_235337;\n    int32_t phys_group_id_235342;\n    \n    phys_group_id_235342 = get_group_id(0);\n    for (int32_t i_235343 = 0; i_235343 <\n    ",
            "     sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_220693)) -\n                   phys_group_id_235342, sext_i64_i32(num_groups_220694));\n         i_235343++) {\n        int32_t virt_group_id_235344 = phys_group_id_235342 + i_235343 *\n                sext_i64_i32(num_groups_220694);\n        int64_t global_tid_235345 = sext_i32_i64(virt_group_id_235344) *\n                segmap_group_sizze_220693 + sext_i32_i64(local_tid_235338);\n        int64_t slice_235346 = partition_sizze_203667;\n        int64_t gtid_220698 = global_tid_235345;\n        int64_t remnant_235347 = global_tid_235345 - gtid_220698;\n        \n        if (slt64(gtid_220698, partition_sizze_203667)) {\n            for (int64_t i_229092 = 0; i_229092 < l_n_m_203733; i_229092++) {\n                int64_t x_220707;\n                \n                x_220707 = ((__global int64_t *) mem_230831)[i_229092 *\n                                                             partition_sizze_203667 +\n                                                             gtid_220698];\n                \n                double x_220708;\n                \n                x_220708 = ((__global double *) mem_230834)[i_229092 *\n                                                            partition_sizze_203667 +\n                                                            gtid_220698];\n                \n                int64_t min_arg_220709 = mul64(jump_t_203582, i_229092);\n                int64_t min_res_220710 = smin64(i_203760, min_arg_220709);\n                int64_t defunc_0_g_res_220711 = add64((int64_t) 1,\n                                                      min_res_220710);\n                double defunc_2_reduce_res_220712;\n                double defunc_2_reduce_res_220713;\n                double defunc_2_reduce_res_220714;\n                double defunc_2_reduce_res_220715;\n                double defunc_2_reduce_res_220716;\n                double redout_228475;\n     ",
            "           double redout_228476;\n                double redout_228477;\n                double redout_228478;\n                double redout_228479;\n                \n                redout_228475 = 0.0;\n                redout_228476 = 0.0;\n                redout_228477 = 0.0;\n                redout_228478 = 0.0;\n                redout_228479 = 0.0;\n                for (int64_t i_228480 = 0; i_228480 < q_l_203577; i_228480++) {\n                    bool cond_220733 = sle64(n_203572, i_228480);\n                    int64_t defunc_0_f_res_220734;\n                    \n                    if (cond_220733) {\n                        defunc_0_f_res_220734 = (int64_t) 0;\n                    } else {\n                        int64_t i_220735 = add64(x_220707, i_228480);\n                        int64_t defunc_1_add_res_220736 = add64((int64_t) 1,\n                                                                i_220735);\n                        \n                        defunc_0_f_res_220734 = defunc_1_add_res_220736;\n                    }\n                    \n                    double defunc_0_f_res_220737;\n                    \n                    if (cond_220733) {\n                        defunc_0_f_res_220737 = 0.0;\n                    } else {\n                        int64_t i_220738 = add64(x_220707, i_228480);\n                        double defunc_0_add_arg_220739;\n                        \n                        defunc_0_add_arg_220739 = ((__global\n                                                    double *) mem_230837)[i_220738 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_220698];\n                        defunc_0_f_res_220737 = defunc_0_add_arg_220739;\n                    }\n                    \n                    int64_t binop_p_220740 = sub64(defunc_0_f_res_220734,\n                                                   defunc_0_g_res_220711);\n",
            "                    double defunc_0_f_res_220741 =\n                           sitofp_i64_f64(binop_p_220740);\n                    double abs_res_220742 = fabs(defunc_0_f_res_220741);\n                    double tmp1_220743 = abs_res_220742 / x_220708;\n                    double x_220744 = tmp1_220743 * tmp1_220743;\n                    double y_220745 = tmp1_220743 * x_220744;\n                    double tmp2_220746 = 1.0 - y_220745;\n                    double x_220747 = tmp2_220746 * tmp2_220746;\n                    double tmp3_220748 = tmp2_220746 * x_220747;\n                    double w_j_220749 = defunc_0_f_res_220737 * tmp3_220748;\n                    double xw_j_220750 = defunc_0_f_res_220741 * w_j_220749;\n                    double x2w_j_220751 = defunc_0_f_res_220741 * xw_j_220750;\n                    double x3w_j_220752 = defunc_0_f_res_220741 * x2w_j_220751;\n                    double x4w_j_220753 = defunc_0_f_res_220741 * x3w_j_220752;\n                    double defunc_1_op_res_220719 = w_j_220749 + redout_228475;\n                    double defunc_1_op_res_220722 = xw_j_220750 + redout_228476;\n                    double defunc_1_op_res_220725 = x2w_j_220751 +\n                           redout_228477;\n                    double defunc_1_op_res_220728 = x3w_j_220752 +\n                           redout_228478;\n                    double defunc_1_op_res_220731 = x4w_j_220753 +\n                           redout_228479;\n                    double redout_tmp_235350 = defunc_1_op_res_220719;\n                    double redout_tmp_235351 = defunc_1_op_res_220722;\n                    double redout_tmp_235352 = defunc_1_op_res_220725;\n                    double redout_tmp_235353 = defunc_1_op_res_220728;\n                    double redout_tmp_235354 = defunc_1_op_res_220731;\n                    \n                    redout_228475 = redout_tmp_235350;\n                    redout_228476 = redout_tmp_235351;\n                    redout_228477 = redout_tmp_235352;\n             ",
            "       redout_228478 = redout_tmp_235353;\n                    redout_228479 = redout_tmp_235354;\n                }\n                defunc_2_reduce_res_220712 = redout_228475;\n                defunc_2_reduce_res_220713 = redout_228476;\n                defunc_2_reduce_res_220714 = redout_228477;\n                defunc_2_reduce_res_220715 = redout_228478;\n                defunc_2_reduce_res_220716 = redout_228479;\n                \n                double x_220754 = defunc_2_reduce_res_220714 *\n                       defunc_2_reduce_res_220716;\n                double y_220755 = defunc_2_reduce_res_220715 *\n                       defunc_2_reduce_res_220715;\n                double a12_220756 = x_220754 - y_220755;\n                double x_220757 = defunc_2_reduce_res_220714 *\n                       defunc_2_reduce_res_220715;\n                double y_220758 = defunc_2_reduce_res_220713 *\n                       defunc_2_reduce_res_220716;\n                double b12_220759 = x_220757 - y_220758;\n                double x_220760 = defunc_2_reduce_res_220713 *\n                       defunc_2_reduce_res_220715;\n                double y_220761 = defunc_2_reduce_res_220714 *\n                       defunc_2_reduce_res_220714;\n                double c12_220762 = x_220760 - y_220761;\n                double x_220763 = defunc_2_reduce_res_220712 *\n                       defunc_2_reduce_res_220716;\n                double b2_220764 = x_220763 - y_220761;\n                double x_220765 = defunc_2_reduce_res_220713 *\n                       defunc_2_reduce_res_220714;\n                double y_220766 = defunc_2_reduce_res_220712 *\n                       defunc_2_reduce_res_220715;\n                double c2_220767 = x_220765 - y_220766;\n                double x_220768 = defunc_2_reduce_res_220712 * a12_220756;\n                double y_220769 = defunc_2_reduce_res_220713 * b12_220759;\n                double x_220770 = x_220768 + y_220769;\n                double y_220771 = defunc_2_reduce_res_",
            "220714 * c12_220762;\n                double y_220772 = x_220770 + y_220771;\n                double det_220773 = 1.0 / y_220772;\n                double a12_220774 = a12_220756 * det_220773;\n                double b12_220775 = b12_220759 * det_220773;\n                double c12_220776 = c12_220762 * det_220773;\n                double b2_220777 = b2_220764 * det_220773;\n                double c2_220778 = c2_220767 * det_220773;\n                double defunc_2_reduce_res_220779;\n                double defunc_2_reduce_res_220780;\n                double redout_228481;\n                double redout_228482;\n                \n                redout_228481 = 0.0;\n                redout_228482 = 0.0;\n                for (int64_t i_228483 = 0; i_228483 < q_l_203577; i_228483++) {\n                    bool cond_220788 = sle64(n_203572, i_228483);\n                    int64_t defunc_0_f_res_220789;\n                    \n                    if (cond_220788) {\n                        defunc_0_f_res_220789 = (int64_t) 0;\n                    } else {\n                        int64_t i_220790 = add64(x_220707, i_228483);\n                        int64_t defunc_1_add_res_220791 = add64((int64_t) 1,\n                                                                i_220790);\n                        \n                        defunc_0_f_res_220789 = defunc_1_add_res_220791;\n                    }\n                    \n                    double defunc_0_f_res_220792;\n                    \n                    if (cond_220788) {\n                        defunc_0_f_res_220792 = 0.0;\n                    } else {\n                        int64_t i_220793 = add64(x_220707, i_228483);\n                        double defunc_0_add_arg_220794;\n                        \n                        defunc_0_add_arg_220794 = ((__global\n                                                    double *) mem_230837)[i_220793 *\n                                                                          partition_sizze_203667 +\n    ",
            "                                                                      gtid_220698];\n                        defunc_0_f_res_220792 = defunc_0_add_arg_220794;\n                    }\n                    \n                    int64_t binop_p_220795 = sub64(defunc_0_f_res_220789,\n                                                   defunc_0_g_res_220711);\n                    double defunc_0_f_res_220796 =\n                           sitofp_i64_f64(binop_p_220795);\n                    double abs_res_220797 = fabs(defunc_0_f_res_220796);\n                    double tmp1_220798 = abs_res_220797 / x_220708;\n                    double x_220799 = tmp1_220798 * tmp1_220798;\n                    double y_220800 = tmp1_220798 * x_220799;\n                    double tmp2_220801 = 1.0 - y_220800;\n                    double x_220802 = tmp2_220801 * tmp2_220801;\n                    double tmp3_220803 = tmp2_220801 * x_220802;\n                    double tmp4_220804 = defunc_0_f_res_220792 * tmp3_220803;\n                    double defunc_1_f_res_220805 = defunc_0_f_res_220796 *\n                           tmp4_220804;\n                    double defunc_1_f_res_220806 = defunc_0_f_res_220796 *\n                           defunc_1_f_res_220805;\n                    double defunc_0_f_res_220807;\n                    \n                    if (cond_220788) {\n                        defunc_0_f_res_220807 = 0.0;\n                    } else {\n                        int64_t i_220808 = add64(x_220707, i_228483);\n                        double defunc_0_add_arg_220809;\n                        \n                        defunc_0_add_arg_220809 = ((__global\n                                                    double *) mem_230840)[i_220808 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_220698];\n                        defunc_0_f_res_220807 = defunc_0_add_arg_220809;\n                   ",
            " }\n                    \n                    double x_220810 = a12_220774 * tmp4_220804;\n                    double y_220811 = b12_220775 * defunc_1_f_res_220805;\n                    double x_220812 = x_220810 + y_220811;\n                    double y_220813 = c12_220776 * defunc_1_f_res_220806;\n                    double x_220814 = x_220812 + y_220813;\n                    double defunc_9_fit_fun_res_220815 = defunc_0_f_res_220807 *\n                           x_220814;\n                    double x_220816 = b12_220775 * tmp4_220804;\n                    double y_220817 = b2_220777 * defunc_1_f_res_220805;\n                    double x_220818 = x_220816 + y_220817;\n                    double y_220819 = c2_220778 * defunc_1_f_res_220806;\n                    double x_220820 = x_220818 + y_220819;\n                    double defunc_9_slope_fun_res_220821 =\n                           defunc_0_f_res_220807 * x_220820;\n                    double defunc_1_op_res_220783 =\n                           defunc_9_fit_fun_res_220815 + redout_228481;\n                    double defunc_1_op_res_220786 =\n                           defunc_9_slope_fun_res_220821 + redout_228482;\n                    double redout_tmp_235355 = defunc_1_op_res_220783;\n                    double redout_tmp_235356 = defunc_1_op_res_220786;\n                    \n                    redout_228481 = redout_tmp_235355;\n                    redout_228482 = redout_tmp_235356;\n                }\n                defunc_2_reduce_res_220779 = redout_228481;\n                defunc_2_reduce_res_220780 = redout_228482;\n                ((__global double *) color_232142)[phys_tid_220699 + i_229092 *\n                                                   num_threads_232282] =\n                    defunc_2_reduce_res_220779;\n                ((__global double *) color_232141)[phys_tid_220699 + i_229092 *\n                                                   num_threads_232282] =\n                    defunc_2_reduce_res_220780;\n            }\n   ",
            "         for (int64_t i_235357 = 0; i_235357 < l_n_m_203733; i_235357++) {\n                double tmp_235358;\n                \n                tmp_235358 = ((__global\n                               double *) color_232142)[phys_tid_220699 +\n                                                       i_235357 *\n                                                       num_threads_232282];\n                ((__global double *) mem_230874)[gtid_220698 + i_235357 *\n                                                 partition_sizze_203667] =\n                    tmp_235358;\n            }\n            for (int64_t i_235359 = 0; i_235359 < l_n_m_203733; i_235359++) {\n                double tmp_235360;\n                \n                tmp_235360 = ((__global\n                               double *) color_232141)[phys_tid_220699 +\n                                                       i_235359 *\n                                                       num_threads_232282];\n                ((__global double *) mem_230877)[gtid_220698 + i_235359 *\n                                                 partition_sizze_203667] =\n                    tmp_235360;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220693\n}\n__kernel void mainzisegmap_221368(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_l_203577,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229519, __global\n                                  unsigned char *ext_mem_229520, __global\n                 ",
            "                 unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_230659, __global\n                                  unsigned char *mem_230882, __global\n                                  unsigned char *mem_230886)\n{\n    #define segmap_group_sizze_221357 (mainzisegmap_group_sizze_220827)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235361;\n    int32_t local_tid_235362;\n    int64_t group_sizze_235365;\n    int32_t wave_sizze_235364;\n    int32_t group_tid_235363;\n    \n    global_tid_235361 = get_global_id(0);\n    local_tid_235362 = get_local_id(0);\n    group_sizze_235365 = get_local_size(0);\n    wave_sizze_235364 = LOCKSTEP_WIDTH;\n    group_tid_235363 = get_group_id(0);\n    \n    int32_t phys_tid_221368 = global_tid_235361;\n    int64_t global_tid_235366 = sext_i32_i64(group_tid_235363) *\n            segmap_group_sizze_221357 + sext_i32_i64(local_tid_235362);\n    int64_t slice_235367 = l_n_m_203733;\n    int64_t slice_235368 = partition_sizze_203667 * slice_235367;\n    int64_t gtid_221366 = squot64(global_tid_235366, slice_235367);\n    int64_t remnant_235369 = global_tid_235366 - gtid_221366 * slice_235367;\n    int64_t gtid_221367 = remnant_235369;\n    int64_t remnant_235370 = remnant_235369 - gtid_221367;\n    \n    if (slt64(gtid_221366, partition_sizze_203667) && slt64(gtid_221367,\n                                                            l_n_m_203733)) {\n        int64_t x_221372;\n        \n        x_221372 = ((__global int64_t *) ext_mem_229520)[gtid_221366 *\n                                                         l_n_m_203733 +\n                                                         gtid_221367];\n        \n        double x_221373;\n        \n        x_221373 = ((__global double *) ext_mem_229519)[gtid_221366 *\n                                                        l_n_m_203733 +\n                  ",
            "                                      gtid_221367];\n        \n        int64_t min_arg_221374 = mul64(jump_t_203582, gtid_221367);\n        int64_t min_res_221375 = smin64(i_203760, min_arg_221374);\n        int64_t defunc_0_g_res_221376 = add64((int64_t) 1, min_res_221375);\n        double defunc_2_reduce_res_221377;\n        double defunc_2_reduce_res_221378;\n        double defunc_2_reduce_res_221379;\n        double defunc_2_reduce_res_221380;\n        double defunc_2_reduce_res_221381;\n        double redout_228488;\n        double redout_228489;\n        double redout_228490;\n        double redout_228491;\n        double redout_228492;\n        \n        redout_228488 = 0.0;\n        redout_228489 = 0.0;\n        redout_228490 = 0.0;\n        redout_228491 = 0.0;\n        redout_228492 = 0.0;\n        for (int64_t i_228493 = 0; i_228493 < q_l_203577; i_228493++) {\n            bool cond_221398 = sle64(n_203572, i_228493);\n            int64_t defunc_0_f_res_221399;\n            \n            if (cond_221398) {\n                defunc_0_f_res_221399 = (int64_t) 0;\n            } else {\n                int64_t i_221400 = add64(x_221372, i_228493);\n                int64_t defunc_1_add_res_221401 = add64((int64_t) 1, i_221400);\n                \n                defunc_0_f_res_221399 = defunc_1_add_res_221401;\n            }\n            \n            double defunc_0_f_res_221402;\n            \n            if (cond_221398) {\n                defunc_0_f_res_221402 = 0.0;\n            } else {\n                int64_t i_221403 = add64(x_221372, i_228493);\n                double defunc_0_add_arg_221404;\n                \n                defunc_0_add_arg_221404 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_221366 *\n                                                                         ctx_param_ext_229597 +\n                                                         ",
            "                i_221403 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_221402 = defunc_0_add_arg_221404;\n            }\n            \n            int64_t binop_p_221405 = sub64(defunc_0_f_res_221399,\n                                           defunc_0_g_res_221376);\n            double defunc_0_f_res_221406 = sitofp_i64_f64(binop_p_221405);\n            double abs_res_221407 = fabs(defunc_0_f_res_221406);\n            double tmp1_221408 = abs_res_221407 / x_221373;\n            double x_221409 = tmp1_221408 * tmp1_221408;\n            double y_221410 = tmp1_221408 * x_221409;\n            double tmp2_221411 = 1.0 - y_221410;\n            double x_221412 = tmp2_221411 * tmp2_221411;\n            double tmp3_221413 = tmp2_221411 * x_221412;\n            double w_j_221414 = defunc_0_f_res_221402 * tmp3_221413;\n            double xw_j_221415 = defunc_0_f_res_221406 * w_j_221414;\n            double x2w_j_221416 = defunc_0_f_res_221406 * xw_j_221415;\n            double x3w_j_221417 = defunc_0_f_res_221406 * x2w_j_221416;\n            double x4w_j_221418 = defunc_0_f_res_221406 * x3w_j_221417;\n            double defunc_1_op_res_221384 = w_j_221414 + redout_228488;\n            double defunc_1_op_res_221387 = xw_j_221415 + redout_228489;\n            double defunc_1_op_res_221390 = x2w_j_221416 + redout_228490;\n            double defunc_1_op_res_221393 = x3w_j_221417 + redout_228491;\n            double defunc_1_op_res_221396 = x4w_j_221418 + redout_228492;\n            double redout_tmp_235371 = defunc_1_op_res_221384;\n            double redout_tmp_235372 = defunc_1_op_res_221387;\n            double redout_tmp_235373 = defunc_1_op_res_221390;\n            double redout_tmp_235374 = defunc_1_op_res_221393;\n            double redout_tmp_235375 = defunc_1_op_res_221396;\n            \n            redout_228488 = redout_tmp_235371;\n            redout_228489 = redout_tmp_235372;\n            redout_228490 = redout_",
            "tmp_235373;\n            redout_228491 = redout_tmp_235374;\n            redout_228492 = redout_tmp_235375;\n        }\n        defunc_2_reduce_res_221377 = redout_228488;\n        defunc_2_reduce_res_221378 = redout_228489;\n        defunc_2_reduce_res_221379 = redout_228490;\n        defunc_2_reduce_res_221380 = redout_228491;\n        defunc_2_reduce_res_221381 = redout_228492;\n        \n        double x_221419 = defunc_2_reduce_res_221379 *\n               defunc_2_reduce_res_221381;\n        double y_221420 = defunc_2_reduce_res_221380 *\n               defunc_2_reduce_res_221380;\n        double a12_221421 = x_221419 - y_221420;\n        double x_221422 = defunc_2_reduce_res_221379 *\n               defunc_2_reduce_res_221380;\n        double y_221423 = defunc_2_reduce_res_221378 *\n               defunc_2_reduce_res_221381;\n        double b12_221424 = x_221422 - y_221423;\n        double x_221425 = defunc_2_reduce_res_221378 *\n               defunc_2_reduce_res_221380;\n        double y_221426 = defunc_2_reduce_res_221379 *\n               defunc_2_reduce_res_221379;\n        double c12_221427 = x_221425 - y_221426;\n        double x_221428 = defunc_2_reduce_res_221377 *\n               defunc_2_reduce_res_221381;\n        double b2_221429 = x_221428 - y_221426;\n        double x_221430 = defunc_2_reduce_res_221378 *\n               defunc_2_reduce_res_221379;\n        double y_221431 = defunc_2_reduce_res_221377 *\n               defunc_2_reduce_res_221380;\n        double c2_221432 = x_221430 - y_221431;\n        double x_221433 = defunc_2_reduce_res_221377 * a12_221421;\n        double y_221434 = defunc_2_reduce_res_221378 * b12_221424;\n        double x_221435 = x_221433 + y_221434;\n        double y_221436 = defunc_2_reduce_res_221379 * c12_221427;\n        double y_221437 = x_221435 + y_221436;\n        double det_221438 = 1.0 / y_221437;\n        double a12_221439 = a12_221421 * det_221438;\n        double b12_221440 = b12_221424 * det_221438;\n        double c12_221441 = c12_221427 * det_",
            "221438;\n        double b2_221442 = b2_221429 * det_221438;\n        double c2_221443 = c2_221432 * det_221438;\n        double defunc_2_reduce_res_221444;\n        double defunc_2_reduce_res_221445;\n        double redout_228494;\n        double redout_228495;\n        \n        redout_228494 = 0.0;\n        redout_228495 = 0.0;\n        for (int64_t i_228496 = 0; i_228496 < q_l_203577; i_228496++) {\n            bool cond_221453 = sle64(n_203572, i_228496);\n            int64_t defunc_0_f_res_221454;\n            \n            if (cond_221453) {\n                defunc_0_f_res_221454 = (int64_t) 0;\n            } else {\n                int64_t i_221455 = add64(x_221372, i_228496);\n                int64_t defunc_1_add_res_221456 = add64((int64_t) 1, i_221455);\n                \n                defunc_0_f_res_221454 = defunc_1_add_res_221456;\n            }\n            \n            double defunc_0_f_res_221457;\n            \n            if (cond_221453) {\n                defunc_0_f_res_221457 = 0.0;\n            } else {\n                int64_t i_221458 = add64(x_221372, i_228496);\n                double defunc_0_add_arg_221459;\n                \n                defunc_0_add_arg_221459 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_221366 *\n                                                                         ctx_param_ext_229597 +\n                                                                         i_221458 *\n                                                                         ctx_param_ext_229599)];\n                defunc_0_f_res_221457 = defunc_0_add_arg_221459;\n            }\n            \n            int64_t binop_p_221460 = sub64(defunc_0_f_res_221454,\n                                           defunc_0_g_res_221376);\n            double defunc_0_f_res_221461 = sitofp_i64_f64(binop_p_221460);\n            double abs_res_221462 = fabs(def",
            "unc_0_f_res_221461);\n            double tmp1_221463 = abs_res_221462 / x_221373;\n            double x_221464 = tmp1_221463 * tmp1_221463;\n            double y_221465 = tmp1_221463 * x_221464;\n            double tmp2_221466 = 1.0 - y_221465;\n            double x_221467 = tmp2_221466 * tmp2_221466;\n            double tmp3_221468 = tmp2_221466 * x_221467;\n            double tmp4_221469 = defunc_0_f_res_221457 * tmp3_221468;\n            double defunc_1_f_res_221470 = defunc_0_f_res_221461 * tmp4_221469;\n            double defunc_1_f_res_221471 = defunc_0_f_res_221461 *\n                   defunc_1_f_res_221470;\n            double defunc_0_f_res_221472;\n            \n            if (cond_221453) {\n                defunc_0_f_res_221472 = 0.0;\n            } else {\n                int64_t i_221473 = add64(x_221372, i_228496);\n                double defunc_0_add_arg_221474;\n                \n                defunc_0_add_arg_221474 = ((__global\n                                            double *) mem_230659)[gtid_221366 *\n                                                                  n_203572 +\n                                                                  i_221473];\n                defunc_0_f_res_221472 = defunc_0_add_arg_221474;\n            }\n            \n            double x_221475 = a12_221439 * tmp4_221469;\n            double y_221476 = b12_221440 * defunc_1_f_res_221470;\n            double x_221477 = x_221475 + y_221476;\n            double y_221478 = c12_221441 * defunc_1_f_res_221471;\n            double x_221479 = x_221477 + y_221478;\n            double defunc_9_fit_fun_res_221480 = defunc_0_f_res_221472 *\n                   x_221479;\n            double x_221481 = b12_221440 * tmp4_221469;\n            double y_221482 = b2_221442 * defunc_1_f_res_221470;\n            double x_221483 = x_221481 + y_221482;\n            double y_221484 = c2_221443 * defunc_1_f_res_221471;\n            double x_221485 = x_221483 + y_221484;\n            double defunc_9_slope_fun_res_221486",
            " = defunc_0_f_res_221472 *\n                   x_221485;\n            double defunc_1_op_res_221448 = defunc_9_fit_fun_res_221480 +\n                   redout_228494;\n            double defunc_1_op_res_221451 = defunc_9_slope_fun_res_221486 +\n                   redout_228495;\n            double redout_tmp_235376 = defunc_1_op_res_221448;\n            double redout_tmp_235377 = defunc_1_op_res_221451;\n            \n            redout_228494 = redout_tmp_235376;\n            redout_228495 = redout_tmp_235377;\n        }\n        defunc_2_reduce_res_221444 = redout_228494;\n        defunc_2_reduce_res_221445 = redout_228495;\n        ((__global double *) mem_230882)[gtid_221366 * l_n_m_203733 +\n                                         gtid_221367] =\n            defunc_2_reduce_res_221444;\n        ((__global double *) mem_230886)[gtid_221366 * l_n_m_203733 +\n                                         gtid_221367] =\n            defunc_2_reduce_res_221445;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221357\n}\n__kernel void mainzisegmap_221569(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, __global\n                                  unsigned char *mem_230891, __global\n                                  unsigned char *mem_230895, __global\n                                  unsigned char *mem_230899, __global\n                                  unsigned char *mem_230903, __global\n                                  unsigned char *mem_230907, __global\n                                  unsigned char *mem_230912, __global\n                                  unsigned char *mem_230916, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_230924, __global\n                                  unsigned char *mem_230928)\n{\n    #define segmap_group_sizze_221560 (mainzisegmap_group_sizze_221058)\n    \n    const",
            " int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235506;\n    int32_t local_tid_235507;\n    int64_t group_sizze_235510;\n    int32_t wave_sizze_235509;\n    int32_t group_tid_235508;\n    \n    global_tid_235506 = get_global_id(0);\n    local_tid_235507 = get_local_id(0);\n    group_sizze_235510 = get_local_size(0);\n    wave_sizze_235509 = LOCKSTEP_WIDTH;\n    group_tid_235508 = get_group_id(0);\n    \n    int32_t phys_tid_221569 = global_tid_235506;\n    int64_t global_tid_235511 = sext_i32_i64(group_tid_235508) *\n            segmap_group_sizze_221560 + sext_i32_i64(local_tid_235507);\n    int64_t slice_235512 = l_n_m_203733;\n    int64_t slice_235513 = partition_sizze_203667 * slice_235512;\n    int64_t gtid_221567 = squot64(global_tid_235511, slice_235512);\n    int64_t remnant_235514 = global_tid_235511 - gtid_221567 * slice_235512;\n    int64_t gtid_221568 = remnant_235514;\n    int64_t remnant_235515 = remnant_235514 - gtid_221568;\n    \n    if (slt64(gtid_221567, partition_sizze_203667) && slt64(gtid_221568,\n                                                            l_n_m_203733)) {\n        double defunc_2_reduce_res_221570;\n        \n        defunc_2_reduce_res_221570 = ((__global\n                                       double *) mem_230891)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221571;\n        \n        defunc_2_reduce_res_221571 = ((__global\n                                       double *) mem_230895)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221572;\n        \n        defunc_2_reduce_res_221572 = ((__global\n                             ",
            "          double *) mem_230899)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221573;\n        \n        defunc_2_reduce_res_221573 = ((__global\n                                       double *) mem_230903)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double defunc_2_reduce_res_221574;\n        \n        defunc_2_reduce_res_221574 = ((__global\n                                       double *) mem_230907)[gtid_221567 *\n                                                             l_n_m_203733 +\n                                                             gtid_221568];\n        \n        double x_221575 = defunc_2_reduce_res_221572 *\n               defunc_2_reduce_res_221574;\n        double y_221576 = defunc_2_reduce_res_221573 *\n               defunc_2_reduce_res_221573;\n        double a12_221577 = x_221575 - y_221576;\n        double x_221578 = defunc_2_reduce_res_221572 *\n               defunc_2_reduce_res_221573;\n        double y_221579 = defunc_2_reduce_res_221571 *\n               defunc_2_reduce_res_221574;\n        double b12_221580 = x_221578 - y_221579;\n        double x_221581 = defunc_2_reduce_res_221571 *\n               defunc_2_reduce_res_221573;\n        double y_221582 = defunc_2_reduce_res_221572 *\n               defunc_2_reduce_res_221572;\n        double c12_221583 = x_221581 - y_221582;\n        double x_221584 = defunc_2_reduce_res_221570 *\n               defunc_2_reduce_res_221574;\n        double b2_221585 = x_221584 - y_221582;\n        double x_221586 = defunc_2_reduce_res_221571 *\n               defunc_2_reduce_res_221572;\n        double y_221587 = defunc_2_reduce_res_221570 *\n               defunc_2_reduce_res_221573;\n        double c2_221588 = x_221586 - y_221587;",
            "\n        double x_221589 = defunc_2_reduce_res_221570 * a12_221577;\n        double y_221590 = defunc_2_reduce_res_221571 * b12_221580;\n        double x_221591 = x_221589 + y_221590;\n        double y_221592 = defunc_2_reduce_res_221572 * c12_221583;\n        double y_221593 = x_221591 + y_221592;\n        double det_221594 = 1.0 / y_221593;\n        double a12_221595 = a12_221577 * det_221594;\n        double b12_221596 = b12_221580 * det_221594;\n        double c12_221597 = c12_221583 * det_221594;\n        double b2_221598 = b2_221585 * det_221594;\n        double c2_221599 = c2_221588 * det_221594;\n        \n        ((__global double *) mem_230912)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = a12_221595;\n        ((__global double *) mem_230916)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = b12_221596;\n        ((__global double *) mem_230920)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = c12_221597;\n        ((__global double *) mem_230924)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = b2_221598;\n        ((__global double *) mem_230928)[gtid_221567 * l_n_m_203733 +\n                                         gtid_221568] = c2_221599;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221560\n}\n__kernel void mainzisegmap_222439(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_l_203583,\n                                  int64_t partition_sizze_203667,\n                                  int64_t l_n_m_203733, int64_t i_203760,\n                                  int64_t y_205876, __global\n                                  unsigned char *ext_mem_231015, __global\n                                  unsigned char *ext_mem_231016, __global\n        ",
            "                          unsigned char *mem_231021)\n{\n    #define segmap_group_sizze_222434 (mainzisegmap_group_sizze_222316)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235680;\n    int32_t local_tid_235681;\n    int64_t group_sizze_235684;\n    int32_t wave_sizze_235683;\n    int32_t group_tid_235682;\n    \n    global_tid_235680 = get_global_id(0);\n    local_tid_235681 = get_local_id(0);\n    group_sizze_235684 = get_local_size(0);\n    wave_sizze_235683 = LOCKSTEP_WIDTH;\n    group_tid_235682 = get_group_id(0);\n    \n    int32_t phys_tid_222439 = global_tid_235680;\n    int64_t global_tid_235685 = sext_i32_i64(group_tid_235682) *\n            segmap_group_sizze_222434 + sext_i32_i64(local_tid_235681);\n    int64_t slice_235686 = n_203572;\n    int64_t slice_235687 = partition_sizze_203667 * slice_235686;\n    int64_t gtid_222437 = squot64(global_tid_235685, slice_235686);\n    int64_t remnant_235688 = global_tid_235685 - gtid_222437 * slice_235686;\n    int64_t gtid_222438 = remnant_235688;\n    int64_t remnant_235689 = remnant_235688 - gtid_222438;\n    \n    if (slt64(gtid_222437, partition_sizze_203667) && slt64(gtid_222438,\n                                                            n_203572)) {\n        int64_t m_v_222443 = sdiv64(gtid_222438, jump_l_203583);\n        bool cond_222444 = m_v_222443 == y_205876;\n        int64_t j_222445;\n        \n        if (cond_222444) {\n            int64_t j_t_res_222446 = sub64(m_v_222443, (int64_t) 1);\n            \n            j_222445 = j_t_res_222446;\n        } else {\n            j_222445 = m_v_222443;\n        }\n        \n        int64_t min_arg_222447 = mul64(jump_l_203583, j_222445);\n        int64_t min_res_222448 = smin64(i_203760, min_arg_222447);\n        int64_t defunc_0_m_fun_arg_222449 = add64((int64_t) 1, j_222445);\n        int64_t min_arg_222450 = mul64(jump_l_203583,\n                                    ",
            "   defunc_0_m_fun_arg_222449);\n        int64_t min_res_222451 = smin64(i_203760, min_arg_222450);\n        int64_t i64_arg_222452 = sub64(min_res_222451, min_res_222448);\n        double i64_res_222453 = sitofp_i64_f64(i64_arg_222452);\n        int64_t i64_arg_222454 = sub64(gtid_222438, min_res_222448);\n        double i64_res_222455 = sitofp_i64_f64(i64_arg_222454);\n        double u_222456 = i64_res_222455 / i64_res_222453;\n        double u2_222457 = u_222456 * u_222456;\n        double u3_222458 = u_222456 * u2_222457;\n        double x_222459 = 2.0 * u3_222458;\n        double y_222460 = 3.0 * u2_222457;\n        double x_222461 = x_222459 - y_222460;\n        double x_222462 = 1.0 + x_222461;\n        bool x_222463 = sle64((int64_t) 0, j_222445);\n        bool y_222464 = slt64(j_222445, l_n_m_203733);\n        bool bounds_check_222465 = x_222463 && y_222464;\n        bool index_certs_222466;\n        \n        if (!bounds_check_222465) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 50) == -1) {\n                    global_failure_args[0] = (int64_t) j_222445;\n                    global_failure_args[1] = (int64_t) l_n_m_203733;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222467;\n        \n        y_222467 = ((__global double *) ext_mem_231016)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        j_222445];\n        \n        double x_222468 = x_222462 * y_222467;\n        double x_222469 = y_222460 - x_222459;\n        bool x_222470 = sle64((int64_t) 0, defunc_0_m_fun_arg_222449);\n        bool y_222471 = slt64(defunc_0_m_fun_arg_222449, l_n_m_203733);\n        bool bounds_check_222472 = x_222470 && y_222471;\n        bool index_certs_222473;\n        \n        if (!bounds_check_222472) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 51) == -1) {\n                  ",
            "  global_failure_args[0] =\n                        (int64_t) defunc_0_m_fun_arg_222449;\n                    global_failure_args[1] = (int64_t) l_n_m_203733;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222474;\n        \n        y_222474 = ((__global double *) ext_mem_231016)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        defunc_0_m_fun_arg_222449];\n        \n        double y_222475 = x_222469 * y_222474;\n        double x_222476 = x_222468 + y_222475;\n        double y_222477 = 2.0 * u2_222457;\n        double x_222478 = u3_222458 - y_222477;\n        double x_222479 = u_222456 + x_222478;\n        double y_222480;\n        \n        y_222480 = ((__global double *) ext_mem_231015)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        j_222445];\n        \n        double x_222481 = x_222479 * y_222480;\n        double y_222482 = i64_res_222453 * x_222481;\n        double x_222483 = x_222476 + y_222482;\n        double x_222484 = u3_222458 - u2_222457;\n        double y_222485;\n        \n        y_222485 = ((__global double *) ext_mem_231015)[gtid_222437 *\n                                                        l_n_m_203733 +\n                                                        defunc_0_m_fun_arg_222449];\n        \n        double x_222486 = x_222484 * y_222485;\n        double y_222487 = i64_res_222453 * x_222486;\n        double defunc_4_interpolate_proc_res_222488 = x_222483 + y_222487;\n        \n        ((__global double *) mem_231021)[gtid_222437 * n_203572 + gtid_222438] =\n            defunc_4_interpolate_proc_res_222488;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222434\n}\n__kernel void mainzisegmap_222534(__global int *global_failure,\n                                  int64_t n_203572, int64_t n_p_203574,\n       ",
            "                           int64_t partition_sizze_203667,\n                                  int64_t C_len_203724, int64_t ext_231023,\n                                  __global unsigned char *mem_230608, __global\n                                  unsigned char *ext_mem_231022, __global\n                                  unsigned char *mem_231028)\n{\n    #define segmap_group_sizze_222529 (mainzisegmap_group_sizze_222503)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235690;\n    int32_t local_tid_235691;\n    int64_t group_sizze_235694;\n    int32_t wave_sizze_235693;\n    int32_t group_tid_235692;\n    \n    global_tid_235690 = get_global_id(0);\n    local_tid_235691 = get_local_id(0);\n    group_sizze_235694 = get_local_size(0);\n    wave_sizze_235693 = LOCKSTEP_WIDTH;\n    group_tid_235692 = get_group_id(0);\n    \n    int32_t phys_tid_222534 = global_tid_235690;\n    int64_t global_tid_235695 = sext_i32_i64(group_tid_235692) *\n            segmap_group_sizze_222529 + sext_i32_i64(local_tid_235691);\n    int64_t slice_235696 = n_203572;\n    int64_t slice_235697 = partition_sizze_203667 * slice_235696;\n    int64_t gtid_222532 = squot64(global_tid_235695, slice_235696);\n    int64_t remnant_235698 = global_tid_235695 - gtid_222532 * slice_235696;\n    int64_t gtid_222533 = remnant_235698;\n    int64_t remnant_235699 = remnant_235698 - gtid_222533;\n    \n    if (slt64(gtid_222532, partition_sizze_203667) && slt64(gtid_222533,\n                                                            n_203572)) {\n        int64_t slice_228418 = n_p_203574 + gtid_222533;\n        double x_222535;\n        \n        x_222535 = ((__global double *) mem_230608)[gtid_222532 * C_len_203724 +\n                                                    slice_228418];\n        \n        double x_222536;\n        \n        x_222536 = ((__global double *) ext_mem_231022)[gtid_222532 *\n                  ",
            "                                      ext_231023 +\n                                                        gtid_222533];\n        \n        double defunc_1_f_res_222537 = x_222535 - x_222536;\n        \n        ((__global double *) mem_231028)[gtid_222532 * n_203572 + gtid_222533] =\n            defunc_1_f_res_222537;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222529\n}\n__kernel void mainzisegmap_222641(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t num_groups_222637,\n                                  int64_t num_threads_232294, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_229304, __global\n                                  unsigned char *mem_231035, __global\n                                  unsigned char *mem_231038, __global\n                                  unsigned char *mem_231041, __global\n                                  unsigned char *mem_231044, __global\n                                  unsigned char *mem_231047, __global\n                                  unsigned char *mem_231111, __global\n                                  unsigned char *color_232151, __global\n                                  unsigned char *color_232152, __global\n                                  unsigned char *color_232153)\n{\n    #define segmap_group_sizze_222636 (mainzisegmap_group_sizze_222544)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option",
            ") {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_235715;\n    int32_t local_tid_235716;\n    int64_t group_sizze_235719;\n    int32_t wave_sizze_235718;\n    int32_t group_tid_235717;\n    \n    global_tid_235715 = get_global_id(0);\n    local_tid_235716 = get_local_id(0);\n    group_sizze_235719 = get_local_size(0);\n    wave_sizze_235718 = LOCKSTEP_WIDTH;\n    group_tid_235717 = get_group_id(0);\n    \n    int32_t phys_tid_222641 = global_tid_235715;\n    int32_t phys_group_id_235720;\n    \n    phys_group_id_235720 = get_group_id(0);\n    for (int32_t i_235721 = 0; i_235721 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_222636)) -\n                   phys_group_id_235720, sext_i64_i32(num_groups_222637));\n         i_235721++) {\n        int32_t virt_group_id_235722 = phys_group_id_235720 + i_235721 *\n                sext_i64_i32(num_groups_222637);\n        int64_t global_tid_235723 = sext_i32_i64(virt_group_id_235722) *\n                segmap_group_sizze_222636 + sext_i32_i64(local_tid_235716);\n        int64_t slice_235724 = partition_sizze_203667;\n        int64_t gtid_222640 = global_tid_235723;\n        int64_t remnant_235725 = global_tid_235723 - gtid_222640;\n        \n        if (slt64(gtid_222640, partition_sizze_203667)) {\n            int64_t x_222646;\n            \n            x_222646 = ((__global int64_t *) ext_mem_229304)[gtid_222640];\n            for (int64_t i_229097 = 0; i_229097 < n_203572; i_229097++) {\n                double x_222650;\n                \n                x_222650 = ((__global double *) mem_229269)[gtid_222640 *\n                                                            n_203572 +\n                                                            i_229097];\n                \n                double x_222651;\n                \n                x_2",
            "22651 = ((__global double *) mem_231035)[i_229097 *\n                                                            partition_sizze_203667 +\n                                                            gtid_222640];\n                \n                double defunc_1_f_res_222652 = x_222650 - x_222651;\n                \n                ((__global double *) color_232151)[phys_tid_222641 + i_229097 *\n                                                   num_threads_232294] =\n                    defunc_1_f_res_222652;\n            }\n            for (int64_t i_229103 = 0; i_229103 < n_203572; i_229103++) {\n                int64_t x_222655;\n                \n                x_222655 = ((__global int64_t *) mem_231038)[i_229103 *\n                                                             partition_sizze_203667 +\n                                                             gtid_222640];\n                \n                bool cond_222656 = sle64((int64_t) 0, x_222655);\n                double defunc_0_f_res_222657;\n                \n                if (cond_222656) {\n                    bool y_222658 = slt64(x_222655, n_203572);\n                    bool bounds_check_222659 = cond_222656 && y_222658;\n                    bool index_certs_222660;\n                    \n                    if (!bounds_check_222659) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          52) == -1) {\n                                global_failure_args[0] = (int64_t) x_222655;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222661;\n                    \n                    defunc_0_f_res_t_res_222661 = ((__globa",
            "l\n                                                    double *) color_232151)[phys_tid_222641 +\n                                                                            x_222655 *\n                                                                            num_threads_232294];\n                    defunc_0_f_res_222657 = defunc_0_f_res_t_res_222661;\n                } else {\n                    defunc_0_f_res_222657 = 0.0;\n                }\n                \n                double defunc_0_f_res_222662;\n                \n                if (cond_222656) {\n                    bool y_222663 = slt64(x_222655, n_203572);\n                    bool bounds_check_222664 = cond_222656 && y_222663;\n                    bool index_certs_222665;\n                    \n                    if (!bounds_check_222664) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          53) == -1) {\n                                global_failure_args[0] = (int64_t) x_222655;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222666;\n                    \n                    defunc_0_f_res_t_res_222666 = ((__global\n                                                    double *) mem_231047)[x_222655 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_222640];\n                    defunc_0_f_res_222662 = defunc_0_f_res_t_res_222666;\n                } else {\n                    defunc_0_f_res_222662 = 0.0;\n                }\n                ((__global double *) color_232153)[phys_tid_22",
            "2641 + i_229103 *\n                                                   num_threads_232294] =\n                    defunc_0_f_res_222662;\n                ((__global double *) color_232152)[phys_tid_222641 + i_229103 *\n                                                   num_threads_232294] =\n                    defunc_0_f_res_222657;\n            }\n            for (int64_t i_229108 = 0; i_229108 < t_n_m_203740; i_229108++) {\n                int64_t x_222669;\n                \n                x_222669 = ((__global int64_t *) mem_231041)[i_229108 *\n                                                             partition_sizze_203667 +\n                                                             gtid_222640];\n                \n                double x_222670;\n                \n                x_222670 = ((__global double *) mem_231044)[i_229108 *\n                                                            partition_sizze_203667 +\n                                                            gtid_222640];\n                \n                int64_t min_arg_222671 = mul64(jump_t_203582, i_229108);\n                int64_t min_res_222672 = smin64(i_203760, min_arg_222671);\n                int64_t defunc_0_g_res_222673 = add64((int64_t) 1,\n                                                      min_res_222672);\n                double defunc_2_reduce_res_222674;\n                double redout_228312 = 0.0;\n                \n                for (int64_t i_228313 = 0; i_228313 < q_t_203576; i_228313++) {\n                    bool cond_222679 = sle64(x_222646, i_228313);\n                    int64_t defunc_0_f_res_222680;\n                    \n                    if (cond_222679) {\n                        defunc_0_f_res_222680 = (int64_t) 0;\n                    } else {\n                        int64_t i_222681 = add64(x_222669, i_228313);\n                        int64_t defunc_0_add_arg_222682;\n                        \n                        defunc_0_add_arg_222682 = ((__global\n                      ",
            "                              int64_t *) mem_231038)[i_222681 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_222640];\n                        \n                        int64_t defunc_1_add_res_222683 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222682);\n                        \n                        defunc_0_f_res_222680 = defunc_1_add_res_222683;\n                    }\n                    \n                    double defunc_0_f_res_222684;\n                    \n                    if (cond_222679) {\n                        defunc_0_f_res_222684 = 0.0;\n                    } else {\n                        int64_t i_222685 = add64(x_222669, i_228313);\n                        double defunc_0_add_arg_222686;\n                        \n                        defunc_0_add_arg_222686 = ((__global\n                                                    double *) color_232153)[phys_tid_222641 +\n                                                                            i_222685 *\n                                                                            num_threads_232294];\n                        defunc_0_f_res_222684 = defunc_0_add_arg_222686;\n                    }\n                    \n                    int64_t binop_p_222687 = sub64(defunc_0_f_res_222680,\n                                                   defunc_0_g_res_222673);\n                    double defunc_0_f_res_222688 =\n                           sitofp_i64_f64(binop_p_222687);\n                    double abs_res_222689 = fabs(defunc_0_f_res_222688);\n                    double tmp1_222690 = abs_res_222689 / x_222670;\n                    double x_222691 = tmp1_222690 * tmp1_222690;\n                    double y_222692 = tmp1_222690 * x_222691;\n                    double tmp2_222693 = 1.0 - y_222692;\n                    double x_222",
            "694 = tmp2_222693 * tmp2_222693;\n                    double tmp3_222695 = tmp2_222693 * x_222694;\n                    double w_j_222696 = defunc_0_f_res_222684 * tmp3_222695;\n                    double defunc_1_op_res_222677 = w_j_222696 + redout_228312;\n                    double redout_tmp_235730 = defunc_1_op_res_222677;\n                    \n                    redout_228312 = redout_tmp_235730;\n                }\n                defunc_2_reduce_res_222674 = redout_228312;\n                \n                double a0_222697 = 1.0 / defunc_2_reduce_res_222674;\n                double defunc_2_reduce_res_222698;\n                double redout_228314 = 0.0;\n                \n                for (int64_t i_228315 = 0; i_228315 < q_t_203576; i_228315++) {\n                    bool cond_222703 = sle64(x_222646, i_228315);\n                    int64_t defunc_0_f_res_222704;\n                    \n                    if (cond_222703) {\n                        defunc_0_f_res_222704 = (int64_t) 0;\n                    } else {\n                        int64_t i_222705 = add64(x_222669, i_228315);\n                        int64_t defunc_0_add_arg_222706;\n                        \n                        defunc_0_add_arg_222706 = ((__global\n                                                    int64_t *) mem_231038)[i_222705 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_222640];\n                        \n                        int64_t defunc_1_add_res_222707 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222706);\n                        \n                        defunc_0_f_res_222704 = defunc_1_add_res_222707;\n                    }\n                    \n                    double defunc_0_f_res_222708;\n                    \n                    if (cond_222703) {\n                        defunc_0_f_res_22270",
            "8 = 0.0;\n                    } else {\n                        int64_t i_222709 = add64(x_222669, i_228315);\n                        double defunc_0_add_arg_222710;\n                        \n                        defunc_0_add_arg_222710 = ((__global\n                                                    double *) color_232153)[phys_tid_222641 +\n                                                                            i_222709 *\n                                                                            num_threads_232294];\n                        defunc_0_f_res_222708 = defunc_0_add_arg_222710;\n                    }\n                    \n                    int64_t binop_p_222711 = sub64(defunc_0_f_res_222704,\n                                                   defunc_0_g_res_222673);\n                    double defunc_0_f_res_222712 =\n                           sitofp_i64_f64(binop_p_222711);\n                    double abs_res_222713 = fabs(defunc_0_f_res_222712);\n                    double tmp1_222714 = abs_res_222713 / x_222670;\n                    double x_222715 = tmp1_222714 * tmp1_222714;\n                    double y_222716 = tmp1_222714 * x_222715;\n                    double tmp2_222717 = 1.0 - y_222716;\n                    double x_222718 = tmp2_222717 * tmp2_222717;\n                    double tmp3_222719 = tmp2_222717 * x_222718;\n                    double tmp4_222720 = defunc_0_f_res_222708 * tmp3_222719;\n                    double defunc_0_f_res_222721;\n                    \n                    if (cond_222703) {\n                        defunc_0_f_res_222721 = 0.0;\n                    } else {\n                        int64_t i_222722 = add64(x_222669, i_228315);\n                        double defunc_0_add_arg_222723;\n                        \n                        defunc_0_add_arg_222723 = ((__global\n                                                    double *) color_232152)[phys_tid_222641 +\n                                                                  ",
            "          i_222722 *\n                                                                            num_threads_232294];\n                        defunc_0_f_res_222721 = defunc_0_add_arg_222723;\n                    }\n                    \n                    double x_222724 = a0_222697 * tmp4_222720;\n                    double defunc_9_fit_fun_res_222725 = defunc_0_f_res_222721 *\n                           x_222724;\n                    double defunc_1_op_res_222701 =\n                           defunc_9_fit_fun_res_222725 + redout_228314;\n                    double redout_tmp_235731 = defunc_1_op_res_222701;\n                    \n                    redout_228314 = redout_tmp_235731;\n                }\n                defunc_2_reduce_res_222698 = redout_228314;\n                ((__global double *) color_232151)[phys_tid_222641 + i_229108 *\n                                                   num_threads_232294] =\n                    defunc_2_reduce_res_222698;\n            }\n            for (int64_t i_235732 = 0; i_235732 < t_n_m_203740; i_235732++) {\n                double tmp_235733;\n                \n                tmp_235733 = ((__global\n                               double *) color_232151)[phys_tid_222641 +\n                                                       i_235732 *\n                                                       num_threads_232294];\n                ((__global double *) mem_231111)[gtid_222640 + i_235732 *\n                                                 partition_sizze_203667] =\n                    tmp_235733;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222636\n}\n__kernel void mainzisegmap_223157(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  un",
            "signed char *mem_231028, __global\n                                  unsigned char *mem_231116)\n{\n    #define segmap_group_sizze_223152 (mainzisegmap_group_sizze_223126)\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_235734;\n    int32_t local_tid_235735;\n    int64_t group_sizze_235738;\n    int32_t wave_sizze_235737;\n    int32_t group_tid_235736;\n    \n    global_tid_235734 = get_global_id(0);\n    local_tid_235735 = get_local_id(0);\n    group_sizze_235738 = get_local_size(0);\n    wave_sizze_235737 = LOCKSTEP_WIDTH;\n    group_tid_235736 = get_group_id(0);\n    \n    int32_t phys_tid_223157 = global_tid_235734;\n    int64_t global_tid_235739 = sext_i32_i64(group_tid_235736) *\n            segmap_group_sizze_223152 + sext_i32_i64(local_tid_235735);\n    int64_t slice_235740 = n_203572;\n    int64_t slice_235741 = partition_sizze_203667 * slice_235740;\n    int64_t gtid_223155 = squot64(global_tid_235739, slice_235740);\n    int64_t remnant_235742 = global_tid_235739 - gtid_223155 * slice_235740;\n    int64_t gtid_223156 = remnant_235742;\n    int64_t remnant_235743 = remnant_235742 - gtid_223156;\n    \n    if (slt64(gtid_223155, partition_sizze_203667) && slt64(gtid_223156,\n                                                            n_203572)) {\n        double x_223158;\n        \n        x_223158 = ((__global double *) mem_229269)[gtid_223155 * n_203572 +\n                                                    gtid_223156];\n        \n        double x_223159;\n        \n        x_223159 = ((__global double *) mem_231028)[gtid_223155 * n_203572 +\n                                                    gtid_223156];\n        \n        double defunc_1_f_res_223160 = x_223158 - x_223159;\n        \n        ((__global double *) mem_231116)[gtid_223155 * n_203572 + gtid_223156] =\n            defunc_1_f_res_223160;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223",
            "152\n}\n__kernel void mainzisegmap_223174(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231116, __global\n                                  unsigned char *mem_231121, __global\n                                  unsigned char *mem_231125)\n{\n    #define segmap_group_sizze_223168 (mainzisegmap_group_sizze_223070)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235744;\n    int32_t local_tid_235745;\n    int64_t group_sizze_235748;\n    int32_t wave_sizze_235747;\n    int32_t group_tid_235746;\n    \n    global_tid_235744 = get_global_id(0);\n    local_tid_235745 = get_local_id(0);\n    group_sizze_235748 = get_local_size(0);\n    wave_sizze_235747 = LOCKSTEP_WIDTH;\n    group_tid_235746 = get_group_id(0);\n    \n    int32_t phys_tid_223174 = global_tid_235744;\n    int64_t global_tid_235749 = sext_i32_i64(group_tid_235746) *\n            segmap_group_sizze_223168 + sext_i32_i64(local_tid_235745);\n    int64_t slice_235750 = n_203572;\n    int64_t slice_235751 = partition_sizze_203667 * slice_235750;\n    int64_t gtid_223172 = squot64(global_tid_235749, slice_235750);\n    int64_t remnant_235752 = global_tid_235749 - gtid_223172 * slice_235750;\n    int64_t gtid_223173 = remnant_235752;\n    int64_t remnant_235753 = remnant_235752 - gtid_22317",
            "3;\n    \n    if (slt64(gtid_223172, partition_sizze_203667) && slt64(gtid_223173,\n                                                            n_203572)) {\n        int64_t x_223177;\n        \n        x_223177 = ((__global int64_t *) ext_mem_229305)[gtid_223172 *\n                                                         n_203572 +\n                                                         gtid_223173];\n        \n        bool cond_223178 = sle64((int64_t) 0, x_223177);\n        double defunc_0_f_res_223179;\n        \n        if (cond_223178) {\n            bool y_223180 = slt64(x_223177, n_203572);\n            bool bounds_check_223181 = cond_223178 && y_223180;\n            bool index_certs_223182;\n            \n            if (!bounds_check_223181) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 54) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_223177;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223183;\n            \n            defunc_0_f_res_t_res_223183 = ((__global\n                                            double *) mem_231116)[gtid_223172 *\n                                                                  n_203572 +\n                                                                  x_223177];\n            defunc_0_f_res_223179 = defunc_0_f_res_t_res_223183;\n        } else {\n            defunc_0_f_res_223179 = 0.0;\n        }\n        \n        double defunc_0_f_res_223184;\n        \n        if (cond_223178) {\n            bool y_223185 = slt64(x_223177, n_203572);\n            bool bounds_check_223186 = cond_223178 && y_223185;\n            bool index_certs_223187;\n            \n            if (!bounds_check_223186) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 55) ==\n",
            "                        -1) {\n                        global_failure_args[0] = (int64_t) x_223177;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223188;\n            \n            defunc_0_f_res_t_res_223188 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_223172 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_223177 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_223184 = defunc_0_f_res_t_res_223188;\n        } else {\n            defunc_0_f_res_223184 = 0.0;\n        }\n        ((__global double *) mem_231121)[gtid_223172 * n_203572 + gtid_223173] =\n            defunc_0_f_res_223184;\n        ((__global double *) mem_231125)[gtid_223172 * n_203572 + gtid_223173] =\n            defunc_0_f_res_223179;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223168\n}\n__kernel void mainzisegmap_223202(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *ext_mem_229305,\n                                  __global unsigned char *ext_mem_229568,\n                                  __global unsigned char *ext_mem_229569,\n                                  __global unsigned char *mem_231121, _",
            "_global\n                                  unsigned char *mem_231125, __global\n                                  unsigned char *mem_231130)\n{\n    #define segmap_group_sizze_223193 (mainzisegmap_group_sizze_222733)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_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_223202 = global_tid_235754;\n    int64_t global_tid_235759 = sext_i32_i64(group_tid_235756) *\n            segmap_group_sizze_223193 + sext_i32_i64(local_tid_235755);\n    int64_t slice_235760 = t_n_m_203740;\n    int64_t slice_235761 = partition_sizze_203667 * slice_235760;\n    int64_t gtid_223200 = squot64(global_tid_235759, slice_235760);\n    int64_t remnant_235762 = global_tid_235759 - gtid_223200 * slice_235760;\n    int64_t gtid_223201 = remnant_235762;\n    int64_t remnant_235763 = remnant_235762 - gtid_223201;\n    \n    if (slt64(gtid_223200, partition_sizze_203667) && slt64(gtid_223201,\n                                                            t_n_m_203740)) {\n        int64_t x_223204;\n        \n        x_223204 = ((__global int64_t *) ext_mem_229304)[gtid_223200];\n        \n        int64_t x_223208;\n        \n        x_223208 = ((__global int64_t *) ext_mem_229569)[gtid_223200 *\n                                                         t_n_m_203740 +\n                                                         gtid_223201];\n        \n        double x_223209;\n        \n        x_223209 = ((__global double *) ext_mem_229568)[gtid_223200 *\n                                                        t_n_m_203740 +\n                        ",
            "                                gtid_223201];\n        \n        int64_t min_arg_223210 = mul64(jump_t_203582, gtid_223201);\n        int64_t min_res_223211 = smin64(i_203760, min_arg_223210);\n        int64_t defunc_0_g_res_223212 = add64((int64_t) 1, min_res_223211);\n        double defunc_2_reduce_res_223213;\n        double redout_228320 = 0.0;\n        \n        for (int64_t i_228321 = 0; i_228321 < q_t_203576; i_228321++) {\n            bool cond_223218 = sle64(x_223204, i_228321);\n            int64_t defunc_0_f_res_223219;\n            \n            if (cond_223218) {\n                defunc_0_f_res_223219 = (int64_t) 0;\n            } else {\n                int64_t i_223220 = add64(x_223208, i_228321);\n                int64_t defunc_0_add_arg_223221;\n                \n                defunc_0_add_arg_223221 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_223200 *\n                                                                       n_203572 +\n                                                                       i_223220];\n                \n                int64_t defunc_1_add_res_223222 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223221);\n                \n                defunc_0_f_res_223219 = defunc_1_add_res_223222;\n            }\n            \n            double defunc_0_f_res_223223;\n            \n            if (cond_223218) {\n                defunc_0_f_res_223223 = 0.0;\n            } else {\n                int64_t i_223224 = add64(x_223208, i_228321);\n                double defunc_0_add_arg_223225;\n                \n                defunc_0_add_arg_223225 = ((__global\n                                            double *) mem_231121)[gtid_223200 *\n                                                                  n_203572 +\n                                                                  i_223224];\n                defunc_0_f_res_223223 = defunc_0_add_arg_223225;\n            }\n   ",
            "         \n            int64_t binop_p_223226 = sub64(defunc_0_f_res_223219,\n                                           defunc_0_g_res_223212);\n            double defunc_0_f_res_223227 = sitofp_i64_f64(binop_p_223226);\n            double abs_res_223228 = fabs(defunc_0_f_res_223227);\n            double tmp1_223229 = abs_res_223228 / x_223209;\n            double x_223230 = tmp1_223229 * tmp1_223229;\n            double y_223231 = tmp1_223229 * x_223230;\n            double tmp2_223232 = 1.0 - y_223231;\n            double x_223233 = tmp2_223232 * tmp2_223232;\n            double tmp3_223234 = tmp2_223232 * x_223233;\n            double w_j_223235 = defunc_0_f_res_223223 * tmp3_223234;\n            double defunc_1_op_res_223216 = w_j_223235 + redout_228320;\n            double redout_tmp_235764 = defunc_1_op_res_223216;\n            \n            redout_228320 = redout_tmp_235764;\n        }\n        defunc_2_reduce_res_223213 = redout_228320;\n        \n        double a0_223236 = 1.0 / defunc_2_reduce_res_223213;\n        double defunc_2_reduce_res_223237;\n        double redout_228322 = 0.0;\n        \n        for (int64_t i_228323 = 0; i_228323 < q_t_203576; i_228323++) {\n            bool cond_223242 = sle64(x_223204, i_228323);\n            int64_t defunc_0_f_res_223243;\n            \n            if (cond_223242) {\n                defunc_0_f_res_223243 = (int64_t) 0;\n            } else {\n                int64_t i_223244 = add64(x_223208, i_228323);\n                int64_t defunc_0_add_arg_223245;\n                \n                defunc_0_add_arg_223245 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_223200 *\n                                                                       n_203572 +\n                                                                       i_223244];\n                \n                int64_t defunc_1_add_res_223246 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223245);\n          ",
            "      \n                defunc_0_f_res_223243 = defunc_1_add_res_223246;\n            }\n            \n            double defunc_0_f_res_223247;\n            \n            if (cond_223242) {\n                defunc_0_f_res_223247 = 0.0;\n            } else {\n                int64_t i_223248 = add64(x_223208, i_228323);\n                double defunc_0_add_arg_223249;\n                \n                defunc_0_add_arg_223249 = ((__global\n                                            double *) mem_231121)[gtid_223200 *\n                                                                  n_203572 +\n                                                                  i_223248];\n                defunc_0_f_res_223247 = defunc_0_add_arg_223249;\n            }\n            \n            int64_t binop_p_223250 = sub64(defunc_0_f_res_223243,\n                                           defunc_0_g_res_223212);\n            double defunc_0_f_res_223251 = sitofp_i64_f64(binop_p_223250);\n            double abs_res_223252 = fabs(defunc_0_f_res_223251);\n            double tmp1_223253 = abs_res_223252 / x_223209;\n            double x_223254 = tmp1_223253 * tmp1_223253;\n            double y_223255 = tmp1_223253 * x_223254;\n            double tmp2_223256 = 1.0 - y_223255;\n            double x_223257 = tmp2_223256 * tmp2_223256;\n            double tmp3_223258 = tmp2_223256 * x_223257;\n            double tmp4_223259 = defunc_0_f_res_223247 * tmp3_223258;\n            double defunc_0_f_res_223260;\n            \n            if (cond_223242) {\n                defunc_0_f_res_223260 = 0.0;\n            } else {\n                int64_t i_223261 = add64(x_223208, i_228323);\n                double defunc_0_add_arg_223262;\n                \n                defunc_0_add_arg_223262 = ((__global\n                                            double *) mem_231125)[gtid_223200 *\n                                                                  n_203572 +\n                                                                  i_223261];\n",
            "                defunc_0_f_res_223260 = defunc_0_add_arg_223262;\n            }\n            \n            double x_223263 = a0_223236 * tmp4_223259;\n            double defunc_9_fit_fun_res_223264 = defunc_0_f_res_223260 *\n                   x_223263;\n            double defunc_1_op_res_223240 = defunc_9_fit_fun_res_223264 +\n                   redout_228322;\n            double redout_tmp_235765 = defunc_1_op_res_223240;\n            \n            redout_228322 = redout_tmp_235765;\n        }\n        defunc_2_reduce_res_223237 = redout_228322;\n        ((__global double *) mem_231130)[gtid_223200 * t_n_m_203740 +\n                                         gtid_223201] =\n            defunc_2_reduce_res_223237;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223193\n}\n__kernel void mainzisegmap_223326(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, __global\n                                  unsigned char *mem_231135, __global\n                                  unsigned char *mem_231140)\n{\n    #define segmap_group_sizze_223321 (mainzisegmap_group_sizze_222871)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235838;\n    int32_t local_tid_235839;\n    int64_t group_sizze_235842;\n    int32_t wave_sizze_235841;\n    int32_t group_tid_235840;\n    \n    global_tid_235838 = get_global_id(0);\n    local_tid_235839 = get_local_id(0);\n    group_sizze_235842 = get_local_size(0);\n    wave_sizze_235841 = LOCKSTEP_WIDTH;\n    group_tid_235840 = get_group_id(0);\n    \n    int32_t phys_tid_223326 = global_tid_235838;\n    int64_t global_tid_235843 = sext_i32_i64(group_tid_235840) *\n            segmap_group_sizze_223321 + sext_i32_i64(local_tid_235839);\n    int64_t slice_235844 = t_n_m_203740;\n    int64_t slice_235845 = partition_sizze_203667 * slice_235844;\n    i",
            "nt64_t gtid_223324 = squot64(global_tid_235843, slice_235844);\n    int64_t remnant_235846 = global_tid_235843 - gtid_223324 * slice_235844;\n    int64_t gtid_223325 = remnant_235846;\n    int64_t remnant_235847 = remnant_235846 - gtid_223325;\n    \n    if (slt64(gtid_223324, partition_sizze_203667) && slt64(gtid_223325,\n                                                            t_n_m_203740)) {\n        double defunc_2_reduce_res_223327;\n        \n        defunc_2_reduce_res_223327 = ((__global\n                                       double *) mem_231135)[gtid_223324 *\n                                                             t_n_m_203740 +\n                                                             gtid_223325];\n        \n        double a0_223328 = 1.0 / defunc_2_reduce_res_223327;\n        \n        ((__global double *) mem_231140)[gtid_223324 * t_n_m_203740 +\n                                         gtid_223325] = a0_223328;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223321\n}\n__kernel void mainzisegmap_223513(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t num_groups_223508,\n                                  int64_t num_threads_232304, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_229304, __global\n                                  unsigned char *mem_231155, __global\n                                  unsigned char *mem_231158, __global\n                                  unsigned char *mem_231161, __global\n                                  uns",
            "igned char *mem_231164, __global\n                                  unsigned char *mem_231167, __global\n                                  unsigned char *mem_231246, __global\n                                  unsigned char *mem_231249, __global\n                                  unsigned char *color_232155, __global\n                                  unsigned char *color_232156, __global\n                                  unsigned char *color_232157, __global\n                                  unsigned char *color_232158)\n{\n    #define segmap_group_sizze_223507 (mainzisegmap_group_sizze_223386)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_235937;\n    int32_t local_tid_235938;\n    int64_t group_sizze_235941;\n    int32_t wave_sizze_235940;\n    int32_t group_tid_235939;\n    \n    global_tid_235937 = get_global_id(0);\n    local_tid_235938 = get_local_id(0);\n    group_sizze_235941 = get_local_size(0);\n    wave_sizze_235940 = LOCKSTEP_WIDTH;\n    group_tid_235939 = get_group_id(0);\n    \n    int32_t phys_tid_223513 = global_tid_235937;\n    int32_t phys_group_id_235942;\n    \n    phys_group_id_235942 = get_group_id(0);\n    for (int32_t i_235943 = 0; i_235943 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_223507)) -\n                   phys_group_id_235942, sext_i64_i32(num_groups_223508));\n         i_235943++) {\n        int32_t virt_group_id_235944 = phys_group_id_235942 + i_235943 *\n                sext_i64_i32(num_groups_223508);\n        int64_t global_tid_235945 = sext_i32_i64(virt_group_id_235944) *\n                segmap_group_sizze_223507 + sext_i32_i64(local_tid_235938);\n        int64_t ",
            "slice_235946 = partition_sizze_203667;\n        int64_t gtid_223512 = global_tid_235945;\n        int64_t remnant_235947 = global_tid_235945 - gtid_223512;\n        \n        if (slt64(gtid_223512, partition_sizze_203667)) {\n            int64_t x_223518;\n            \n            x_223518 = ((__global int64_t *) ext_mem_229304)[gtid_223512];\n            for (int64_t i_229112 = 0; i_229112 < n_203572; i_229112++) {\n                double x_223522;\n                \n                x_223522 = ((__global double *) mem_229269)[gtid_223512 *\n                                                            n_203572 +\n                                                            i_229112];\n                \n                double x_223523;\n                \n                x_223523 = ((__global double *) mem_231155)[i_229112 *\n                                                            partition_sizze_203667 +\n                                                            gtid_223512];\n                \n                double defunc_1_f_res_223524 = x_223522 - x_223523;\n                \n                ((__global double *) color_232155)[phys_tid_223513 + i_229112 *\n                                                   num_threads_232304] =\n                    defunc_1_f_res_223524;\n            }\n            for (int64_t i_229118 = 0; i_229118 < n_203572; i_229118++) {\n                int64_t x_223527;\n                \n                x_223527 = ((__global int64_t *) mem_231158)[i_229118 *\n                                                             partition_sizze_203667 +\n                                                             gtid_223512];\n                \n                bool cond_223528 = sle64((int64_t) 0, x_223527);\n                double defunc_0_f_res_223529;\n                \n                if (cond_223528) {\n                    bool y_223530 = slt64(x_223527, n_203572);\n                    bool bounds_check_223531 = cond_223528 && y_223530;\n                    bool index_certs_22",
            "3532;\n                    \n                    if (!bounds_check_223531) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          56) == -1) {\n                                global_failure_args[0] = (int64_t) x_223527;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223533;\n                    \n                    defunc_0_f_res_t_res_223533 = ((__global\n                                                    double *) color_232155)[phys_tid_223513 +\n                                                                            x_223527 *\n                                                                            num_threads_232304];\n                    defunc_0_f_res_223529 = defunc_0_f_res_t_res_223533;\n                } else {\n                    defunc_0_f_res_223529 = 0.0;\n                }\n                \n                double defunc_0_f_res_223534;\n                \n                if (cond_223528) {\n                    bool y_223535 = slt64(x_223527, n_203572);\n                    bool bounds_check_223536 = cond_223528 && y_223535;\n                    bool index_certs_223537;\n                    \n                    if (!bounds_check_223536) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          57) == -1) {\n                                global_failure_args[0] = (int64_t) x_223527;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local",
            "_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223538;\n                    \n                    defunc_0_f_res_t_res_223538 = ((__global\n                                                    double *) mem_231167)[x_223527 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_223512];\n                    defunc_0_f_res_223534 = defunc_0_f_res_t_res_223538;\n                } else {\n                    defunc_0_f_res_223534 = 0.0;\n                }\n                ((__global double *) color_232158)[phys_tid_223513 + i_229118 *\n                                                   num_threads_232304] =\n                    defunc_0_f_res_223534;\n                ((__global double *) color_232157)[phys_tid_223513 + i_229118 *\n                                                   num_threads_232304] =\n                    defunc_0_f_res_223529;\n            }\n            for (int64_t i_229125 = 0; i_229125 < t_n_m_203740; i_229125++) {\n                int64_t x_223542;\n                \n                x_223542 = ((__global int64_t *) mem_231161)[i_229125 *\n                                                             partition_sizze_203667 +\n                                                             gtid_223512];\n                \n                double x_223543;\n                \n                x_223543 = ((__global double *) mem_231164)[i_229125 *\n                                                            partition_sizze_203667 +\n                                                            gtid_223512];\n                \n                int64_t min_arg_223544 = mul64(jump_t_203582, i_229125);\n                int64_t min_res_223545 = smin64(i_203760, min_arg_223544);\n                int64_t defunc_0_g_res_223546 = add64((int64_t) 1,\n",
            "                                                      min_res_223545);\n                double defunc_2_reduce_res_223547;\n                double defunc_2_reduce_res_223548;\n                double defunc_2_reduce_res_223549;\n                double redout_228336;\n                double redout_228337;\n                double redout_228338;\n                \n                redout_228336 = 0.0;\n                redout_228337 = 0.0;\n                redout_228338 = 0.0;\n                for (int64_t i_228339 = 0; i_228339 < q_t_203576; i_228339++) {\n                    bool cond_223560 = sle64(x_223518, i_228339);\n                    int64_t defunc_0_f_res_223561;\n                    \n                    if (cond_223560) {\n                        defunc_0_f_res_223561 = (int64_t) 0;\n                    } else {\n                        int64_t i_223562 = add64(x_223542, i_228339);\n                        int64_t defunc_0_add_arg_223563;\n                        \n                        defunc_0_add_arg_223563 = ((__global\n                                                    int64_t *) mem_231158)[i_223562 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_223512];\n                        \n                        int64_t defunc_1_add_res_223564 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223563);\n                        \n                        defunc_0_f_res_223561 = defunc_1_add_res_223564;\n                    }\n                    \n                    double defunc_0_f_res_223565;\n                    \n                    if (cond_223560) {\n                        defunc_0_f_res_223565 = 0.0;\n                    } else {\n                        int64_t i_223566 = add64(x_223542, i_228339);\n                        double defunc_0_add_arg_223567;\n                        \n                       ",
            " defunc_0_add_arg_223567 = ((__global\n                                                    double *) color_232158)[phys_tid_223513 +\n                                                                            i_223566 *\n                                                                            num_threads_232304];\n                        defunc_0_f_res_223565 = defunc_0_add_arg_223567;\n                    }\n                    \n                    int64_t binop_p_223568 = sub64(defunc_0_f_res_223561,\n                                                   defunc_0_g_res_223546);\n                    double defunc_0_f_res_223569 =\n                           sitofp_i64_f64(binop_p_223568);\n                    double abs_res_223570 = fabs(defunc_0_f_res_223569);\n                    double tmp1_223571 = abs_res_223570 / x_223543;\n                    double x_223572 = tmp1_223571 * tmp1_223571;\n                    double y_223573 = tmp1_223571 * x_223572;\n                    double tmp2_223574 = 1.0 - y_223573;\n                    double x_223575 = tmp2_223574 * tmp2_223574;\n                    double tmp3_223576 = tmp2_223574 * x_223575;\n                    double w_j_223577 = defunc_0_f_res_223565 * tmp3_223576;\n                    double xw_j_223578 = defunc_0_f_res_223569 * w_j_223577;\n                    double x2w_j_223579 = defunc_0_f_res_223569 * xw_j_223578;\n                    double defunc_1_op_res_223552 = w_j_223577 + redout_228336;\n                    double defunc_1_op_res_223555 = xw_j_223578 + redout_228337;\n                    double defunc_1_op_res_223558 = x2w_j_223579 +\n                           redout_228338;\n                    double redout_tmp_235953 = defunc_1_op_res_223552;\n                    double redout_tmp_235954 = defunc_1_op_res_223555;\n                    double redout_tmp_235955 = defunc_1_op_res_223558;\n                    \n                    redout_228336 = redout_tmp_235953;\n                    redout_228337 = redout_tmp_235954;\n       ",
            "             redout_228338 = redout_tmp_235955;\n                }\n                defunc_2_reduce_res_223547 = redout_228336;\n                defunc_2_reduce_res_223548 = redout_228337;\n                defunc_2_reduce_res_223549 = redout_228338;\n                \n                double x_223580 = defunc_2_reduce_res_223547 *\n                       defunc_2_reduce_res_223549;\n                double y_223581 = defunc_2_reduce_res_223548 *\n                       defunc_2_reduce_res_223548;\n                double y_223582 = x_223580 - y_223581;\n                double det1_223583 = 1.0 / y_223582;\n                double a11_223584 = defunc_2_reduce_res_223549 * det1_223583;\n                double x_223585 = 0.0 - defunc_2_reduce_res_223548;\n                double b11_223586 = det1_223583 * x_223585;\n                double c11_223587 = defunc_2_reduce_res_223547 * det1_223583;\n                double defunc_2_reduce_res_223588;\n                double defunc_2_reduce_res_223589;\n                double redout_228340;\n                double redout_228341;\n                \n                redout_228340 = 0.0;\n                redout_228341 = 0.0;\n                for (int64_t i_228342 = 0; i_228342 < q_t_203576; i_228342++) {\n                    bool cond_223597 = sle64(x_223518, i_228342);\n                    int64_t defunc_0_f_res_223598;\n                    \n                    if (cond_223597) {\n                        defunc_0_f_res_223598 = (int64_t) 0;\n                    } else {\n                        int64_t i_223599 = add64(x_223542, i_228342);\n                        int64_t defunc_0_add_arg_223600;\n                        \n                        defunc_0_add_arg_223600 = ((__global\n                                                    int64_t *) mem_231158)[i_223599 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_223512];\n             ",
            "           \n                        int64_t defunc_1_add_res_223601 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223600);\n                        \n                        defunc_0_f_res_223598 = defunc_1_add_res_223601;\n                    }\n                    \n                    double defunc_0_f_res_223602;\n                    \n                    if (cond_223597) {\n                        defunc_0_f_res_223602 = 0.0;\n                    } else {\n                        int64_t i_223603 = add64(x_223542, i_228342);\n                        double defunc_0_add_arg_223604;\n                        \n                        defunc_0_add_arg_223604 = ((__global\n                                                    double *) color_232158)[phys_tid_223513 +\n                                                                            i_223603 *\n                                                                            num_threads_232304];\n                        defunc_0_f_res_223602 = defunc_0_add_arg_223604;\n                    }\n                    \n                    int64_t binop_p_223605 = sub64(defunc_0_f_res_223598,\n                                                   defunc_0_g_res_223546);\n                    double defunc_0_f_res_223606 =\n                           sitofp_i64_f64(binop_p_223605);\n                    double abs_res_223607 = fabs(defunc_0_f_res_223606);\n                    double tmp1_223608 = abs_res_223607 / x_223543;\n                    double x_223609 = tmp1_223608 * tmp1_223608;\n                    double y_223610 = tmp1_223608 * x_223609;\n                    double tmp2_223611 = 1.0 - y_223610;\n                    double x_223612 = tmp2_223611 * tmp2_223611;\n                    double tmp3_223613 = tmp2_223611 * x_223612;\n                    double tmp4_223614 = defunc_0_f_res_223602 * tmp3_223613;\n                    double defunc_1_f_res_223615 = defunc_0_f_res_223606 *\n               ",
            "            tmp4_223614;\n                    double defunc_0_f_res_223616;\n                    \n                    if (cond_223597) {\n                        defunc_0_f_res_223616 = 0.0;\n                    } else {\n                        int64_t i_223617 = add64(x_223542, i_228342);\n                        double defunc_0_add_arg_223618;\n                        \n                        defunc_0_add_arg_223618 = ((__global\n                                                    double *) color_232157)[phys_tid_223513 +\n                                                                            i_223617 *\n                                                                            num_threads_232304];\n                        defunc_0_f_res_223616 = defunc_0_add_arg_223618;\n                    }\n                    \n                    double x_223619 = a11_223584 * tmp4_223614;\n                    double y_223620 = b11_223586 * defunc_1_f_res_223615;\n                    double x_223621 = x_223619 + y_223620;\n                    double defunc_9_fit_fun_res_223622 = defunc_0_f_res_223616 *\n                           x_223621;\n                    double x_223623 = b11_223586 * tmp4_223614;\n                    double y_223624 = c11_223587 * defunc_1_f_res_223615;\n                    double x_223625 = x_223623 + y_223624;\n                    double defunc_9_slope_fun_res_223626 =\n                           defunc_0_f_res_223616 * x_223625;\n                    double defunc_1_op_res_223592 =\n                           defunc_9_fit_fun_res_223622 + redout_228340;\n                    double defunc_1_op_res_223595 =\n                           defunc_9_slope_fun_res_223626 + redout_228341;\n                    double redout_tmp_235956 = defunc_1_op_res_223592;\n                    double redout_tmp_235957 = defunc_1_op_res_223595;\n                    \n                    redout_228340 = redout_tmp_235956;\n                    redout_228341 = redout_tmp_235957;\n                }\n    ",
            "            defunc_2_reduce_res_223588 = redout_228340;\n                defunc_2_reduce_res_223589 = redout_228341;\n                ((__global double *) color_232156)[phys_tid_223513 + i_229125 *\n                                                   num_threads_232304] =\n                    defunc_2_reduce_res_223588;\n                ((__global double *) color_232155)[phys_tid_223513 + i_229125 *\n                                                   num_threads_232304] =\n                    defunc_2_reduce_res_223589;\n            }\n            for (int64_t i_235958 = 0; i_235958 < t_n_m_203740; i_235958++) {\n                double tmp_235959;\n                \n                tmp_235959 = ((__global\n                               double *) color_232156)[phys_tid_223513 +\n                                                       i_235958 *\n                                                       num_threads_232304];\n                ((__global double *) mem_231246)[gtid_223512 + i_235958 *\n                                                 partition_sizze_203667] =\n                    tmp_235959;\n            }\n            for (int64_t i_235960 = 0; i_235960 < t_n_m_203740; i_235960++) {\n                double tmp_235961;\n                \n                tmp_235961 = ((__global\n                               double *) color_232155)[phys_tid_223513 +\n                                                       i_235960 *\n                                                       num_threads_232304];\n                ((__global double *) mem_231249)[gtid_223512 + i_235960 *\n                                                 partition_sizze_203667] =\n                    tmp_235961;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223507\n}\n__kernel void mainzisegmap_224163(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partit",
            "ion_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231254)\n{\n    #define segmap_group_sizze_224158 (mainzisegmap_group_sizze_224132)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235962;\n    int32_t local_tid_235963;\n    int64_t group_sizze_235966;\n    int32_t wave_sizze_235965;\n    int32_t group_tid_235964;\n    \n    global_tid_235962 = get_global_id(0);\n    local_tid_235963 = get_local_id(0);\n    group_sizze_235966 = get_local_size(0);\n    wave_sizze_235965 = LOCKSTEP_WIDTH;\n    group_tid_235964 = get_group_id(0);\n    \n    int32_t phys_tid_224163 = global_tid_235962;\n    int64_t global_tid_235967 = sext_i32_i64(group_tid_235964) *\n            segmap_group_sizze_224158 + sext_i32_i64(local_tid_235963);\n    int64_t slice_235968 = n_203572;\n    int64_t slice_235969 = partition_sizze_203667 * slice_235968;\n    int64_t gtid_224161 = squot64(global_tid_235967, slice_235968);\n    int64_t remnant_235970 = global_tid_235967 - gtid_224161 * slice_235968;\n    int64_t gtid_224162 = remnant_235970;\n    int64_t remnant_235971 = remnant_235970 - gtid_224162;\n    \n    if (slt64(gtid_224161, partition_sizze_203667) && slt64(gtid_224162,\n                                                            n_203572)) {\n        double x_224164;\n        \n        x_224164 = ((__global double *) mem_229269)[gtid_224161 * n_203572 +\n                                                    gtid_224162];\n        \n        double x_224165;\n        \n        x_224165 = ((__global double *) mem_231028)[gtid_224161 * n_203572 +\n                                                    gtid_224162];\n        \n        double defunc_1_f_res_224166 = x_224164 - x_224165;\n        \n        ((__global double *) mem_231254)[gtid_2241",
            "61 * n_203572 + gtid_224162] =\n            defunc_1_f_res_224166;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224158\n}\n__kernel void mainzisegmap_224180(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231254, __global\n                                  unsigned char *mem_231259, __global\n                                  unsigned char *mem_231263)\n{\n    #define segmap_group_sizze_224174 (mainzisegmap_group_sizze_224076)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235972;\n    int32_t local_tid_235973;\n    int64_t group_sizze_235976;\n    int32_t wave_sizze_235975;\n    int32_t group_tid_235974;\n    \n    global_tid_235972 = get_global_id(0);\n    local_tid_235973 = get_local_id(0);\n    group_sizze_235976 = get_local_size(0);\n    wave_sizze_235975 = LOCKSTEP_WIDTH;\n    group_tid_235974 = get_group_id(0);\n    \n    int32_t phys_tid_224180 = global_tid_235972;\n    int64_t global_tid_235977 = sext_i32_i64(group_tid_235974) *\n            segmap_group_sizze_224174 + sext_i32_i64(local_tid_235973);\n    int64_t slice_235978 = n_203572;\n    int64_t slice_235979 = partition_sizze_203667 * slice_235978;\n    int64_t gtid_224178 = squot64(global_tid_235977, slice_235978);\n    int64_t remnant_235980 = global_tid_23",
            "5977 - gtid_224178 * slice_235978;\n    int64_t gtid_224179 = remnant_235980;\n    int64_t remnant_235981 = remnant_235980 - gtid_224179;\n    \n    if (slt64(gtid_224178, partition_sizze_203667) && slt64(gtid_224179,\n                                                            n_203572)) {\n        int64_t x_224183;\n        \n        x_224183 = ((__global int64_t *) ext_mem_229305)[gtid_224178 *\n                                                         n_203572 +\n                                                         gtid_224179];\n        \n        bool cond_224184 = sle64((int64_t) 0, x_224183);\n        double defunc_0_f_res_224185;\n        \n        if (cond_224184) {\n            bool y_224186 = slt64(x_224183, n_203572);\n            bool bounds_check_224187 = cond_224184 && y_224186;\n            bool index_certs_224188;\n            \n            if (!bounds_check_224187) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 58) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224183;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224189;\n            \n            defunc_0_f_res_t_res_224189 = ((__global\n                                            double *) mem_231254)[gtid_224178 *\n                                                                  n_203572 +\n                                                                  x_224183];\n            defunc_0_f_res_224185 = defunc_0_f_res_t_res_224189;\n        } else {\n            defunc_0_f_res_224185 = 0.0;\n        }\n        \n        double defunc_0_f_res_224190;\n        \n        if (cond_224184) {\n            bool y_224191 = slt64(x_224183, n_203572);\n            bool bounds_check_224192 = cond_224184 && y_224191;\n            bool index_certs_224193;\n            \n  ",
            "          if (!bounds_check_224192) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 59) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224183;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224194;\n            \n            defunc_0_f_res_t_res_224194 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_224178 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_224183 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_224190 = defunc_0_f_res_t_res_224194;\n        } else {\n            defunc_0_f_res_224190 = 0.0;\n        }\n        ((__global double *) mem_231259)[gtid_224178 * n_203572 + gtid_224179] =\n            defunc_0_f_res_224190;\n        ((__global double *) mem_231263)[gtid_224178 * n_203572 + gtid_224179] =\n            defunc_0_f_res_224185;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224174\n}\n__kernel void mainzisegmap_224210(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *ext_mem_229305,\n                                  __global unsigned char *ext_mem_229568,\n            ",
            "                      __global unsigned char *ext_mem_229569,\n                                  __global unsigned char *mem_231259, __global\n                                  unsigned char *mem_231263, __global\n                                  unsigned char *mem_231268, __global\n                                  unsigned char *mem_231272)\n{\n    #define segmap_group_sizze_224199 (mainzisegmap_group_sizze_223634)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235982;\n    int32_t local_tid_235983;\n    int64_t group_sizze_235986;\n    int32_t wave_sizze_235985;\n    int32_t group_tid_235984;\n    \n    global_tid_235982 = get_global_id(0);\n    local_tid_235983 = get_local_id(0);\n    group_sizze_235986 = get_local_size(0);\n    wave_sizze_235985 = LOCKSTEP_WIDTH;\n    group_tid_235984 = get_group_id(0);\n    \n    int32_t phys_tid_224210 = global_tid_235982;\n    int64_t global_tid_235987 = sext_i32_i64(group_tid_235984) *\n            segmap_group_sizze_224199 + sext_i32_i64(local_tid_235983);\n    int64_t slice_235988 = t_n_m_203740;\n    int64_t slice_235989 = partition_sizze_203667 * slice_235988;\n    int64_t gtid_224208 = squot64(global_tid_235987, slice_235988);\n    int64_t remnant_235990 = global_tid_235987 - gtid_224208 * slice_235988;\n    int64_t gtid_224209 = remnant_235990;\n    int64_t remnant_235991 = remnant_235990 - gtid_224209;\n    \n    if (slt64(gtid_224208, partition_sizze_203667) && slt64(gtid_224209,\n                                                            t_n_m_203740)) {\n        int64_t x_224212;\n        \n        x_224212 = ((__global int64_t *) ext_mem_229304)[gtid_224208];\n        \n        int64_t x_224216;\n        \n        x_224216 = ((__global int64_t *) ext_mem_229569)[gtid_224208 *\n                                                         t_n_m_203740 +\n                                                         gtid_224209];\n     ",
            "   \n        double x_224217;\n        \n        x_224217 = ((__global double *) ext_mem_229568)[gtid_224208 *\n                                                        t_n_m_203740 +\n                                                        gtid_224209];\n        \n        int64_t min_arg_224218 = mul64(jump_t_203582, gtid_224209);\n        int64_t min_res_224219 = smin64(i_203760, min_arg_224218);\n        int64_t defunc_0_g_res_224220 = add64((int64_t) 1, min_res_224219);\n        double defunc_2_reduce_res_224221;\n        double defunc_2_reduce_res_224222;\n        double defunc_2_reduce_res_224223;\n        double redout_228347;\n        double redout_228348;\n        double redout_228349;\n        \n        redout_228347 = 0.0;\n        redout_228348 = 0.0;\n        redout_228349 = 0.0;\n        for (int64_t i_228350 = 0; i_228350 < q_t_203576; i_228350++) {\n            bool cond_224234 = sle64(x_224212, i_228350);\n            int64_t defunc_0_f_res_224235;\n            \n            if (cond_224234) {\n                defunc_0_f_res_224235 = (int64_t) 0;\n            } else {\n                int64_t i_224236 = add64(x_224216, i_228350);\n                int64_t defunc_0_add_arg_224237;\n                \n                defunc_0_add_arg_224237 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_224208 *\n                                                                       n_203572 +\n                                                                       i_224236];\n                \n                int64_t defunc_1_add_res_224238 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224237);\n                \n                defunc_0_f_res_224235 = defunc_1_add_res_224238;\n            }\n            \n            double defunc_0_f_res_224239;\n            \n            if (cond_224234) {\n                defunc_0_f_res_224239 = 0.0;\n            } else {\n                int64_t i_224240 = add64(x_224216, i_228350);\n    ",
            "            double defunc_0_add_arg_224241;\n                \n                defunc_0_add_arg_224241 = ((__global\n                                            double *) mem_231259)[gtid_224208 *\n                                                                  n_203572 +\n                                                                  i_224240];\n                defunc_0_f_res_224239 = defunc_0_add_arg_224241;\n            }\n            \n            int64_t binop_p_224242 = sub64(defunc_0_f_res_224235,\n                                           defunc_0_g_res_224220);\n            double defunc_0_f_res_224243 = sitofp_i64_f64(binop_p_224242);\n            double abs_res_224244 = fabs(defunc_0_f_res_224243);\n            double tmp1_224245 = abs_res_224244 / x_224217;\n            double x_224246 = tmp1_224245 * tmp1_224245;\n            double y_224247 = tmp1_224245 * x_224246;\n            double tmp2_224248 = 1.0 - y_224247;\n            double x_224249 = tmp2_224248 * tmp2_224248;\n            double tmp3_224250 = tmp2_224248 * x_224249;\n            double w_j_224251 = defunc_0_f_res_224239 * tmp3_224250;\n            double xw_j_224252 = defunc_0_f_res_224243 * w_j_224251;\n            double x2w_j_224253 = defunc_0_f_res_224243 * xw_j_224252;\n            double defunc_1_op_res_224226 = w_j_224251 + redout_228347;\n            double defunc_1_op_res_224229 = xw_j_224252 + redout_228348;\n            double defunc_1_op_res_224232 = x2w_j_224253 + redout_228349;\n            double redout_tmp_235992 = defunc_1_op_res_224226;\n            double redout_tmp_235993 = defunc_1_op_res_224229;\n            double redout_tmp_235994 = defunc_1_op_res_224232;\n            \n            redout_228347 = redout_tmp_235992;\n            redout_228348 = redout_tmp_235993;\n            redout_228349 = redout_tmp_235994;\n        }\n        defunc_2_reduce_res_224221 = redout_228347;\n        defunc_2_reduce_res_224222 = redout_228348;\n        defunc_2_reduce_res_224223 = redout_228349;\n        \n       ",
            " double x_224254 = defunc_2_reduce_res_224221 *\n               defunc_2_reduce_res_224223;\n        double y_224255 = defunc_2_reduce_res_224222 *\n               defunc_2_reduce_res_224222;\n        double y_224256 = x_224254 - y_224255;\n        double det1_224257 = 1.0 / y_224256;\n        double a11_224258 = defunc_2_reduce_res_224223 * det1_224257;\n        double x_224259 = 0.0 - defunc_2_reduce_res_224222;\n        double b11_224260 = det1_224257 * x_224259;\n        double c11_224261 = defunc_2_reduce_res_224221 * det1_224257;\n        double defunc_2_reduce_res_224262;\n        double defunc_2_reduce_res_224263;\n        double redout_228351;\n        double redout_228352;\n        \n        redout_228351 = 0.0;\n        redout_228352 = 0.0;\n        for (int64_t i_228353 = 0; i_228353 < q_t_203576; i_228353++) {\n            bool cond_224271 = sle64(x_224212, i_228353);\n            int64_t defunc_0_f_res_224272;\n            \n            if (cond_224271) {\n                defunc_0_f_res_224272 = (int64_t) 0;\n            } else {\n                int64_t i_224273 = add64(x_224216, i_228353);\n                int64_t defunc_0_add_arg_224274;\n                \n                defunc_0_add_arg_224274 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_224208 *\n                                                                       n_203572 +\n                                                                       i_224273];\n                \n                int64_t defunc_1_add_res_224275 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224274);\n                \n                defunc_0_f_res_224272 = defunc_1_add_res_224275;\n            }\n            \n            double defunc_0_f_res_224276;\n            \n            if (cond_224271) {\n                defunc_0_f_res_224276 = 0.0;\n            } else {\n                int64_t i_224277 = add64(x_224216, i_228353);\n                double defunc_0_add_arg_22",
            "4278;\n                \n                defunc_0_add_arg_224278 = ((__global\n                                            double *) mem_231259)[gtid_224208 *\n                                                                  n_203572 +\n                                                                  i_224277];\n                defunc_0_f_res_224276 = defunc_0_add_arg_224278;\n            }\n            \n            int64_t binop_p_224279 = sub64(defunc_0_f_res_224272,\n                                           defunc_0_g_res_224220);\n            double defunc_0_f_res_224280 = sitofp_i64_f64(binop_p_224279);\n            double abs_res_224281 = fabs(defunc_0_f_res_224280);\n            double tmp1_224282 = abs_res_224281 / x_224217;\n            double x_224283 = tmp1_224282 * tmp1_224282;\n            double y_224284 = tmp1_224282 * x_224283;\n            double tmp2_224285 = 1.0 - y_224284;\n            double x_224286 = tmp2_224285 * tmp2_224285;\n            double tmp3_224287 = tmp2_224285 * x_224286;\n            double tmp4_224288 = defunc_0_f_res_224276 * tmp3_224287;\n            double defunc_1_f_res_224289 = defunc_0_f_res_224280 * tmp4_224288;\n            double defunc_0_f_res_224290;\n            \n            if (cond_224271) {\n                defunc_0_f_res_224290 = 0.0;\n            } else {\n                int64_t i_224291 = add64(x_224216, i_228353);\n                double defunc_0_add_arg_224292;\n                \n                defunc_0_add_arg_224292 = ((__global\n                                            double *) mem_231263)[gtid_224208 *\n                                                                  n_203572 +\n                                                                  i_224291];\n                defunc_0_f_res_224290 = defunc_0_add_arg_224292;\n            }\n            \n            double x_224293 = a11_224258 * tmp4_224288;\n            double y_224294 = b11_224260 * defunc_1_f_res_224289;\n            double x_224295 = x_224293 + y_224294;\n          ",
            "  double defunc_9_fit_fun_res_224296 = defunc_0_f_res_224290 *\n                   x_224295;\n            double x_224297 = b11_224260 * tmp4_224288;\n            double y_224298 = c11_224261 * defunc_1_f_res_224289;\n            double x_224299 = x_224297 + y_224298;\n            double defunc_9_slope_fun_res_224300 = defunc_0_f_res_224290 *\n                   x_224299;\n            double defunc_1_op_res_224266 = defunc_9_fit_fun_res_224296 +\n                   redout_228351;\n            double defunc_1_op_res_224269 = defunc_9_slope_fun_res_224300 +\n                   redout_228352;\n            double redout_tmp_235995 = defunc_1_op_res_224266;\n            double redout_tmp_235996 = defunc_1_op_res_224269;\n            \n            redout_228351 = redout_tmp_235995;\n            redout_228352 = redout_tmp_235996;\n        }\n        defunc_2_reduce_res_224262 = redout_228351;\n        defunc_2_reduce_res_224263 = redout_228352;\n        ((__global double *) mem_231268)[gtid_224208 * t_n_m_203740 +\n                                         gtid_224209] =\n            defunc_2_reduce_res_224262;\n        ((__global double *) mem_231272)[gtid_224208 * t_n_m_203740 +\n                                         gtid_224209] =\n            defunc_2_reduce_res_224263;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224199\n}\n__kernel void mainzisegmap_224374(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, __global\n                                  unsigned char *mem_231277, __global\n                                  unsigned char *mem_231281, __global\n                                  unsigned char *mem_231285, __global\n                                  unsigned char *mem_231290, __global\n                                  unsigned char *mem_231294, __global\n                                  unsigned char *mem_231298)\n{\n    #define segmap_group_sizze_224367 (mainzisegmap_g",
            "roup_sizze_223823)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236097;\n    int32_t local_tid_236098;\n    int64_t group_sizze_236101;\n    int32_t wave_sizze_236100;\n    int32_t group_tid_236099;\n    \n    global_tid_236097 = get_global_id(0);\n    local_tid_236098 = get_local_id(0);\n    group_sizze_236101 = get_local_size(0);\n    wave_sizze_236100 = LOCKSTEP_WIDTH;\n    group_tid_236099 = get_group_id(0);\n    \n    int32_t phys_tid_224374 = global_tid_236097;\n    int64_t global_tid_236102 = sext_i32_i64(group_tid_236099) *\n            segmap_group_sizze_224367 + sext_i32_i64(local_tid_236098);\n    int64_t slice_236103 = t_n_m_203740;\n    int64_t slice_236104 = partition_sizze_203667 * slice_236103;\n    int64_t gtid_224372 = squot64(global_tid_236102, slice_236103);\n    int64_t remnant_236105 = global_tid_236102 - gtid_224372 * slice_236103;\n    int64_t gtid_224373 = remnant_236105;\n    int64_t remnant_236106 = remnant_236105 - gtid_224373;\n    \n    if (slt64(gtid_224372, partition_sizze_203667) && slt64(gtid_224373,\n                                                            t_n_m_203740)) {\n        double defunc_2_reduce_res_224375;\n        \n        defunc_2_reduce_res_224375 = ((__global\n                                       double *) mem_231277)[gtid_224372 *\n                                                             t_n_m_203740 +\n                                                             gtid_224373];\n        \n        double defunc_2_reduce_res_224376;\n        \n        defunc_2_reduce_res_224376 = ((__global\n                                       double *) mem_231281)[gtid_224372 *\n                                                             t_n_m_203740 +\n                                                             gtid_224373];\n        \n        double defunc_2_reduce_res_224377;\n        \n        defunc_2_reduce_res_224377 = ((__glo",
            "bal\n                                       double *) mem_231285)[gtid_224372 *\n                                                             t_n_m_203740 +\n                                                             gtid_224373];\n        \n        double x_224378 = defunc_2_reduce_res_224375 *\n               defunc_2_reduce_res_224377;\n        double y_224379 = defunc_2_reduce_res_224376 *\n               defunc_2_reduce_res_224376;\n        double y_224380 = x_224378 - y_224379;\n        double det1_224381 = 1.0 / y_224380;\n        double a11_224382 = defunc_2_reduce_res_224377 * det1_224381;\n        double x_224383 = 0.0 - defunc_2_reduce_res_224376;\n        double b11_224384 = det1_224381 * x_224383;\n        double c11_224385 = defunc_2_reduce_res_224375 * det1_224381;\n        \n        ((__global double *) mem_231290)[gtid_224372 * t_n_m_203740 +\n                                         gtid_224373] = a11_224382;\n        ((__global double *) mem_231294)[gtid_224372 * t_n_m_203740 +\n                                         gtid_224373] = b11_224384;\n        ((__global double *) mem_231298)[gtid_224372 * t_n_m_203740 +\n                                         gtid_224373] = c11_224385;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224367\n}\n__kernel void mainzisegmap_224619(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t num_groups_224614,\n                                  int64_t num_threads_232315, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_",
            "229304, __global\n                                  unsigned char *mem_231324, __global\n                                  unsigned char *mem_231327, __global\n                                  unsigned char *mem_231330, __global\n                                  unsigned char *mem_231333, __global\n                                  unsigned char *mem_231336, __global\n                                  unsigned char *mem_231415, __global\n                                  unsigned char *mem_231418, __global\n                                  unsigned char *color_232160, __global\n                                  unsigned char *color_232161, __global\n                                  unsigned char *color_232162, __global\n                                  unsigned char *color_232163)\n{\n    #define segmap_group_sizze_224613 (mainzisegmap_group_sizze_224460)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_236210;\n    int32_t local_tid_236211;\n    int64_t group_sizze_236214;\n    int32_t wave_sizze_236213;\n    int32_t group_tid_236212;\n    \n    global_tid_236210 = get_global_id(0);\n    local_tid_236211 = get_local_id(0);\n    group_sizze_236214 = get_local_size(0);\n    wave_sizze_236213 = LOCKSTEP_WIDTH;\n    group_tid_236212 = get_group_id(0);\n    \n    int32_t phys_tid_224619 = global_tid_236210;\n    int32_t phys_group_id_236215;\n    \n    phys_group_id_236215 = get_group_id(0);\n    for (int32_t i_236216 = 0; i_236216 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_224613)) -\n                   phys_group_id_236215, sext_i64_i32(num_groups_224614));\n         i_236216++) {\n        int32_t virt_gr",
            "oup_id_236217 = phys_group_id_236215 + i_236216 *\n                sext_i64_i32(num_groups_224614);\n        int64_t global_tid_236218 = sext_i32_i64(virt_group_id_236217) *\n                segmap_group_sizze_224613 + sext_i32_i64(local_tid_236211);\n        int64_t slice_236219 = partition_sizze_203667;\n        int64_t gtid_224618 = global_tid_236218;\n        int64_t remnant_236220 = global_tid_236218 - gtid_224618;\n        \n        if (slt64(gtid_224618, partition_sizze_203667)) {\n            int64_t x_224624;\n            \n            x_224624 = ((__global int64_t *) ext_mem_229304)[gtid_224618];\n            for (int64_t i_229130 = 0; i_229130 < n_203572; i_229130++) {\n                double x_224628;\n                \n                x_224628 = ((__global double *) mem_229269)[gtid_224618 *\n                                                            n_203572 +\n                                                            i_229130];\n                \n                double x_224629;\n                \n                x_224629 = ((__global double *) mem_231324)[i_229130 *\n                                                            partition_sizze_203667 +\n                                                            gtid_224618];\n                \n                double defunc_1_f_res_224630 = x_224628 - x_224629;\n                \n                ((__global double *) color_232160)[phys_tid_224619 + i_229130 *\n                                                   num_threads_232315] =\n                    defunc_1_f_res_224630;\n            }\n            for (int64_t i_229136 = 0; i_229136 < n_203572; i_229136++) {\n                int64_t x_224633;\n                \n                x_224633 = ((__global int64_t *) mem_231327)[i_229136 *\n                                                             partition_sizze_203667 +\n                                                             gtid_224618];\n                \n                bool cond_224634 = sle64((int64_t) 0, x_224633);\n        ",
            "        double defunc_0_f_res_224635;\n                \n                if (cond_224634) {\n                    bool y_224636 = slt64(x_224633, n_203572);\n                    bool bounds_check_224637 = cond_224634 && y_224636;\n                    bool index_certs_224638;\n                    \n                    if (!bounds_check_224637) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          60) == -1) {\n                                global_failure_args[0] = (int64_t) x_224633;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224639;\n                    \n                    defunc_0_f_res_t_res_224639 = ((__global\n                                                    double *) color_232160)[phys_tid_224619 +\n                                                                            x_224633 *\n                                                                            num_threads_232315];\n                    defunc_0_f_res_224635 = defunc_0_f_res_t_res_224639;\n                } else {\n                    defunc_0_f_res_224635 = 0.0;\n                }\n                \n                double defunc_0_f_res_224640;\n                \n                if (cond_224634) {\n                    bool y_224641 = slt64(x_224633, n_203572);\n                    bool bounds_check_224642 = cond_224634 && y_224641;\n                    bool index_certs_224643;\n                    \n                    if (!bounds_check_224642) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          ",
            "61) == -1) {\n                                global_failure_args[0] = (int64_t) x_224633;\n                                global_failure_args[1] = (int64_t) n_203572;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224644;\n                    \n                    defunc_0_f_res_t_res_224644 = ((__global\n                                                    double *) mem_231336)[x_224633 *\n                                                                          partition_sizze_203667 +\n                                                                          gtid_224618];\n                    defunc_0_f_res_224640 = defunc_0_f_res_t_res_224644;\n                } else {\n                    defunc_0_f_res_224640 = 0.0;\n                }\n                ((__global double *) color_232163)[phys_tid_224619 + i_229136 *\n                                                   num_threads_232315] =\n                    defunc_0_f_res_224640;\n                ((__global double *) color_232162)[phys_tid_224619 + i_229136 *\n                                                   num_threads_232315] =\n                    defunc_0_f_res_224635;\n            }\n            for (int64_t i_229143 = 0; i_229143 < t_n_m_203740; i_229143++) {\n                int64_t x_224648;\n                \n                x_224648 = ((__global int64_t *) mem_231330)[i_229143 *\n                                                             partition_sizze_203667 +\n                                                             gtid_224618];\n                \n                double x_224649;\n                \n                x_224649 = ((__global double *) mem_231333)[i_229143 *\n                                                            partition_sizze_203667 +\n                                          ",
            "                  gtid_224618];\n                \n                int64_t min_arg_224650 = mul64(jump_t_203582, i_229143);\n                int64_t min_res_224651 = smin64(i_203760, min_arg_224650);\n                int64_t defunc_0_g_res_224652 = add64((int64_t) 1,\n                                                      min_res_224651);\n                double defunc_2_reduce_res_224653;\n                double defunc_2_reduce_res_224654;\n                double defunc_2_reduce_res_224655;\n                double defunc_2_reduce_res_224656;\n                double defunc_2_reduce_res_224657;\n                double redout_228366;\n                double redout_228367;\n                double redout_228368;\n                double redout_228369;\n                double redout_228370;\n                \n                redout_228366 = 0.0;\n                redout_228367 = 0.0;\n                redout_228368 = 0.0;\n                redout_228369 = 0.0;\n                redout_228370 = 0.0;\n                for (int64_t i_228371 = 0; i_228371 < q_t_203576; i_228371++) {\n                    bool cond_224674 = sle64(x_224624, i_228371);\n                    int64_t defunc_0_f_res_224675;\n                    \n                    if (cond_224674) {\n                        defunc_0_f_res_224675 = (int64_t) 0;\n                    } else {\n                        int64_t i_224676 = add64(x_224648, i_228371);\n                        int64_t defunc_0_add_arg_224677;\n                        \n                        defunc_0_add_arg_224677 = ((__global\n                                                    int64_t *) mem_231327)[i_224676 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_224618];\n                        \n                        int64_t defunc_1_add_res_224678 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_",
            "224677);\n                        \n                        defunc_0_f_res_224675 = defunc_1_add_res_224678;\n                    }\n                    \n                    double defunc_0_f_res_224679;\n                    \n                    if (cond_224674) {\n                        defunc_0_f_res_224679 = 0.0;\n                    } else {\n                        int64_t i_224680 = add64(x_224648, i_228371);\n                        double defunc_0_add_arg_224681;\n                        \n                        defunc_0_add_arg_224681 = ((__global\n                                                    double *) color_232163)[phys_tid_224619 +\n                                                                            i_224680 *\n                                                                            num_threads_232315];\n                        defunc_0_f_res_224679 = defunc_0_add_arg_224681;\n                    }\n                    \n                    int64_t binop_p_224682 = sub64(defunc_0_f_res_224675,\n                                                   defunc_0_g_res_224652);\n                    double defunc_0_f_res_224683 =\n                           sitofp_i64_f64(binop_p_224682);\n                    double abs_res_224684 = fabs(defunc_0_f_res_224683);\n                    double tmp1_224685 = abs_res_224684 / x_224649;\n                    double x_224686 = tmp1_224685 * tmp1_224685;\n                    double y_224687 = tmp1_224685 * x_224686;\n                    double tmp2_224688 = 1.0 - y_224687;\n                    double x_224689 = tmp2_224688 * tmp2_224688;\n                    double tmp3_224690 = tmp2_224688 * x_224689;\n                    double w_j_224691 = defunc_0_f_res_224679 * tmp3_224690;\n                    double xw_j_224692 = defunc_0_f_res_224683 * w_j_224691;\n                    double x2w_j_224693 = defunc_0_f_res_224683 * xw_j_224692;\n                    double x3w_j_224694 = defunc_0_f_res_224683 * x2w_j_224693;\n                    doubl",
            "e x4w_j_224695 = defunc_0_f_res_224683 * x3w_j_224694;\n                    double defunc_1_op_res_224660 = w_j_224691 + redout_228366;\n                    double defunc_1_op_res_224663 = xw_j_224692 + redout_228367;\n                    double defunc_1_op_res_224666 = x2w_j_224693 +\n                           redout_228368;\n                    double defunc_1_op_res_224669 = x3w_j_224694 +\n                           redout_228369;\n                    double defunc_1_op_res_224672 = x4w_j_224695 +\n                           redout_228370;\n                    double redout_tmp_236226 = defunc_1_op_res_224660;\n                    double redout_tmp_236227 = defunc_1_op_res_224663;\n                    double redout_tmp_236228 = defunc_1_op_res_224666;\n                    double redout_tmp_236229 = defunc_1_op_res_224669;\n                    double redout_tmp_236230 = defunc_1_op_res_224672;\n                    \n                    redout_228366 = redout_tmp_236226;\n                    redout_228367 = redout_tmp_236227;\n                    redout_228368 = redout_tmp_236228;\n                    redout_228369 = redout_tmp_236229;\n                    redout_228370 = redout_tmp_236230;\n                }\n                defunc_2_reduce_res_224653 = redout_228366;\n                defunc_2_reduce_res_224654 = redout_228367;\n                defunc_2_reduce_res_224655 = redout_228368;\n                defunc_2_reduce_res_224656 = redout_228369;\n                defunc_2_reduce_res_224657 = redout_228370;\n                \n                double x_224696 = defunc_2_reduce_res_224655 *\n                       defunc_2_reduce_res_224657;\n                double y_224697 = defunc_2_reduce_res_224656 *\n                       defunc_2_reduce_res_224656;\n                double a12_224698 = x_224696 - y_224697;\n                double x_224699 = defunc_2_reduce_res_224655 *\n                       defunc_2_reduce_res_224656;\n                double y_224700 = defunc_2_reduce_res_224654 *\n         ",
            "              defunc_2_reduce_res_224657;\n                double b12_224701 = x_224699 - y_224700;\n                double x_224702 = defunc_2_reduce_res_224654 *\n                       defunc_2_reduce_res_224656;\n                double y_224703 = defunc_2_reduce_res_224655 *\n                       defunc_2_reduce_res_224655;\n                double c12_224704 = x_224702 - y_224703;\n                double x_224705 = defunc_2_reduce_res_224653 *\n                       defunc_2_reduce_res_224657;\n                double b2_224706 = x_224705 - y_224703;\n                double x_224707 = defunc_2_reduce_res_224654 *\n                       defunc_2_reduce_res_224655;\n                double y_224708 = defunc_2_reduce_res_224653 *\n                       defunc_2_reduce_res_224656;\n                double c2_224709 = x_224707 - y_224708;\n                double x_224710 = defunc_2_reduce_res_224653 * a12_224698;\n                double y_224711 = defunc_2_reduce_res_224654 * b12_224701;\n                double x_224712 = x_224710 + y_224711;\n                double y_224713 = defunc_2_reduce_res_224655 * c12_224704;\n                double y_224714 = x_224712 + y_224713;\n                double det_224715 = 1.0 / y_224714;\n                double a12_224716 = a12_224698 * det_224715;\n                double b12_224717 = b12_224701 * det_224715;\n                double c12_224718 = c12_224704 * det_224715;\n                double b2_224719 = b2_224706 * det_224715;\n                double c2_224720 = c2_224709 * det_224715;\n                double defunc_2_reduce_res_224721;\n                double defunc_2_reduce_res_224722;\n                double redout_228372;\n                double redout_228373;\n                \n                redout_228372 = 0.0;\n                redout_228373 = 0.0;\n                for (int64_t i_228374 = 0; i_228374 < q_t_203576; i_228374++) {\n                    bool cond_224730 = sle64(x_224624, i_228374);\n                    int64_t defunc_0_f_res_224731;\n        ",
            "            \n                    if (cond_224730) {\n                        defunc_0_f_res_224731 = (int64_t) 0;\n                    } else {\n                        int64_t i_224732 = add64(x_224648, i_228374);\n                        int64_t defunc_0_add_arg_224733;\n                        \n                        defunc_0_add_arg_224733 = ((__global\n                                                    int64_t *) mem_231327)[i_224732 *\n                                                                           partition_sizze_203667 +\n                                                                           gtid_224618];\n                        \n                        int64_t defunc_1_add_res_224734 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_224733);\n                        \n                        defunc_0_f_res_224731 = defunc_1_add_res_224734;\n                    }\n                    \n                    double defunc_0_f_res_224735;\n                    \n                    if (cond_224730) {\n                        defunc_0_f_res_224735 = 0.0;\n                    } else {\n                        int64_t i_224736 = add64(x_224648, i_228374);\n                        double defunc_0_add_arg_224737;\n                        \n                        defunc_0_add_arg_224737 = ((__global\n                                                    double *) color_232163)[phys_tid_224619 +\n                                                                            i_224736 *\n                                                                            num_threads_232315];\n                        defunc_0_f_res_224735 = defunc_0_add_arg_224737;\n                    }\n                    \n                    int64_t binop_p_224738 = sub64(defunc_0_f_res_224731,\n                                                   defunc_0_g_res_224652);\n                    double defunc_0_f_res_224739 =\n                           sitofp_i64_f",
            "64(binop_p_224738);\n                    double abs_res_224740 = fabs(defunc_0_f_res_224739);\n                    double tmp1_224741 = abs_res_224740 / x_224649;\n                    double x_224742 = tmp1_224741 * tmp1_224741;\n                    double y_224743 = tmp1_224741 * x_224742;\n                    double tmp2_224744 = 1.0 - y_224743;\n                    double x_224745 = tmp2_224744 * tmp2_224744;\n                    double tmp3_224746 = tmp2_224744 * x_224745;\n                    double tmp4_224747 = defunc_0_f_res_224735 * tmp3_224746;\n                    double defunc_1_f_res_224748 = defunc_0_f_res_224739 *\n                           tmp4_224747;\n                    double defunc_1_f_res_224749 = defunc_0_f_res_224739 *\n                           defunc_1_f_res_224748;\n                    double defunc_0_f_res_224750;\n                    \n                    if (cond_224730) {\n                        defunc_0_f_res_224750 = 0.0;\n                    } else {\n                        int64_t i_224751 = add64(x_224648, i_228374);\n                        double defunc_0_add_arg_224752;\n                        \n                        defunc_0_add_arg_224752 = ((__global\n                                                    double *) color_232162)[phys_tid_224619 +\n                                                                            i_224751 *\n                                                                            num_threads_232315];\n                        defunc_0_f_res_224750 = defunc_0_add_arg_224752;\n                    }\n                    \n                    double x_224753 = a12_224716 * tmp4_224747;\n                    double y_224754 = b12_224717 * defunc_1_f_res_224748;\n                    double x_224755 = x_224753 + y_224754;\n                    double y_224756 = c12_224718 * defunc_1_f_res_224749;\n                    double x_224757 = x_224755 + y_224756;\n                    double defunc_9_fit_fun_res_224758 = defunc_0_f_res_224750 ",
            "*\n                           x_224757;\n                    double x_224759 = b12_224717 * tmp4_224747;\n                    double y_224760 = b2_224719 * defunc_1_f_res_224748;\n                    double x_224761 = x_224759 + y_224760;\n                    double y_224762 = c2_224720 * defunc_1_f_res_224749;\n                    double x_224763 = x_224761 + y_224762;\n                    double defunc_9_slope_fun_res_224764 =\n                           defunc_0_f_res_224750 * x_224763;\n                    double defunc_1_op_res_224725 =\n                           defunc_9_fit_fun_res_224758 + redout_228372;\n                    double defunc_1_op_res_224728 =\n                           defunc_9_slope_fun_res_224764 + redout_228373;\n                    double redout_tmp_236231 = defunc_1_op_res_224725;\n                    double redout_tmp_236232 = defunc_1_op_res_224728;\n                    \n                    redout_228372 = redout_tmp_236231;\n                    redout_228373 = redout_tmp_236232;\n                }\n                defunc_2_reduce_res_224721 = redout_228372;\n                defunc_2_reduce_res_224722 = redout_228373;\n                ((__global double *) color_232161)[phys_tid_224619 + i_229143 *\n                                                   num_threads_232315] =\n                    defunc_2_reduce_res_224721;\n                ((__global double *) color_232160)[phys_tid_224619 + i_229143 *\n                                                   num_threads_232315] =\n                    defunc_2_reduce_res_224722;\n            }\n            for (int64_t i_236233 = 0; i_236233 < t_n_m_203740; i_236233++) {\n                double tmp_236234;\n                \n                tmp_236234 = ((__global\n                               double *) color_232161)[phys_tid_224619 +\n                                                       i_236233 *\n                                                       num_threads_232315];\n                ((__global double *) mem_231415)[gt",
            "id_224618 + i_236233 *\n                                                 partition_sizze_203667] =\n                    tmp_236234;\n            }\n            for (int64_t i_236235 = 0; i_236235 < t_n_m_203740; i_236235++) {\n                double tmp_236236;\n                \n                tmp_236236 = ((__global\n                               double *) color_232160)[phys_tid_224619 +\n                                                       i_236235 *\n                                                       num_threads_232315];\n                ((__global double *) mem_231418)[gtid_224618 + i_236235 *\n                                                 partition_sizze_203667] =\n                    tmp_236236;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224613\n}\n__kernel void mainzisegmap_225417(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231423)\n{\n    #define segmap_group_sizze_225412 (mainzisegmap_group_sizze_225386)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236237;\n    int32_t local_tid_236238;\n    int64_t group_sizze_236241;\n    int32_t wave_sizze_236240;\n    int32_t group_tid_236239;\n    \n    global_tid_236237 = get_global_id(0);\n    local_tid_236238 = get_local_id(0);\n    group_sizze_236241 = get_local_size(0);\n    wave_sizze_236240 = LOCKSTEP_WIDTH;\n    group_tid_236239 = get_group_id(0);\n    \n    int32_t phys_tid_225417 = global_tid_236237;\n    int64_t global_tid_236242 = sext_i32_i64(group_tid_236239) *\n            segmap_group_sizze_",
            "225412 + sext_i32_i64(local_tid_236238);\n    int64_t slice_236243 = n_203572;\n    int64_t slice_236244 = partition_sizze_203667 * slice_236243;\n    int64_t gtid_225415 = squot64(global_tid_236242, slice_236243);\n    int64_t remnant_236245 = global_tid_236242 - gtid_225415 * slice_236243;\n    int64_t gtid_225416 = remnant_236245;\n    int64_t remnant_236246 = remnant_236245 - gtid_225416;\n    \n    if (slt64(gtid_225415, partition_sizze_203667) && slt64(gtid_225416,\n                                                            n_203572)) {\n        double x_225418;\n        \n        x_225418 = ((__global double *) mem_229269)[gtid_225415 * n_203572 +\n                                                    gtid_225416];\n        \n        double x_225419;\n        \n        x_225419 = ((__global double *) mem_231028)[gtid_225415 * n_203572 +\n                                                    gtid_225416];\n        \n        double defunc_1_f_res_225420 = x_225418 - x_225419;\n        \n        ((__global double *) mem_231423)[gtid_225415 * n_203572 + gtid_225416] =\n            defunc_1_f_res_225420;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225412\n}\n__kernel void mainzisegmap_225434(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231423, __global\n                                  unsigned char *mem_231428, __global\n                       ",
            "           unsigned char *mem_231432)\n{\n    #define segmap_group_sizze_225428 (mainzisegmap_group_sizze_225330)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236247;\n    int32_t local_tid_236248;\n    int64_t group_sizze_236251;\n    int32_t wave_sizze_236250;\n    int32_t group_tid_236249;\n    \n    global_tid_236247 = get_global_id(0);\n    local_tid_236248 = get_local_id(0);\n    group_sizze_236251 = get_local_size(0);\n    wave_sizze_236250 = LOCKSTEP_WIDTH;\n    group_tid_236249 = get_group_id(0);\n    \n    int32_t phys_tid_225434 = global_tid_236247;\n    int64_t global_tid_236252 = sext_i32_i64(group_tid_236249) *\n            segmap_group_sizze_225428 + sext_i32_i64(local_tid_236248);\n    int64_t slice_236253 = n_203572;\n    int64_t slice_236254 = partition_sizze_203667 * slice_236253;\n    int64_t gtid_225432 = squot64(global_tid_236252, slice_236253);\n    int64_t remnant_236255 = global_tid_236252 - gtid_225432 * slice_236253;\n    int64_t gtid_225433 = remnant_236255;\n    int64_t remnant_236256 = remnant_236255 - gtid_225433;\n    \n    if (slt64(gtid_225432, partition_sizze_203667) && slt64(gtid_225433,\n                                                            n_203572)) {\n        int64_t x_225437;\n        \n        x_225437 = ((__global int64_t *) ext_mem_229305)[gtid_225432 *\n                                                         n_203572 +\n                                                         gtid_225433];\n        \n        bool cond_225438 = sle64((int64_t) 0, x_225437);\n        double defunc_0_f_res_225439;\n        \n        if (cond_225438) {\n            bool y_225440 = slt64(x_225437, n_203572);\n            bool bounds_check_225441 = cond_225438 && y_225440;\n            bool index_certs_225442;\n            \n            if (!bounds_check_225441) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1,",
            " 62) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225437;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225443;\n            \n            defunc_0_f_res_t_res_225443 = ((__global\n                                            double *) mem_231423)[gtid_225432 *\n                                                                  n_203572 +\n                                                                  x_225437];\n            defunc_0_f_res_225439 = defunc_0_f_res_t_res_225443;\n        } else {\n            defunc_0_f_res_225439 = 0.0;\n        }\n        \n        double defunc_0_f_res_225444;\n        \n        if (cond_225438) {\n            bool y_225445 = slt64(x_225437, n_203572);\n            bool bounds_check_225446 = cond_225438 && y_225445;\n            bool index_certs_225447;\n            \n            if (!bounds_check_225446) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 63) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225437;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225448;\n            \n            defunc_0_f_res_t_res_225448 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_225432 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_225437 *\n                                                                      ",
            "   ctx_param_ext_229599)];\n            defunc_0_f_res_225444 = defunc_0_f_res_t_res_225448;\n        } else {\n            defunc_0_f_res_225444 = 0.0;\n        }\n        ((__global double *) mem_231428)[gtid_225432 * n_203572 + gtid_225433] =\n            defunc_0_f_res_225444;\n        ((__global double *) mem_231432)[gtid_225432 * n_203572 + gtid_225433] =\n            defunc_0_f_res_225439;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225428\n}\n__kernel void mainzisegmap_225464(__global int *global_failure,\n                                  int64_t n_203572, int64_t q_t_203576,\n                                  int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  __global unsigned char *ext_mem_229304,\n                                  __global unsigned char *ext_mem_229305,\n                                  __global unsigned char *ext_mem_229568,\n                                  __global unsigned char *ext_mem_229569,\n                                  __global unsigned char *mem_231428, __global\n                                  unsigned char *mem_231432, __global\n                                  unsigned char *mem_231437, __global\n                                  unsigned char *mem_231441)\n{\n    #define segmap_group_sizze_225453 (mainzisegmap_group_sizze_224772)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236257;\n    int32_t local_tid_236258;\n    int64_t group_sizze_236261;\n    int32_t wave_sizze_236260;\n    int32_t group_tid_236259;\n    \n    global_tid_236257 = get_global_id(0);\n    local_tid_236258 = get_local_id(0);\n    group_sizze_236261 = get_local_size(0);\n    wave_sizze_236260 = LOCKSTEP_WIDTH;\n    group_tid_236259 = get_group_id(0);\n    \n    int32_t phys_tid_225464 = g",
            "lobal_tid_236257;\n    int64_t global_tid_236262 = sext_i32_i64(group_tid_236259) *\n            segmap_group_sizze_225453 + sext_i32_i64(local_tid_236258);\n    int64_t slice_236263 = t_n_m_203740;\n    int64_t slice_236264 = partition_sizze_203667 * slice_236263;\n    int64_t gtid_225462 = squot64(global_tid_236262, slice_236263);\n    int64_t remnant_236265 = global_tid_236262 - gtid_225462 * slice_236263;\n    int64_t gtid_225463 = remnant_236265;\n    int64_t remnant_236266 = remnant_236265 - gtid_225463;\n    \n    if (slt64(gtid_225462, partition_sizze_203667) && slt64(gtid_225463,\n                                                            t_n_m_203740)) {\n        int64_t x_225466;\n        \n        x_225466 = ((__global int64_t *) ext_mem_229304)[gtid_225462];\n        \n        int64_t x_225470;\n        \n        x_225470 = ((__global int64_t *) ext_mem_229569)[gtid_225462 *\n                                                         t_n_m_203740 +\n                                                         gtid_225463];\n        \n        double x_225471;\n        \n        x_225471 = ((__global double *) ext_mem_229568)[gtid_225462 *\n                                                        t_n_m_203740 +\n                                                        gtid_225463];\n        \n        int64_t min_arg_225472 = mul64(jump_t_203582, gtid_225463);\n        int64_t min_res_225473 = smin64(i_203760, min_arg_225472);\n        int64_t defunc_0_g_res_225474 = add64((int64_t) 1, min_res_225473);\n        double defunc_2_reduce_res_225475;\n        double defunc_2_reduce_res_225476;\n        double defunc_2_reduce_res_225477;\n        double defunc_2_reduce_res_225478;\n        double defunc_2_reduce_res_225479;\n        double redout_228379;\n        double redout_228380;\n        double redout_228381;\n        double redout_228382;\n        double redout_228383;\n        \n        redout_228379 = 0.0;\n        redout_228380 = 0.0;\n        redout_228381 = 0.0;\n        redout_228382 = 0.0;\n        r",
            "edout_228383 = 0.0;\n        for (int64_t i_228384 = 0; i_228384 < q_t_203576; i_228384++) {\n            bool cond_225496 = sle64(x_225466, i_228384);\n            int64_t defunc_0_f_res_225497;\n            \n            if (cond_225496) {\n                defunc_0_f_res_225497 = (int64_t) 0;\n            } else {\n                int64_t i_225498 = add64(x_225470, i_228384);\n                int64_t defunc_0_add_arg_225499;\n                \n                defunc_0_add_arg_225499 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_225462 *\n                                                                       n_203572 +\n                                                                       i_225498];\n                \n                int64_t defunc_1_add_res_225500 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225499);\n                \n                defunc_0_f_res_225497 = defunc_1_add_res_225500;\n            }\n            \n            double defunc_0_f_res_225501;\n            \n            if (cond_225496) {\n                defunc_0_f_res_225501 = 0.0;\n            } else {\n                int64_t i_225502 = add64(x_225470, i_228384);\n                double defunc_0_add_arg_225503;\n                \n                defunc_0_add_arg_225503 = ((__global\n                                            double *) mem_231428)[gtid_225462 *\n                                                                  n_203572 +\n                                                                  i_225502];\n                defunc_0_f_res_225501 = defunc_0_add_arg_225503;\n            }\n            \n            int64_t binop_p_225504 = sub64(defunc_0_f_res_225497,\n                                           defunc_0_g_res_225474);\n            double defunc_0_f_res_225505 = sitofp_i64_f64(binop_p_225504);\n            double abs_res_225506 = fabs(defunc_0_f_res_225505);\n            double tmp1_225507 = abs_res_225506 / x",
            "_225471;\n            double x_225508 = tmp1_225507 * tmp1_225507;\n            double y_225509 = tmp1_225507 * x_225508;\n            double tmp2_225510 = 1.0 - y_225509;\n            double x_225511 = tmp2_225510 * tmp2_225510;\n            double tmp3_225512 = tmp2_225510 * x_225511;\n            double w_j_225513 = defunc_0_f_res_225501 * tmp3_225512;\n            double xw_j_225514 = defunc_0_f_res_225505 * w_j_225513;\n            double x2w_j_225515 = defunc_0_f_res_225505 * xw_j_225514;\n            double x3w_j_225516 = defunc_0_f_res_225505 * x2w_j_225515;\n            double x4w_j_225517 = defunc_0_f_res_225505 * x3w_j_225516;\n            double defunc_1_op_res_225482 = w_j_225513 + redout_228379;\n            double defunc_1_op_res_225485 = xw_j_225514 + redout_228380;\n            double defunc_1_op_res_225488 = x2w_j_225515 + redout_228381;\n            double defunc_1_op_res_225491 = x3w_j_225516 + redout_228382;\n            double defunc_1_op_res_225494 = x4w_j_225517 + redout_228383;\n            double redout_tmp_236267 = defunc_1_op_res_225482;\n            double redout_tmp_236268 = defunc_1_op_res_225485;\n            double redout_tmp_236269 = defunc_1_op_res_225488;\n            double redout_tmp_236270 = defunc_1_op_res_225491;\n            double redout_tmp_236271 = defunc_1_op_res_225494;\n            \n            redout_228379 = redout_tmp_236267;\n            redout_228380 = redout_tmp_236268;\n            redout_228381 = redout_tmp_236269;\n            redout_228382 = redout_tmp_236270;\n            redout_228383 = redout_tmp_236271;\n        }\n        defunc_2_reduce_res_225475 = redout_228379;\n        defunc_2_reduce_res_225476 = redout_228380;\n        defunc_2_reduce_res_225477 = redout_228381;\n        defunc_2_reduce_res_225478 = redout_228382;\n        defunc_2_reduce_res_225479 = redout_228383;\n        \n        double x_225518 = defunc_2_reduce_res_225477 *\n               defunc_2_reduce_res_225479;\n        double y_225519 = defunc_2_reduce_res_225478 *\n  ",
            "             defunc_2_reduce_res_225478;\n        double a12_225520 = x_225518 - y_225519;\n        double x_225521 = defunc_2_reduce_res_225477 *\n               defunc_2_reduce_res_225478;\n        double y_225522 = defunc_2_reduce_res_225476 *\n               defunc_2_reduce_res_225479;\n        double b12_225523 = x_225521 - y_225522;\n        double x_225524 = defunc_2_reduce_res_225476 *\n               defunc_2_reduce_res_225478;\n        double y_225525 = defunc_2_reduce_res_225477 *\n               defunc_2_reduce_res_225477;\n        double c12_225526 = x_225524 - y_225525;\n        double x_225527 = defunc_2_reduce_res_225475 *\n               defunc_2_reduce_res_225479;\n        double b2_225528 = x_225527 - y_225525;\n        double x_225529 = defunc_2_reduce_res_225476 *\n               defunc_2_reduce_res_225477;\n        double y_225530 = defunc_2_reduce_res_225475 *\n               defunc_2_reduce_res_225478;\n        double c2_225531 = x_225529 - y_225530;\n        double x_225532 = defunc_2_reduce_res_225475 * a12_225520;\n        double y_225533 = defunc_2_reduce_res_225476 * b12_225523;\n        double x_225534 = x_225532 + y_225533;\n        double y_225535 = defunc_2_reduce_res_225477 * c12_225526;\n        double y_225536 = x_225534 + y_225535;\n        double det_225537 = 1.0 / y_225536;\n        double a12_225538 = a12_225520 * det_225537;\n        double b12_225539 = b12_225523 * det_225537;\n        double c12_225540 = c12_225526 * det_225537;\n        double b2_225541 = b2_225528 * det_225537;\n        double c2_225542 = c2_225531 * det_225537;\n        double defunc_2_reduce_res_225543;\n        double defunc_2_reduce_res_225544;\n        double redout_228385;\n        double redout_228386;\n        \n        redout_228385 = 0.0;\n        redout_228386 = 0.0;\n        for (int64_t i_228387 = 0; i_228387 < q_t_203576; i_228387++) {\n            bool cond_225552 = sle64(x_225466, i_228387);\n            int64_t defunc_0_f_res_225553;\n            \n            if (cond_225552) {\n",
            "                defunc_0_f_res_225553 = (int64_t) 0;\n            } else {\n                int64_t i_225554 = add64(x_225470, i_228387);\n                int64_t defunc_0_add_arg_225555;\n                \n                defunc_0_add_arg_225555 = ((__global\n                                            int64_t *) ext_mem_229305)[gtid_225462 *\n                                                                       n_203572 +\n                                                                       i_225554];\n                \n                int64_t defunc_1_add_res_225556 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225555);\n                \n                defunc_0_f_res_225553 = defunc_1_add_res_225556;\n            }\n            \n            double defunc_0_f_res_225557;\n            \n            if (cond_225552) {\n                defunc_0_f_res_225557 = 0.0;\n            } else {\n                int64_t i_225558 = add64(x_225470, i_228387);\n                double defunc_0_add_arg_225559;\n                \n                defunc_0_add_arg_225559 = ((__global\n                                            double *) mem_231428)[gtid_225462 *\n                                                                  n_203572 +\n                                                                  i_225558];\n                defunc_0_f_res_225557 = defunc_0_add_arg_225559;\n            }\n            \n            int64_t binop_p_225560 = sub64(defunc_0_f_res_225553,\n                                           defunc_0_g_res_225474);\n            double defunc_0_f_res_225561 = sitofp_i64_f64(binop_p_225560);\n            double abs_res_225562 = fabs(defunc_0_f_res_225561);\n            double tmp1_225563 = abs_res_225562 / x_225471;\n            double x_225564 = tmp1_225563 * tmp1_225563;\n            double y_225565 = tmp1_225563 * x_225564;\n            double tmp2_225566 = 1.0 - y_225565;\n            double x_225567 = tmp2_225566 * tmp2_225566;\n           ",
            " double tmp3_225568 = tmp2_225566 * x_225567;\n            double tmp4_225569 = defunc_0_f_res_225557 * tmp3_225568;\n            double defunc_1_f_res_225570 = defunc_0_f_res_225561 * tmp4_225569;\n            double defunc_1_f_res_225571 = defunc_0_f_res_225561 *\n                   defunc_1_f_res_225570;\n            double defunc_0_f_res_225572;\n            \n            if (cond_225552) {\n                defunc_0_f_res_225572 = 0.0;\n            } else {\n                int64_t i_225573 = add64(x_225470, i_228387);\n                double defunc_0_add_arg_225574;\n                \n                defunc_0_add_arg_225574 = ((__global\n                                            double *) mem_231432)[gtid_225462 *\n                                                                  n_203572 +\n                                                                  i_225573];\n                defunc_0_f_res_225572 = defunc_0_add_arg_225574;\n            }\n            \n            double x_225575 = a12_225538 * tmp4_225569;\n            double y_225576 = b12_225539 * defunc_1_f_res_225570;\n            double x_225577 = x_225575 + y_225576;\n            double y_225578 = c12_225540 * defunc_1_f_res_225571;\n            double x_225579 = x_225577 + y_225578;\n            double defunc_9_fit_fun_res_225580 = defunc_0_f_res_225572 *\n                   x_225579;\n            double x_225581 = b12_225539 * tmp4_225569;\n            double y_225582 = b2_225541 * defunc_1_f_res_225570;\n            double x_225583 = x_225581 + y_225582;\n            double y_225584 = c2_225542 * defunc_1_f_res_225571;\n            double x_225585 = x_225583 + y_225584;\n            double defunc_9_slope_fun_res_225586 = defunc_0_f_res_225572 *\n                   x_225585;\n            double defunc_1_op_res_225547 = defunc_9_fit_fun_res_225580 +\n                   redout_228385;\n            double defunc_1_op_res_225550 = defunc_9_slope_fun_res_225586 +\n                   redout_228386;\n            double redout_tmp_23627",
            "2 = defunc_1_op_res_225547;\n            double redout_tmp_236273 = defunc_1_op_res_225550;\n            \n            redout_228385 = redout_tmp_236272;\n            redout_228386 = redout_tmp_236273;\n        }\n        defunc_2_reduce_res_225543 = redout_228385;\n        defunc_2_reduce_res_225544 = redout_228386;\n        ((__global double *) mem_231437)[gtid_225462 * t_n_m_203740 +\n                                         gtid_225463] =\n            defunc_2_reduce_res_225543;\n        ((__global double *) mem_231441)[gtid_225462 * t_n_m_203740 +\n                                         gtid_225463] =\n            defunc_2_reduce_res_225544;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225453\n}\n__kernel void mainzisegmap_225672(__global int *global_failure,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, __global\n                                  unsigned char *mem_231446, __global\n                                  unsigned char *mem_231450, __global\n                                  unsigned char *mem_231454, __global\n                                  unsigned char *mem_231458, __global\n                                  unsigned char *mem_231462, __global\n                                  unsigned char *mem_231467, __global\n                                  unsigned char *mem_231471, __global\n                                  unsigned char *mem_231475, __global\n                                  unsigned char *mem_231479, __global\n                                  unsigned char *mem_231483)\n{\n    #define segmap_group_sizze_225663 (mainzisegmap_group_sizze_225010)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236402;\n    int32_t local_tid_236403;\n    int64_t group_sizze_236406;\n    int32_t wave_sizze_236405;\n    int32_t group_tid_236404;\n    \n    global_ti",
            "d_236402 = get_global_id(0);\n    local_tid_236403 = get_local_id(0);\n    group_sizze_236406 = get_local_size(0);\n    wave_sizze_236405 = LOCKSTEP_WIDTH;\n    group_tid_236404 = get_group_id(0);\n    \n    int32_t phys_tid_225672 = global_tid_236402;\n    int64_t global_tid_236407 = sext_i32_i64(group_tid_236404) *\n            segmap_group_sizze_225663 + sext_i32_i64(local_tid_236403);\n    int64_t slice_236408 = t_n_m_203740;\n    int64_t slice_236409 = partition_sizze_203667 * slice_236408;\n    int64_t gtid_225670 = squot64(global_tid_236407, slice_236408);\n    int64_t remnant_236410 = global_tid_236407 - gtid_225670 * slice_236408;\n    int64_t gtid_225671 = remnant_236410;\n    int64_t remnant_236411 = remnant_236410 - gtid_225671;\n    \n    if (slt64(gtid_225670, partition_sizze_203667) && slt64(gtid_225671,\n                                                            t_n_m_203740)) {\n        double defunc_2_reduce_res_225673;\n        \n        defunc_2_reduce_res_225673 = ((__global\n                                       double *) mem_231446)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225674;\n        \n        defunc_2_reduce_res_225674 = ((__global\n                                       double *) mem_231450)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225675;\n        \n        defunc_2_reduce_res_225675 = ((__global\n                                       double *) mem_231454)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225676;\n        \n        defunc_2_reduce_res_225676 = ((__global\n   ",
            "                                    double *) mem_231458)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double defunc_2_reduce_res_225677;\n        \n        defunc_2_reduce_res_225677 = ((__global\n                                       double *) mem_231462)[gtid_225670 *\n                                                             t_n_m_203740 +\n                                                             gtid_225671];\n        \n        double x_225678 = defunc_2_reduce_res_225675 *\n               defunc_2_reduce_res_225677;\n        double y_225679 = defunc_2_reduce_res_225676 *\n               defunc_2_reduce_res_225676;\n        double a12_225680 = x_225678 - y_225679;\n        double x_225681 = defunc_2_reduce_res_225675 *\n               defunc_2_reduce_res_225676;\n        double y_225682 = defunc_2_reduce_res_225674 *\n               defunc_2_reduce_res_225677;\n        double b12_225683 = x_225681 - y_225682;\n        double x_225684 = defunc_2_reduce_res_225674 *\n               defunc_2_reduce_res_225676;\n        double y_225685 = defunc_2_reduce_res_225675 *\n               defunc_2_reduce_res_225675;\n        double c12_225686 = x_225684 - y_225685;\n        double x_225687 = defunc_2_reduce_res_225673 *\n               defunc_2_reduce_res_225677;\n        double b2_225688 = x_225687 - y_225685;\n        double x_225689 = defunc_2_reduce_res_225674 *\n               defunc_2_reduce_res_225675;\n        double y_225690 = defunc_2_reduce_res_225673 *\n               defunc_2_reduce_res_225676;\n        double c2_225691 = x_225689 - y_225690;\n        double x_225692 = defunc_2_reduce_res_225673 * a12_225680;\n        double y_225693 = defunc_2_reduce_res_225674 * b12_225683;\n        double x_225694 = x_225692 + y_225693;\n        double y_225695 = defunc_2_reduce_res_225675 * c12_225686;\n        double y_225696 = x_225694 + y_225695;\n        doubl",
            "e det_225697 = 1.0 / y_225696;\n        double a12_225698 = a12_225680 * det_225697;\n        double b12_225699 = b12_225683 * det_225697;\n        double c12_225700 = c12_225686 * det_225697;\n        double b2_225701 = b2_225688 * det_225697;\n        double c2_225702 = c2_225691 * det_225697;\n        \n        ((__global double *) mem_231467)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = a12_225698;\n        ((__global double *) mem_231471)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = b12_225699;\n        ((__global double *) mem_231475)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = c12_225700;\n        ((__global double *) mem_231479)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = b2_225701;\n        ((__global double *) mem_231483)[gtid_225670 * t_n_m_203740 +\n                                         gtid_225671] = c2_225702;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225663\n}\n__kernel void mainzisegmap_225963(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231519)\n{\n    #define segmap_group_sizze_225958 (mainzisegmap_group_sizze_225932)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_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_WID",
            "TH;\n    group_tid_236502 = get_group_id(0);\n    \n    int32_t phys_tid_225963 = global_tid_236500;\n    int64_t global_tid_236505 = sext_i32_i64(group_tid_236502) *\n            segmap_group_sizze_225958 + sext_i32_i64(local_tid_236501);\n    int64_t slice_236506 = n_203572;\n    int64_t slice_236507 = partition_sizze_203667 * slice_236506;\n    int64_t gtid_225961 = squot64(global_tid_236505, slice_236506);\n    int64_t remnant_236508 = global_tid_236505 - gtid_225961 * slice_236506;\n    int64_t gtid_225962 = remnant_236508;\n    int64_t remnant_236509 = remnant_236508 - gtid_225962;\n    \n    if (slt64(gtid_225961, partition_sizze_203667) && slt64(gtid_225962,\n                                                            n_203572)) {\n        double x_225964;\n        \n        x_225964 = ((__global double *) mem_229269)[gtid_225961 * n_203572 +\n                                                    gtid_225962];\n        \n        double x_225965;\n        \n        x_225965 = ((__global double *) mem_231028)[gtid_225961 * n_203572 +\n                                                    gtid_225962];\n        \n        double defunc_1_f_res_225966 = x_225964 - x_225965;\n        \n        ((__global double *) mem_231519)[gtid_225961 * n_203572 + gtid_225962] =\n            defunc_1_f_res_225966;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225958\n}\n__kernel void mainzisegmap_225980(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned ch",
            "ar *mem_param_229601, __global\n                                  unsigned char *mem_231519, __global\n                                  unsigned char *mem_231524, __global\n                                  unsigned char *mem_231528)\n{\n    #define segmap_group_sizze_225974 (mainzisegmap_group_sizze_225876)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236510;\n    int32_t local_tid_236511;\n    int64_t group_sizze_236514;\n    int32_t wave_sizze_236513;\n    int32_t group_tid_236512;\n    \n    global_tid_236510 = get_global_id(0);\n    local_tid_236511 = get_local_id(0);\n    group_sizze_236514 = get_local_size(0);\n    wave_sizze_236513 = LOCKSTEP_WIDTH;\n    group_tid_236512 = get_group_id(0);\n    \n    int32_t phys_tid_225980 = global_tid_236510;\n    int64_t global_tid_236515 = sext_i32_i64(group_tid_236512) *\n            segmap_group_sizze_225974 + sext_i32_i64(local_tid_236511);\n    int64_t slice_236516 = n_203572;\n    int64_t slice_236517 = partition_sizze_203667 * slice_236516;\n    int64_t gtid_225978 = squot64(global_tid_236515, slice_236516);\n    int64_t remnant_236518 = global_tid_236515 - gtid_225978 * slice_236516;\n    int64_t gtid_225979 = remnant_236518;\n    int64_t remnant_236519 = remnant_236518 - gtid_225979;\n    \n    if (slt64(gtid_225978, partition_sizze_203667) && slt64(gtid_225979,\n                                                            n_203572)) {\n        int64_t x_225983;\n        \n        x_225983 = ((__global int64_t *) ext_mem_229305)[gtid_225978 *\n                                                         n_203572 +\n                                                         gtid_225979];\n        \n        bool cond_225984 = sle64((int64_t) 0, x_225983);\n        double defunc_0_f_res_225985;\n        \n        if (cond_225984) {\n            bool y_225986 = slt64(x_225983, n_203572);\n            bool bounds_check_225987 = cond_225",
            "984 && y_225986;\n            bool index_certs_225988;\n            \n            if (!bounds_check_225987) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 64) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225983;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225989;\n            \n            defunc_0_f_res_t_res_225989 = ((__global\n                                            double *) mem_231519)[gtid_225978 *\n                                                                  n_203572 +\n                                                                  x_225983];\n            defunc_0_f_res_225985 = defunc_0_f_res_t_res_225989;\n        } else {\n            defunc_0_f_res_225985 = 0.0;\n        }\n        \n        double defunc_0_f_res_225990;\n        \n        if (cond_225984) {\n            bool y_225991 = slt64(x_225983, n_203572);\n            bool bounds_check_225992 = cond_225984 && y_225991;\n            bool index_certs_225993;\n            \n            if (!bounds_check_225992) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 65) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225983;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225994;\n            \n            defunc_0_f_res_t_res_225994 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_225978 *\n                                                        ",
            "                 ctx_param_ext_229597 +\n                                                                         x_225983 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_225990 = defunc_0_f_res_t_res_225994;\n        } else {\n            defunc_0_f_res_225990 = 0.0;\n        }\n        ((__global double *) mem_231524)[gtid_225978 * n_203572 + gtid_225979] =\n            defunc_0_f_res_225990;\n        ((__global double *) mem_231528)[gtid_225978 * n_203572 + gtid_225979] =\n            defunc_0_f_res_225985;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225974\n}\n__kernel void mainzisegmap_226275(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231543)\n{\n    #define segmap_group_sizze_226270 (mainzisegmap_group_sizze_226244)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236540;\n    int32_t local_tid_236541;\n    int64_t group_sizze_236544;\n    int32_t wave_sizze_236543;\n    int32_t group_tid_236542;\n    \n    global_tid_236540 = get_global_id(0);\n    local_tid_236541 = get_local_id(0);\n    group_sizze_236544 = get_local_size(0);\n    wave_sizze_236543 = LOCKSTEP_WIDTH;\n    group_tid_236542 = get_group_id(0);\n    \n    int32_t phys_tid_226275 = global_tid_236540;\n    int64_t global_tid_236545 = sext_i32_i64(group_tid_236542) *\n            segmap_group_sizze_226270 + sext_i32_i64(local_tid_236541);\n    int64_t slice_236546 = n_203572;\n    int64_t slice_236547 = partition_sizze_203667 * slice_236546;\n    int64_t gtid_226273 = squot64(global_tid_236545, slice_236546",
            ");\n    int64_t remnant_236548 = global_tid_236545 - gtid_226273 * slice_236546;\n    int64_t gtid_226274 = remnant_236548;\n    int64_t remnant_236549 = remnant_236548 - gtid_226274;\n    \n    if (slt64(gtid_226273, partition_sizze_203667) && slt64(gtid_226274,\n                                                            n_203572)) {\n        double x_226276;\n        \n        x_226276 = ((__global double *) mem_229269)[gtid_226273 * n_203572 +\n                                                    gtid_226274];\n        \n        double x_226277;\n        \n        x_226277 = ((__global double *) mem_231028)[gtid_226273 * n_203572 +\n                                                    gtid_226274];\n        \n        double defunc_1_f_res_226278 = x_226276 - x_226277;\n        \n        ((__global double *) mem_231543)[gtid_226273 * n_203572 + gtid_226274] =\n            defunc_1_f_res_226278;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226270\n}\n__kernel void mainzisegmap_226292(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231543, __global\n                                  unsigned char *mem_231548, __global\n                                  unsigned char *mem_231552)\n{\n    #define segmap_group_sizze_226286 (mainzisegmap_group_sizze_226188)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n  ",
            "  \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236550;\n    int32_t local_tid_236551;\n    int64_t group_sizze_236554;\n    int32_t wave_sizze_236553;\n    int32_t group_tid_236552;\n    \n    global_tid_236550 = get_global_id(0);\n    local_tid_236551 = get_local_id(0);\n    group_sizze_236554 = get_local_size(0);\n    wave_sizze_236553 = LOCKSTEP_WIDTH;\n    group_tid_236552 = get_group_id(0);\n    \n    int32_t phys_tid_226292 = global_tid_236550;\n    int64_t global_tid_236555 = sext_i32_i64(group_tid_236552) *\n            segmap_group_sizze_226286 + sext_i32_i64(local_tid_236551);\n    int64_t slice_236556 = n_203572;\n    int64_t slice_236557 = partition_sizze_203667 * slice_236556;\n    int64_t gtid_226290 = squot64(global_tid_236555, slice_236556);\n    int64_t remnant_236558 = global_tid_236555 - gtid_226290 * slice_236556;\n    int64_t gtid_226291 = remnant_236558;\n    int64_t remnant_236559 = remnant_236558 - gtid_226291;\n    \n    if (slt64(gtid_226290, partition_sizze_203667) && slt64(gtid_226291,\n                                                            n_203572)) {\n        int64_t x_226295;\n        \n        x_226295 = ((__global int64_t *) ext_mem_229305)[gtid_226290 *\n                                                         n_203572 +\n                                                         gtid_226291];\n        \n        bool cond_226296 = sle64((int64_t) 0, x_226295);\n        double defunc_0_f_res_226297;\n        \n        if (cond_226296) {\n            bool y_226298 = slt64(x_226295, n_203572);\n            bool bounds_check_226299 = cond_226296 && y_226298;\n            bool index_certs_226300;\n            \n            if (!bounds_check_226299) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 66) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226295;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n       ",
            "             }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226301;\n            \n            defunc_0_f_res_t_res_226301 = ((__global\n                                            double *) mem_231543)[gtid_226290 *\n                                                                  n_203572 +\n                                                                  x_226295];\n            defunc_0_f_res_226297 = defunc_0_f_res_t_res_226301;\n        } else {\n            defunc_0_f_res_226297 = 0.0;\n        }\n        \n        double defunc_0_f_res_226302;\n        \n        if (cond_226296) {\n            bool y_226303 = slt64(x_226295, n_203572);\n            bool bounds_check_226304 = cond_226296 && y_226303;\n            bool index_certs_226305;\n            \n            if (!bounds_check_226304) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 67) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226295;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226306;\n            \n            defunc_0_f_res_t_res_226306 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_226290 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_226295 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_226302 = defunc_0_f_res_t_res_226306;\n        } else {\n            defunc_0_f_res_226302 = 0.0;\n        }\n        ((__global double *) mem_231548)[gtid_226",
            "290 * n_203572 + gtid_226291] =\n            defunc_0_f_res_226302;\n        ((__global double *) mem_231552)[gtid_226290 * n_203572 + gtid_226291] =\n            defunc_0_f_res_226297;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226286\n}\n__kernel void mainzisegmap_226679(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_231028, __global\n                                  unsigned char *mem_231574)\n{\n    #define segmap_group_sizze_226674 (mainzisegmap_group_sizze_226648)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236586;\n    int32_t local_tid_236587;\n    int64_t group_sizze_236590;\n    int32_t wave_sizze_236589;\n    int32_t group_tid_236588;\n    \n    global_tid_236586 = get_global_id(0);\n    local_tid_236587 = get_local_id(0);\n    group_sizze_236590 = get_local_size(0);\n    wave_sizze_236589 = LOCKSTEP_WIDTH;\n    group_tid_236588 = get_group_id(0);\n    \n    int32_t phys_tid_226679 = global_tid_236586;\n    int64_t global_tid_236591 = sext_i32_i64(group_tid_236588) *\n            segmap_group_sizze_226674 + sext_i32_i64(local_tid_236587);\n    int64_t slice_236592 = n_203572;\n    int64_t slice_236593 = partition_sizze_203667 * slice_236592;\n    int64_t gtid_226677 = squot64(global_tid_236591, slice_236592);\n    int64_t remnant_236594 = global_tid_236591 - gtid_226677 * slice_236592;\n    int64_t gtid_226678 = remnant_236594;\n    int64_t remnant_236595 = remnant_236594 - gtid_226678;\n    \n    if (slt64(gtid_226677, partition_sizze_203667) && slt64(gtid_226678,\n                                                            n_203572)) {\n        double x_226680;\n        \n        x_226680 = ((__global double ",
            "*) mem_229269)[gtid_226677 * n_203572 +\n                                                    gtid_226678];\n        \n        double x_226681;\n        \n        x_226681 = ((__global double *) mem_231028)[gtid_226677 * n_203572 +\n                                                    gtid_226678];\n        \n        double defunc_1_f_res_226682 = x_226680 - x_226681;\n        \n        ((__global double *) mem_231574)[gtid_226677 * n_203572 + gtid_226678] =\n            defunc_1_f_res_226682;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226674\n}\n__kernel void mainzisegmap_226696(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ctx_param_ext_229596,\n                                  int64_t ctx_param_ext_229597,\n                                  int64_t ctx_param_ext_229599, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_param_229601, __global\n                                  unsigned char *mem_231574, __global\n                                  unsigned char *mem_231579, __global\n                                  unsigned char *mem_231583)\n{\n    #define segmap_group_sizze_226690 (mainzisegmap_group_sizze_226592)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236596;\n    int32_t local_tid_236597;\n    int64_t group_sizze_236600;\n    int32_t wave_sizze_236599;\n    int32_t group_tid_236598;\n    \n    global_tid_236596 = get_global_id(0);\n    local_tid_236597 = get_local_id(0);\n    group_sizze_236600 = get_local_size(0);\n    wave_sizze_236599 = LOCKSTEP_WIDTH;\n    group_tid_236598 = g",
            "et_group_id(0);\n    \n    int32_t phys_tid_226696 = global_tid_236596;\n    int64_t global_tid_236601 = sext_i32_i64(group_tid_236598) *\n            segmap_group_sizze_226690 + sext_i32_i64(local_tid_236597);\n    int64_t slice_236602 = n_203572;\n    int64_t slice_236603 = partition_sizze_203667 * slice_236602;\n    int64_t gtid_226694 = squot64(global_tid_236601, slice_236602);\n    int64_t remnant_236604 = global_tid_236601 - gtid_226694 * slice_236602;\n    int64_t gtid_226695 = remnant_236604;\n    int64_t remnant_236605 = remnant_236604 - gtid_226695;\n    \n    if (slt64(gtid_226694, partition_sizze_203667) && slt64(gtid_226695,\n                                                            n_203572)) {\n        int64_t x_226699;\n        \n        x_226699 = ((__global int64_t *) ext_mem_229305)[gtid_226694 *\n                                                         n_203572 +\n                                                         gtid_226695];\n        \n        bool cond_226700 = sle64((int64_t) 0, x_226699);\n        double defunc_0_f_res_226701;\n        \n        if (cond_226700) {\n            bool y_226702 = slt64(x_226699, n_203572);\n            bool bounds_check_226703 = cond_226700 && y_226702;\n            bool index_certs_226704;\n            \n            if (!bounds_check_226703) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 68) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226699;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226705;\n            \n            defunc_0_f_res_t_res_226705 = ((__global\n                                            double *) mem_231574)[gtid_226694 *\n                                                                  n_203572 +\n                                            ",
            "                      x_226699];\n            defunc_0_f_res_226701 = defunc_0_f_res_t_res_226705;\n        } else {\n            defunc_0_f_res_226701 = 0.0;\n        }\n        \n        double defunc_0_f_res_226706;\n        \n        if (cond_226700) {\n            bool y_226707 = slt64(x_226699, n_203572);\n            bool bounds_check_226708 = cond_226700 && y_226707;\n            bool index_certs_226709;\n            \n            if (!bounds_check_226708) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 69) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226699;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226710;\n            \n            defunc_0_f_res_t_res_226710 = ((__global\n                                            double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                        (gtid_226694 *\n                                                                         ctx_param_ext_229597 +\n                                                                         x_226699 *\n                                                                         ctx_param_ext_229599)];\n            defunc_0_f_res_226706 = defunc_0_f_res_t_res_226710;\n        } else {\n            defunc_0_f_res_226706 = 0.0;\n        }\n        ((__global double *) mem_231579)[gtid_226694 * n_203572 + gtid_226695] =\n            defunc_0_f_res_226706;\n        ((__global double *) mem_231583)[gtid_226694 * n_203572 + gtid_226695] =\n            defunc_0_f_res_226701;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226690\n}\n__kernel void mainzisegmap_226984(__global int *global_failure,\n                                  int failure_is_an_option, __global\n              ",
            "                    int64_t *global_failure_args,\n                                  int64_t n_203572, int64_t jump_t_203582,\n                                  int64_t partition_sizze_203667,\n                                  int64_t t_n_m_203740, int64_t i_203760,\n                                  int64_t y_206673, __global\n                                  unsigned char *ext_mem_231612, __global\n                                  unsigned char *ext_mem_231613, __global\n                                  unsigned char *mem_231618)\n{\n    #define segmap_group_sizze_226979 (mainzisegmap_group_sizze_226861)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236636;\n    int32_t local_tid_236637;\n    int64_t group_sizze_236640;\n    int32_t wave_sizze_236639;\n    int32_t group_tid_236638;\n    \n    global_tid_236636 = get_global_id(0);\n    local_tid_236637 = get_local_id(0);\n    group_sizze_236640 = get_local_size(0);\n    wave_sizze_236639 = LOCKSTEP_WIDTH;\n    group_tid_236638 = get_group_id(0);\n    \n    int32_t phys_tid_226984 = global_tid_236636;\n    int64_t global_tid_236641 = sext_i32_i64(group_tid_236638) *\n            segmap_group_sizze_226979 + sext_i32_i64(local_tid_236637);\n    int64_t slice_236642 = n_203572;\n    int64_t slice_236643 = partition_sizze_203667 * slice_236642;\n    int64_t gtid_226982 = squot64(global_tid_236641, slice_236642);\n    int64_t remnant_236644 = global_tid_236641 - gtid_226982 * slice_236642;\n    int64_t gtid_226983 = remnant_236644;\n    int64_t remnant_236645 = remnant_236644 - gtid_226983;\n    \n    if (slt64(gtid_226982, partition_sizze_203667) && slt64(gtid_226983,\n                                                            n_203572)) {\n        int64_t m_v_226988 = sdiv64(gtid_226983, jump_t_203582);\n        bool cond_226989 = m_v_226988 == y_206673;\n        int64_t j_226990;\n        \n        if (cond_226989) {\n      ",
            "      int64_t j_t_res_226991 = sub64(m_v_226988, (int64_t) 1);\n            \n            j_226990 = j_t_res_226991;\n        } else {\n            j_226990 = m_v_226988;\n        }\n        \n        int64_t min_arg_226992 = mul64(jump_t_203582, j_226990);\n        int64_t min_res_226993 = smin64(i_203760, min_arg_226992);\n        int64_t defunc_0_m_fun_arg_226994 = add64((int64_t) 1, j_226990);\n        int64_t min_arg_226995 = mul64(jump_t_203582,\n                                       defunc_0_m_fun_arg_226994);\n        int64_t min_res_226996 = smin64(i_203760, min_arg_226995);\n        int64_t i64_arg_226997 = sub64(min_res_226996, min_res_226993);\n        double i64_res_226998 = sitofp_i64_f64(i64_arg_226997);\n        int64_t i64_arg_226999 = sub64(gtid_226983, min_res_226993);\n        double i64_res_227000 = sitofp_i64_f64(i64_arg_226999);\n        double u_227001 = i64_res_227000 / i64_res_226998;\n        double u2_227002 = u_227001 * u_227001;\n        double u3_227003 = u_227001 * u2_227002;\n        double x_227004 = 2.0 * u3_227003;\n        double y_227005 = 3.0 * u2_227002;\n        double x_227006 = x_227004 - y_227005;\n        double x_227007 = 1.0 + x_227006;\n        bool x_227008 = sle64((int64_t) 0, j_226990);\n        bool y_227009 = slt64(j_226990, t_n_m_203740);\n        bool bounds_check_227010 = x_227008 && y_227009;\n        bool index_certs_227011;\n        \n        if (!bounds_check_227010) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 70) == -1) {\n                    global_failure_args[0] = (int64_t) j_226990;\n                    global_failure_args[1] = (int64_t) t_n_m_203740;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_227012;\n        \n        y_227012 = ((__global double *) ext_mem_231613)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        j_226990];\n        \n ",
            "       double x_227013 = x_227007 * y_227012;\n        double x_227014 = y_227005 - x_227004;\n        bool x_227015 = sle64((int64_t) 0, defunc_0_m_fun_arg_226994);\n        bool y_227016 = slt64(defunc_0_m_fun_arg_226994, t_n_m_203740);\n        bool bounds_check_227017 = x_227015 && y_227016;\n        bool index_certs_227018;\n        \n        if (!bounds_check_227017) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 71) == -1) {\n                    global_failure_args[0] =\n                        (int64_t) defunc_0_m_fun_arg_226994;\n                    global_failure_args[1] = (int64_t) t_n_m_203740;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_227019;\n        \n        y_227019 = ((__global double *) ext_mem_231613)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        defunc_0_m_fun_arg_226994];\n        \n        double y_227020 = x_227014 * y_227019;\n        double x_227021 = x_227013 + y_227020;\n        double y_227022 = 2.0 * u2_227002;\n        double x_227023 = u3_227003 - y_227022;\n        double x_227024 = u_227001 + x_227023;\n        double y_227025;\n        \n        y_227025 = ((__global double *) ext_mem_231612)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        j_226990];\n        \n        double x_227026 = x_227024 * y_227025;\n        double y_227027 = i64_res_226998 * x_227026;\n        double x_227028 = x_227021 + y_227027;\n        double x_227029 = u3_227003 - u2_227002;\n        double y_227030;\n        \n        y_227030 = ((__global double *) ext_mem_231612)[gtid_226982 *\n                                                        t_n_m_203740 +\n                                                        defunc_0_m_fun_arg_226994];\n        \n        double x_227031 = x_227029 * y_227030;\n  ",
            "      double y_227032 = i64_res_226998 * x_227031;\n        double defunc_4_interpolate_proc_res_227033 = x_227028 + y_227032;\n        \n        ((__global double *) mem_231618)[gtid_226982 * n_203572 + gtid_226983] =\n            defunc_4_interpolate_proc_res_227033;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226979\n}\n__kernel void mainzisegmap_227201(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t ext_231630, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *ext_mem_231625, __global\n                                  unsigned char *ext_mem_231626, __global\n                                  unsigned char *mem_231662)\n{\n    #define segmap_group_sizze_227196 (mainzisegmap_group_sizze_227160)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236658;\n    int32_t local_tid_236659;\n    int64_t group_sizze_236662;\n    int32_t wave_sizze_236661;\n    int32_t group_tid_236660;\n    \n    global_tid_236658 = get_global_id(0);\n    local_tid_236659 = get_local_id(0);\n    group_sizze_236662 = get_local_size(0);\n    wave_sizze_236661 = LOCKSTEP_WIDTH;\n    group_tid_236660 = get_group_id(0);\n    \n    int32_t phys_tid_227201 = global_tid_236658;\n    int64_t global_tid_236663 = sext_i32_i64(group_tid_236660) *\n            segmap_group_sizze_227196 + sext_i32_i64(local_tid_236659);\n    int64_t slice_236664 = n_203572;\n    int64_t slice_236665 = partition_sizze_203667 * slice_236664;\n    int64_t gtid_227199 = squot64(global_tid_236663, slice_236664);\n    int64_t remnant_236666 = global_tid_236663 - gtid_227199 * slice_236664;\n    int64_t gtid_227200 = remnant_236666;\n    int64_t remnant_236667 = remnant_236666 - gtid_227200;\n    \n  ",
            "  if (slt64(gtid_227199, partition_sizze_203667) && slt64(gtid_227200,\n                                                            n_203572)) {\n        double x_227202;\n        \n        x_227202 = ((__global double *) mem_229269)[gtid_227199 * n_203572 +\n                                                    gtid_227200];\n        \n        double x_227203;\n        \n        x_227203 = ((__global double *) ext_mem_231626)[gtid_227199 * n_203572 +\n                                                        gtid_227200];\n        \n        double x_227204;\n        \n        x_227204 = ((__global double *) ext_mem_231625)[gtid_227199 *\n                                                        ext_231630 +\n                                                        gtid_227200];\n        \n        double x_227205 = x_227202 - x_227203;\n        double defunc_2_f_res_227206 = x_227205 - x_227204;\n        bool isnan_res_227207;\n        \n        isnan_res_227207 = futrts_isnan64(defunc_2_f_res_227206);\n        \n        double defunc_0_f_res_227208;\n        \n        if (isnan_res_227207) {\n            defunc_0_f_res_227208 = defunc_2_f_res_227206;\n        } else {\n            double abs_res_227209 = fabs(defunc_2_f_res_227206);\n            \n            defunc_0_f_res_227208 = abs_res_227209;\n        }\n        ((__global double *) mem_231662)[gtid_227199 * n_203572 + gtid_227200] =\n            defunc_0_f_res_227208;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227196\n}\n__kernel void mainzisegmap_227222(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_229305, __global\n                                  unsigned char *mem_231662, __global\n                                  unsigned char *m",
            "em_231667)\n{\n    #define segmap_group_sizze_227217 (mainzisegmap_group_sizze_227117)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236668;\n    int32_t local_tid_236669;\n    int64_t group_sizze_236672;\n    int32_t wave_sizze_236671;\n    int32_t group_tid_236670;\n    \n    global_tid_236668 = get_global_id(0);\n    local_tid_236669 = get_local_id(0);\n    group_sizze_236672 = get_local_size(0);\n    wave_sizze_236671 = LOCKSTEP_WIDTH;\n    group_tid_236670 = get_group_id(0);\n    \n    int32_t phys_tid_227222 = global_tid_236668;\n    int64_t global_tid_236673 = sext_i32_i64(group_tid_236670) *\n            segmap_group_sizze_227217 + sext_i32_i64(local_tid_236669);\n    int64_t slice_236674 = n_203572;\n    int64_t slice_236675 = partition_sizze_203667 * slice_236674;\n    int64_t gtid_227220 = squot64(global_tid_236673, slice_236674);\n    int64_t remnant_236676 = global_tid_236673 - gtid_227220 * slice_236674;\n    int64_t gtid_227221 = remnant_236676;\n    int64_t remnant_236677 = remnant_236676 - gtid_227221;\n    \n    if (slt64(gtid_227220, partition_sizze_203667) && slt64(gtid_227221,\n                                                            n_203572)) {\n        int64_t x_227224;\n        \n        x_227224 = ((__global int64_t *) ext_mem_229305)[gtid_227220 *\n                                                         n_203572 +\n                                                         gtid_227221];\n        \n        bool cond_227225 = sle64((int64_t) 0, x_227224);\n        double defunc_0_f_res_227226;\n        \n        if (cond_227225) {\n            bool y_227227 = slt64(x_227224, n_203572);\n            bool bounds_check_227228 = cond_227225 && y_227227;\n            bool index_certs_227229;\n            \n            if (!bounds_check_227228) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 73) ==\n                   ",
            "     -1) {\n                        global_failure_args[0] = (int64_t) x_227224;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_227230;\n            \n            defunc_0_f_res_t_res_227230 = ((__global\n                                            double *) mem_231662)[gtid_227220 *\n                                                                  n_203572 +\n                                                                  x_227224];\n            defunc_0_f_res_227226 = defunc_0_f_res_t_res_227230;\n        } else {\n            defunc_0_f_res_227226 = INFINITY;\n        }\n        ((__global double *) mem_231667)[gtid_227220 * n_203572 + gtid_227221] =\n            defunc_0_f_res_227226;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227217\n}\n__kernel void mainzisegmap_227351(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t i_203760, int32_t iters_206755,\n                                  int64_t num_groups_227347,\n                                  int64_t num_threads_232339, __global\n                                  unsigned char *mem_231672, __global\n                                  unsigned char *mem_231782, __global\n                                  unsigned char *color_232173, __global\n                                  unsigned char *color_232174, __global\n                                  unsigned char *color_232175, __global\n                                  unsigned char *color_232176, __global\n                                  unsigned char *color_232177, __global\n                                  unsigned char *color_232178, __global\n                                  unsigned char *color_232179)\n{\n    #define segmap_group_sizze",
            "_227346 (mainzisegmap_group_sizze_227248)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236681;\n    int32_t local_tid_236682;\n    int64_t group_sizze_236685;\n    int32_t wave_sizze_236684;\n    int32_t group_tid_236683;\n    \n    global_tid_236681 = get_global_id(0);\n    local_tid_236682 = get_local_id(0);\n    group_sizze_236685 = get_local_size(0);\n    wave_sizze_236684 = LOCKSTEP_WIDTH;\n    group_tid_236683 = get_group_id(0);\n    \n    int32_t phys_tid_227351 = global_tid_236681;\n    int32_t phys_group_id_236686;\n    \n    phys_group_id_236686 = get_group_id(0);\n    for (int32_t i_236687 = 0; i_236687 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_227346)) -\n                   phys_group_id_236686, sext_i64_i32(num_groups_227347));\n         i_236687++) {\n        int32_t virt_group_id_236688 = phys_group_id_236686 + i_236687 *\n                sext_i64_i32(num_groups_227347);\n        int64_t global_tid_236689 = sext_i32_i64(virt_group_id_236688) *\n                segmap_group_sizze_227346 + sext_i32_i64(local_tid_236682);\n        int64_t slice_236690 = partition_sizze_203667;\n        int64_t gtid_227350 = global_tid_236689;\n        int64_t remnant_236691 = global_tid_236689 - gtid_227350;\n        \n        if (slt64(gtid_227350, partition_sizze_203667)) {\n            for (int64_t i_236692 = 0; i_236692 < n_203572; i_236692++) {\n                double tmp_236693;\n                \n                tmp_236693 = ((__global double *) mem_231672)[gtid_227350 +\n                                                              i_236692 *\n                                                              partition_sizze_203667];\n                ((__global double *) color_232173)[phys_tid_227351 + i_236692 *\n                                                   num_threads_232339] =\n    ",
            "                tmp_236693;\n            }\n            \n            __global unsigned char *ext_mem_231775;\n            __global unsigned char *ext_mem_unused_232066;\n            __global unsigned char *mem_param_231682;\n            __global unsigned char *mem_param_out_232067;\n            \n            mem_param_231682 = color_232173;\n            mem_param_out_232067 = color_232174;\n            for (int32_t i_227354 = 0; i_227354 < iters_206755; i_227354++) {\n                int32_t defunc_2_radix_sort_step_arg_227356 = mul32(2,\n                                                                    i_227354);\n                int32_t defunc_0_get_bit_arg_227357 = add32(1,\n                                                            defunc_2_radix_sort_step_arg_227356);\n                bool cond_f_res_227358 = defunc_0_get_bit_arg_227357 == 63;\n                bool cond_f_res_227359 = defunc_2_radix_sort_step_arg_227356 ==\n                     63;\n                int64_t unsign_arg_227360 =\n                        zext_i32_i64(defunc_0_get_bit_arg_227357);\n                int64_t unsign_arg_227361 =\n                        zext_i32_i64(defunc_2_radix_sort_step_arg_227356);\n                int64_t discard_229166;\n                int64_t discard_229167;\n                int64_t discard_229168;\n                int64_t discard_229169;\n                int64_t scanacc_229151;\n                int64_t scanacc_229152;\n                int64_t scanacc_229153;\n                int64_t scanacc_229154;\n                \n                scanacc_229151 = (int64_t) 0;\n                scanacc_229152 = (int64_t) 0;\n                scanacc_229153 = (int64_t) 0;\n                scanacc_229154 = (int64_t) 0;\n                for (int64_t i_229160 = 0; i_229160 < n_203572; i_229160++) {\n                    double x_227379;\n                    \n                    x_227379 = ((__global\n                                 double *) mem_param_231682)[phys_tid_227351 +\n                                     ",
            "                        i_229160 *\n                                                             num_threads_232339];\n                    \n                    int64_t i64_arg_227380;\n                    \n                    i64_arg_227380 = futrts_to_bits64(x_227379);\n                    \n                    int64_t unsign_arg_227381 = ashr64(i64_arg_227380,\n                                                       unsign_arg_227360);\n                    int64_t unsign_arg_227382 = (int64_t) 1 & unsign_arg_227381;\n                    int32_t to_i32_res_227383 = zext_i64_i32(unsign_arg_227382);\n                    int64_t unsign_arg_227384 = ashr64(i64_arg_227380,\n                                                       (int64_t) 63);\n                    int64_t unsign_arg_227385 = (int64_t) 1 & unsign_arg_227384;\n                    int32_t to_i32_res_227386 = zext_i64_i32(unsign_arg_227385);\n                    bool cond_227387 = to_i32_res_227386 == 1;\n                    bool x_227388 = !cond_227387;\n                    bool y_227389 = cond_f_res_227358 && x_227388;\n                    bool cond_227390 = cond_227387 || y_227389;\n                    int32_t defunc_1_get_bit_res_227391;\n                    \n                    if (cond_227390) {\n                        int32_t defunc_1_get_bit_res_t_res_227392 = 1 ^\n                                to_i32_res_227383;\n                        \n                        defunc_1_get_bit_res_227391 =\n                            defunc_1_get_bit_res_t_res_227392;\n                    } else {\n                        defunc_1_get_bit_res_227391 = to_i32_res_227383;\n                    }\n                    \n                    int32_t x_227393 = mul32(2, defunc_1_get_bit_res_227391);\n                    int64_t unsign_arg_227394 = ashr64(i64_arg_227380,\n                                                       unsign_arg_227361);\n                    int64_t unsign_arg_227395 = (int64_t) 1 & unsign_arg_227394;\n                    int3",
            "2_t to_i32_res_227396 = zext_i64_i32(unsign_arg_227395);\n                    bool y_227397 = cond_f_res_227359 && x_227388;\n                    bool cond_227398 = cond_227387 || y_227397;\n                    int32_t defunc_1_get_bit_res_227399;\n                    \n                    if (cond_227398) {\n                        int32_t defunc_1_get_bit_res_t_res_227400 = 1 ^\n                                to_i32_res_227396;\n                        \n                        defunc_1_get_bit_res_227399 =\n                            defunc_1_get_bit_res_t_res_227400;\n                    } else {\n                        defunc_1_get_bit_res_227399 = to_i32_res_227396;\n                    }\n                    \n                    int32_t defunc_0_f_res_227401 = add32(x_227393,\n                                                          defunc_1_get_bit_res_227399);\n                    bool cond_227402 = defunc_0_f_res_227401 == 0;\n                    int64_t defunc_0_f_res_227403 = btoi_bool_i64(cond_227402);\n                    int64_t defunc_0_f_res_227404;\n                    int64_t defunc_0_f_res_227405;\n                    int64_t defunc_0_f_res_227406;\n                    \n                    if (cond_227402) {\n                        defunc_0_f_res_227404 = (int64_t) 0;\n                        defunc_0_f_res_227405 = (int64_t) 0;\n                        defunc_0_f_res_227406 = (int64_t) 0;\n                    } else {\n                        bool cond_227407 = defunc_0_f_res_227401 == 1;\n                        int64_t defunc_0_f_res_f_res_227408 =\n                                btoi_bool_i64(cond_227407);\n                        int64_t defunc_0_f_res_f_res_227409;\n                        int64_t defunc_0_f_res_f_res_227410;\n                        \n                        if (cond_227407) {\n                            defunc_0_f_res_f_res_227409 = (int64_t) 0;\n                            defunc_0_f_res_f_res_227410 = (int64_t) 0;\n                        } else {",
            "\n                            bool cond_227411 = defunc_0_f_res_227401 == 2;\n                            int64_t defunc_0_f_res_f_res_f_res_227412 =\n                                    btoi_bool_i64(cond_227411);\n                            bool cond_neg_227413 = !cond_227411;\n                            int64_t defunc_0_f_res_f_res_f_res_227414 =\n                                    btoi_bool_i64(cond_neg_227413);\n                            \n                            defunc_0_f_res_f_res_227409 =\n                                defunc_0_f_res_f_res_f_res_227412;\n                            defunc_0_f_res_f_res_227410 =\n                                defunc_0_f_res_f_res_f_res_227414;\n                        }\n                        defunc_0_f_res_227404 = defunc_0_f_res_f_res_227408;\n                        defunc_0_f_res_227405 = defunc_0_f_res_f_res_227409;\n                        defunc_0_f_res_227406 = defunc_0_f_res_f_res_227410;\n                    }\n                    \n                    int64_t defunc_1_op_res_227375 =\n                            add64(defunc_0_f_res_227403, scanacc_229151);\n                    int64_t defunc_1_op_res_227376 =\n                            add64(defunc_0_f_res_227404, scanacc_229152);\n                    int64_t defunc_1_op_res_227377 =\n                            add64(defunc_0_f_res_227405, scanacc_229153);\n                    int64_t defunc_1_op_res_227378 =\n                            add64(defunc_0_f_res_227406, scanacc_229154);\n                    \n                    ((__global int64_t *) color_232179)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227375;\n                    ((__global int64_t *) color_232178)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads",
            "_232339] =\n                        defunc_1_op_res_227376;\n                    ((__global int64_t *) color_232177)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227377;\n                    ((__global int64_t *) color_232176)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_1_op_res_227378;\n                    ((__global int32_t *) color_232175)[phys_tid_227351 +\n                                                        i_229160 *\n                                                        num_threads_232339] =\n                        defunc_0_f_res_227401;\n                    \n                    int64_t scanacc_tmp_236697 = defunc_1_op_res_227375;\n                    int64_t scanacc_tmp_236698 = defunc_1_op_res_227376;\n                    int64_t scanacc_tmp_236699 = defunc_1_op_res_227377;\n                    int64_t scanacc_tmp_236700 = defunc_1_op_res_227378;\n                    \n                    scanacc_229151 = scanacc_tmp_236697;\n                    scanacc_229152 = scanacc_tmp_236698;\n                    scanacc_229153 = scanacc_tmp_236699;\n                    scanacc_229154 = scanacc_tmp_236700;\n                }\n                discard_229166 = scanacc_229151;\n                discard_229167 = scanacc_229152;\n                discard_229168 = scanacc_229153;\n                discard_229169 = scanacc_229154;\n                \n                int64_t last_res_227415;\n                \n                last_res_227415 = ((__global\n                                    int64_t *) color_232179)[phys_tid_227351 +\n                                                             i_203760 *\n                                                             num_threads_232339];\n            ",
            "    \n                int64_t last_res_227416;\n                \n                last_res_227416 = ((__global\n                                    int64_t *) color_232178)[phys_tid_227351 +\n                                                             i_203760 *\n                                                             num_threads_232339];\n                \n                int64_t last_res_227417;\n                \n                last_res_227417 = ((__global\n                                    int64_t *) color_232177)[phys_tid_227351 +\n                                                             i_203760 *\n                                                             num_threads_232339];\n                for (int64_t i_236706 = 0; i_236706 < n_203572; i_236706++) {\n                    double tmp_236707;\n                    \n                    tmp_236707 = ((__global\n                                   double *) mem_param_231682)[phys_tid_227351 +\n                                                               i_236706 *\n                                                               num_threads_232339];\n                    ((__global double *) mem_param_out_232067)[phys_tid_227351 +\n                                                               i_236706 *\n                                                               num_threads_232339] =\n                        tmp_236707;\n                }\n                for (int64_t write_iter_229170 = 0; write_iter_229170 <\n                     n_203572; write_iter_229170++) {\n                    int32_t write_iv_229172;\n                    \n                    write_iv_229172 = ((__global\n                                        int32_t *) color_232175)[phys_tid_227351 +\n                                                                 write_iter_229170 *\n                                                                 num_threads_232339];\n                    \n                    bool match_lit_227426 = 0 == write_iv_229172;\n         ",
            "           int64_t defunc_1_f_res_227427;\n                    \n                    if (match_lit_227426) {\n                        int64_t write_iv_229173;\n                        \n                        write_iv_229173 = ((__global\n                                            int64_t *) color_232179)[phys_tid_227351 +\n                                                                     write_iter_229170 *\n                                                                     num_threads_232339];\n                        \n                        int64_t case_res_227428 = sub64(write_iv_229173,\n                                                        (int64_t) 1);\n                        \n                        defunc_1_f_res_227427 = case_res_227428;\n                    } else {\n                        bool match_lit_227429 = 1 == write_iv_229172;\n                        int64_t x_227430;\n                        \n                        if (match_lit_227429) {\n                            int64_t write_iv_229174;\n                            \n                            write_iv_229174 = ((__global\n                                                int64_t *) color_232178)[phys_tid_227351 +\n                                                                         write_iter_229170 *\n                                                                         num_threads_232339];\n                            \n                            int64_t x_227431 = add64(last_res_227415,\n                                                     write_iv_229174);\n                            int64_t case_res_227432 = sub64(x_227431,\n                                                            (int64_t) 1);\n                            \n                            x_227430 = case_res_227432;\n                        } else {\n                            bool match_lit_227433 = 2 == write_iv_229172;\n                            int64_t x_227434;\n                            \n                            if",
            " (match_lit_227433) {\n                                int64_t write_iv_229175;\n                                \n                                write_iv_229175 = ((__global\n                                                    int64_t *) color_232177)[phys_tid_227351 +\n                                                                             write_iter_229170 *\n                                                                             num_threads_232339];\n                                \n                                int64_t x_227435 = add64(last_res_227415,\n                                                         last_res_227416);\n                                int64_t x_227436 = add64(x_227435,\n                                                         write_iv_229175);\n                                int64_t case_res_227437 = sub64(x_227436,\n                                                                (int64_t) 1);\n                                \n                                x_227434 = case_res_227437;\n                            } else {\n                                int64_t write_iv_229176;\n                                \n                                write_iv_229176 = ((__global\n                                                    int64_t *) color_232176)[phys_tid_227351 +\n                                                                             write_iter_229170 *\n                                                                             num_threads_232339];\n                                \n                                int64_t x_227438 = add64(last_res_227415,\n                                                         last_res_227416);\n                                int64_t x_227439 = add64(last_res_227417,\n                                                         x_227438);\n                                int64_t x_227440 = add64(x_227439,\n                                                         write_iv_229176);\n                        ",
            "        int64_t defunc_1_f_res_res_227441 =\n                                        sub64(x_227440, (int64_t) 1);\n                                \n                                x_227434 = defunc_1_f_res_res_227441;\n                            }\n                            x_227430 = x_227434;\n                        }\n                        defunc_1_f_res_227427 = x_227430;\n                    }\n                    if (sle64((int64_t) 0, defunc_1_f_res_227427) &&\n                        slt64(defunc_1_f_res_227427, n_203572)) {\n                        for (int64_t i_236709 = 0; i_236709 < (int64_t) 1;\n                             i_236709++) {\n                            double tmp_236710;\n                            \n                            tmp_236710 = ((__global\n                                           double *) mem_param_231682)[phys_tid_227351 +\n                                                                       num_threads_232339 *\n                                                                       write_iter_229170 +\n                                                                       i_236709 *\n                                                                       num_threads_232339];\n                            ((__global\n                              double *) mem_param_out_232067)[phys_tid_227351 +\n                                                              num_threads_232339 *\n                                                              defunc_1_f_res_227427 +\n                                                              i_236709 *\n                                                              num_threads_232339] =\n                                tmp_236710;\n                        }\n                    }\n                }\n                \n                __global unsigned char *mem_param_tmp_236694;\n                \n                mem_param_tmp_236694 = mem_param_out_232067;\n                \n                __global unsigned char *me",
            "m_param_out_tmp_236695;\n                \n                mem_param_out_tmp_236695 = mem_param_231682;\n                mem_param_231682 = mem_param_tmp_236694;\n                mem_param_out_232067 = mem_param_out_tmp_236695;\n            }\n            ext_mem_231775 = mem_param_231682;\n            ext_mem_unused_232066 = mem_param_out_232067;\n            for (int64_t i_236711 = 0; i_236711 < n_203572; i_236711++) {\n                double tmp_236712;\n                \n                tmp_236712 = ((__global\n                               double *) ext_mem_231775)[phys_tid_227351 +\n                                                         i_236711 *\n                                                         num_threads_232339];\n                ((__global double *) mem_231782)[gtid_227350 + i_236711 *\n                                                 partition_sizze_203667] =\n                    tmp_236712;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227346\n}\n__kernel void mainzisegmap_228076(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t i_203760, __global\n                                  unsigned char *mem_param_231841, __global\n                                  unsigned char *mem_231847, __global\n                                  unsigned char *mem_231877, __global\n                                  unsigned char *mem_231881, __global\n                                  unsigned char *mem_231885, __global\n                                  unsigned char *mem_231889, __global\n                                  unsigned char *mem_231893)\n{\n    #define segmap_group_sizze_228071 (mainzisegmap_group_sizze_227667)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= ",
            "0)\n        return;\n    \n    int32_t global_tid_237056;\n    int32_t local_tid_237057;\n    int64_t group_sizze_237060;\n    int32_t wave_sizze_237059;\n    int32_t group_tid_237058;\n    \n    global_tid_237056 = get_global_id(0);\n    local_tid_237057 = get_local_id(0);\n    group_sizze_237060 = get_local_size(0);\n    wave_sizze_237059 = LOCKSTEP_WIDTH;\n    group_tid_237058 = get_group_id(0);\n    \n    int32_t phys_tid_228076 = global_tid_237056;\n    int64_t global_tid_237061 = sext_i32_i64(group_tid_237058) *\n            segmap_group_sizze_228071 + sext_i32_i64(local_tid_237057);\n    int64_t slice_237062 = n_203572;\n    int64_t slice_237063 = partition_sizze_203667 * slice_237062;\n    int64_t gtid_228074 = squot64(global_tid_237061, slice_237062);\n    int64_t remnant_237064 = global_tid_237061 - gtid_228074 * slice_237062;\n    int64_t gtid_228075 = remnant_237064;\n    int64_t remnant_237065 = remnant_237064 - gtid_228075;\n    \n    if (slt64(gtid_228074, partition_sizze_203667) && slt64(gtid_228075,\n                                                            n_203572)) {\n        int32_t x_228080;\n        \n        x_228080 = ((__global int32_t *) mem_231893)[gtid_228074 * n_203572 +\n                                                     gtid_228075];\n        \n        double write_value_228085;\n        \n        write_value_228085 = ((__global\n                               double *) mem_param_231841)[gtid_228074 *\n                                                           n_203572 +\n                                                           gtid_228075];\n        \n        bool match_lit_228086 = 0 == x_228080;\n        int64_t defunc_1_f_res_228087;\n        \n        if (match_lit_228086) {\n            int64_t x_228081;\n            \n            x_228081 = ((__global int64_t *) mem_231877)[gtid_228074 *\n                                                         n_203572 +\n                                                         gtid_228075];\n            \n            int64_t case_res_",
            "228088 = sub64(x_228081, (int64_t) 1);\n            \n            defunc_1_f_res_228087 = case_res_228088;\n        } else {\n            int64_t last_res_228077;\n            \n            last_res_228077 = ((__global int64_t *) mem_231877)[gtid_228074 *\n                                                                n_203572 +\n                                                                i_203760];\n            \n            bool match_lit_228089 = 1 == x_228080;\n            int64_t x_228090;\n            \n            if (match_lit_228089) {\n                int64_t x_228082;\n                \n                x_228082 = ((__global int64_t *) mem_231881)[gtid_228074 *\n                                                             n_203572 +\n                                                             gtid_228075];\n                \n                int64_t x_228091 = add64(last_res_228077, x_228082);\n                int64_t case_res_228092 = sub64(x_228091, (int64_t) 1);\n                \n                x_228090 = case_res_228092;\n            } else {\n                int64_t last_res_228078;\n                \n                last_res_228078 = ((__global\n                                    int64_t *) mem_231881)[gtid_228074 *\n                                                           n_203572 + i_203760];\n                \n                bool match_lit_228093 = 2 == x_228080;\n                int64_t x_228094;\n                \n                if (match_lit_228093) {\n                    int64_t x_228083;\n                    \n                    x_228083 = ((__global int64_t *) mem_231885)[gtid_228074 *\n                                                                 n_203572 +\n                                                                 gtid_228075];\n                    \n                    int64_t x_228095 = add64(last_res_228077, last_res_228078);\n                    int64_t x_228096 = add64(x_228083, x_228095);\n                    int64_t case_res_228097 = sub64(x_228096, (i",
            "nt64_t) 1);\n                    \n                    x_228094 = case_res_228097;\n                } else {\n                    int64_t last_res_228079;\n                    \n                    last_res_228079 = ((__global\n                                        int64_t *) mem_231885)[gtid_228074 *\n                                                               n_203572 +\n                                                               i_203760];\n                    \n                    int64_t x_228084;\n                    \n                    x_228084 = ((__global int64_t *) mem_231889)[gtid_228074 *\n                                                                 n_203572 +\n                                                                 gtid_228075];\n                    \n                    int64_t x_228098 = add64(last_res_228077, last_res_228078);\n                    int64_t x_228099 = add64(last_res_228079, x_228098);\n                    int64_t x_228100 = add64(x_228084, x_228099);\n                    int64_t defunc_1_f_res_res_228101 = sub64(x_228100,\n                                                              (int64_t) 1);\n                    \n                    x_228094 = defunc_1_f_res_res_228101;\n                }\n                x_228090 = x_228094;\n            }\n            defunc_1_f_res_228087 = x_228090;\n        }\n        if ((sle64((int64_t) 0, gtid_228074) && slt64(gtid_228074,\n                                                      partition_sizze_203667)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_228087) &&\n             slt64(defunc_1_f_res_228087, n_203572))) {\n            ((__global double *) mem_231847)[gtid_228074 * n_203572 +\n                                             defunc_1_f_res_228087] =\n                write_value_228085;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228071\n}\n__kernel void mainzisegmap_228131(__global int *global_failure,\n                                  int64_t partition_sizze_2036",
            "67,\n                                  int64_t stl_res_203754, int64_t j_m_i_204223,\n                                  __global unsigned char *mem_231927, __global\n                                  unsigned char *mem_231931, __global\n                                  unsigned char *mem_231934, __global\n                                  unsigned char *mem_231937)\n{\n    #define segmap_group_sizze_228125 (mainzisegmap_group_sizze_228110)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237070;\n    int32_t local_tid_237071;\n    int64_t group_sizze_237074;\n    int32_t wave_sizze_237073;\n    int32_t group_tid_237072;\n    \n    global_tid_237070 = get_global_id(0);\n    local_tid_237071 = get_local_id(0);\n    group_sizze_237074 = get_local_size(0);\n    wave_sizze_237073 = LOCKSTEP_WIDTH;\n    group_tid_237072 = get_group_id(0);\n    \n    int32_t phys_tid_228131 = global_tid_237070;\n    int64_t global_tid_237075 = sext_i32_i64(group_tid_237072) *\n            segmap_group_sizze_228125 + sext_i32_i64(local_tid_237071);\n    int64_t slice_237076 = partition_sizze_203667;\n    int64_t gtid_228130 = global_tid_237075;\n    int64_t remnant_237077 = global_tid_237075 - gtid_228130;\n    \n    if (slt64(gtid_228130, partition_sizze_203667)) {\n        double defunc_2_reduce_res_228133;\n        double redout_229179 = 0.0;\n        \n        for (int64_t i_229180 = 0; i_229180 < j_m_i_204223; i_229180++) {\n            int64_t slice_229185 = stl_res_203754 + i_229180;\n            double x_228137;\n            \n            x_228137 = ((__global double *) mem_231927)[slice_229185 *\n                                                        partition_sizze_203667 +\n                                                        gtid_228130];\n            \n            double defunc_1_op_res_228136 = x_228137 + redout_229179;\n            double redout_tmp_237078 = defunc_1_op_res_228136;\n    ",
            "        \n            redout_229179 = redout_tmp_237078;\n        }\n        defunc_2_reduce_res_228133 = redout_229179;\n        \n        double h_228138 = 3.0 * defunc_2_reduce_res_228133;\n        double h9_228139 = 0.999 * h_228138;\n        double h1_228140 = 1.0e-3 * h_228138;\n        \n        ((__global double *) mem_231931)[gtid_228130] = h_228138;\n        ((__global double *) mem_231934)[gtid_228130] = h9_228139;\n        ((__global double *) mem_231937)[gtid_228130] = h1_228140;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228125\n}\n__kernel void mainzisegmap_228193(__global int *global_failure,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *mem_231941, __global\n                                  unsigned char *mem_231945, __global\n                                  unsigned char *mem_231948, __global\n                                  unsigned char *mem_231951)\n{\n    #define segmap_group_sizze_228187 (mainzisegmap_group_sizze_228145)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237147;\n    int32_t local_tid_237148;\n    int64_t group_sizze_237151;\n    int32_t wave_sizze_237150;\n    int32_t group_tid_237149;\n    \n    global_tid_237147 = get_global_id(0);\n    local_tid_237148 = get_local_id(0);\n    group_sizze_237151 = get_local_size(0);\n    wave_sizze_237150 = LOCKSTEP_WIDTH;\n    group_tid_237149 = get_group_id(0);\n    \n    int32_t phys_tid_228193 = global_tid_237147;\n    int64_t global_tid_237152 = sext_i32_i64(group_tid_237149) *\n            segmap_group_sizze_228187 + sext_i32_i64(local_tid_237148);\n    int64_t slice_237153 = partition_sizze_203667;\n    int64_t gtid_228192 = global_tid_237152;\n    int64_t remnant_237154 = global_tid_237152 - gtid_228192;\n    \n    if (slt64(gtid_228192, partition_sizze_203667)) {\n        double defunc_2_reduce_r",
            "es_228194;\n        \n        defunc_2_reduce_res_228194 = ((__global\n                                       double *) mem_231941)[gtid_228192];\n        \n        double h_228195 = 3.0 * defunc_2_reduce_res_228194;\n        double h9_228196 = 0.999 * h_228195;\n        double h1_228197 = 1.0e-3 * h_228195;\n        \n        ((__global double *) mem_231945)[gtid_228192] = h_228195;\n        ((__global double *) mem_231948)[gtid_228192] = h9_228196;\n        ((__global double *) mem_231951)[gtid_228192] = h1_228197;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228187\n}\n__kernel void mainzisegmap_228279(__global int *global_failure,\n                                  int64_t n_203572,\n                                  int64_t partition_sizze_203667, __global\n                                  unsigned char *ext_mem_231668, __global\n                                  unsigned char *ext_mem_231952, __global\n                                  unsigned char *ext_mem_231953, __global\n                                  unsigned char *ext_mem_231954, __global\n                                  unsigned char *mem_231959)\n{\n    #define segmap_group_sizze_228274 (mainzisegmap_group_sizze_228214)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237156;\n    int32_t local_tid_237157;\n    int64_t group_sizze_237160;\n    int32_t wave_sizze_237159;\n    int32_t group_tid_237158;\n    \n    global_tid_237156 = get_global_id(0);\n    local_tid_237157 = get_local_id(0);\n    group_sizze_237160 = get_local_size(0);\n    wave_sizze_237159 = LOCKSTEP_WIDTH;\n    group_tid_237158 = get_group_id(0);\n    \n    int32_t phys_tid_228279 = global_tid_237156;\n    int64_t global_tid_237161 = sext_i32_i64(group_tid_237158) *\n            segmap_group_sizze_228274 + sext_i32_i64(local_tid_237157);\n    int64_t slice_237162 = n_203572;\n    int64_t slice_237163 = partition_sizze_203667",
            " * slice_237162;\n    int64_t gtid_228277 = squot64(global_tid_237161, slice_237162);\n    int64_t remnant_237164 = global_tid_237161 - gtid_228277 * slice_237162;\n    int64_t gtid_228278 = remnant_237164;\n    int64_t remnant_237165 = remnant_237164 - gtid_228278;\n    \n    if (slt64(gtid_228277, partition_sizze_203667) && slt64(gtid_228278,\n                                                            n_203572)) {\n        double x_228280;\n        \n        x_228280 = ((__global double *) ext_mem_231954)[gtid_228277];\n        \n        double x_228282;\n        \n        x_228282 = ((__global double *) ext_mem_231952)[gtid_228277];\n        \n        double x_228283;\n        \n        x_228283 = ((__global double *) ext_mem_231668)[gtid_228277 * n_203572 +\n                                                        gtid_228278];\n        \n        double x_228284 = x_228283 / x_228280;\n        double y_228285 = fpow64(x_228284, 2.0);\n        double x_228286 = 1.0 - y_228285;\n        double bicube_228287 = fpow64(x_228286, 2.0);\n        bool isnan_res_228288;\n        \n        isnan_res_228288 = futrts_isnan64(x_228283);\n        \n        bool cond_f_res_228289 = x_228283 <= x_228282;\n        bool x_228290 = !isnan_res_228288;\n        bool y_228291 = cond_f_res_228289 && x_228290;\n        bool cond_228292 = isnan_res_228288 || y_228291;\n        double defunc_0_f_res_228293;\n        \n        if (cond_228292) {\n            defunc_0_f_res_228293 = 1.0;\n        } else {\n            double x_228281;\n            \n            x_228281 = ((__global double *) ext_mem_231953)[gtid_228277];\n            \n            bool cond_228294 = x_228281 <= x_228283;\n            bool cond_f_res_228295 = x_228283 <= 1.0e-6;\n            bool x_228296 = !cond_228294;\n            bool y_228297 = cond_f_res_228295 && x_228296;\n            bool cond_228298 = cond_228294 || y_228297;\n            double defunc_0_f_res_f_res_228299;\n            \n            if (cond_228298) {\n                defunc_0_f_res_f_res_22829",
            "9 = 1.0e-6;\n            } else {\n                defunc_0_f_res_f_res_228299 = bicube_228287;\n            }\n            defunc_0_f_res_228293 = defunc_0_f_res_f_res_228299;\n        }\n        ((__global double *) mem_231959)[gtid_228277 * n_203572 + gtid_228278] =\n            defunc_0_f_res_228293;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228274\n}\n__kernel void mainzisegmap_228302(__global int *global_failure,\n                                  int64_t m_203571, int64_t n_203572,\n                                  int64_t partition_sizze_203667,\n                                  int64_t num_groups_228307,\n                                  int64_t num_threads_232357, __global\n                                  unsigned char *mem_229269, __global\n                                  unsigned char *mem_229272, __global\n                                  unsigned char *mem_231995, __global\n                                  unsigned char *mem_231999, __global\n                                  unsigned char *mem_232003, __global\n                                  unsigned char *mem_232006, __global\n                                  unsigned char *mem_232009, __global\n                                  unsigned char *color_232194)\n{\n    #define segmap_group_sizze_228305 (mainzisegmap_group_sizze_228304)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237167;\n    int32_t local_tid_237168;\n    int64_t group_sizze_237171;\n    int32_t wave_sizze_237170;\n    int32_t group_tid_237169;\n    \n    global_tid_237167 = get_global_id(0);\n    local_tid_237168 = get_local_id(0);\n    group_sizze_237171 = get_local_size(0);\n    wave_sizze_237170 = LOCKSTEP_WIDTH;\n    group_tid_237169 = get_group_id(0);\n    \n    int32_t phys_tid_228302 = global_tid_237167;\n    int32_t phys_group_id_237172;\n    \n    phys_group_id_237172 = get_group_id(0);\n    for (int32_t",
            " i_237173 = 0; i_237173 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          segmap_group_sizze_228305)) -\n                   phys_group_id_237172, sext_i64_i32(num_groups_228307));\n         i_237173++) {\n        int32_t virt_group_id_237174 = phys_group_id_237172 + i_237173 *\n                sext_i64_i32(num_groups_228307);\n        int64_t global_tid_237175 = sext_i32_i64(virt_group_id_237174) *\n                segmap_group_sizze_228305 + sext_i32_i64(local_tid_237168);\n        int64_t slice_237176 = partition_sizze_203667;\n        int64_t write_i_228301 = global_tid_237175;\n        int64_t remnant_237177 = global_tid_237175 - write_i_228301;\n        \n        if (slt64(write_i_228301, partition_sizze_203667)) {\n            int64_t write_index_206943;\n            \n            write_index_206943 = ((__global\n                                   int64_t *) mem_229272)[write_i_228301];\n            for (int64_t i_229183 = 0; i_229183 < n_203572; i_229183++) {\n                double x_206945;\n                \n                x_206945 = ((__global double *) mem_229269)[write_i_228301 *\n                                                            n_203572 +\n                                                            i_229183];\n                \n                double x_206946;\n                \n                x_206946 = ((__global double *) mem_232006)[i_229183 *\n                                                            partition_sizze_203667 +\n                                                            write_i_228301];\n                \n                double x_206947;\n                \n                x_206947 = ((__global double *) mem_232009)[i_229183 *\n                                                            partition_sizze_203667 +\n                                                            write_i_228301];\n                \n                double x_206948 = x_206945 - x_206946;\n                double defunc_2_f_",
            "res_206949 = x_206948 - x_206947;\n                \n                ((__global double *) color_232194)[phys_tid_228302 + i_229183 *\n                                                   num_threads_232357] =\n                    defunc_2_f_res_206949;\n            }\n            if (sle64((int64_t) 0, write_index_206943) &&\n                slt64(write_index_206943, m_203571)) {\n                for (int64_t i_237179 = 0; i_237179 < n_203572; i_237179++) {\n                    double tmp_237180;\n                    \n                    tmp_237180 = ((__global\n                                   double *) color_232194)[phys_tid_228302 +\n                                                           i_237179 *\n                                                           num_threads_232357];\n                    ((__global double *) mem_232003)[write_index_206943 *\n                                                     n_203572 + i_237179] =\n                        tmp_237180;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206943) &&\n                slt64(write_index_206943, m_203571)) {\n                for (int64_t i_237181 = 0; i_237181 < n_203572; i_237181++) {\n                    double tmp_237182;\n                    \n                    tmp_237182 = ((__global\n                                   double *) mem_232009)[write_i_228301 +\n                                                         i_237181 *\n                                                         partition_sizze_203667];\n                    ((__global double *) mem_231999)[write_index_206943 *\n                                                     n_203572 + i_237181] =\n                        tmp_237182;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206943) &&\n                slt64(write_index_206943, m_203571)) {\n                for (int64_t i_237183 = 0; i_237183 < n_203572; i_237183++) {\n                    double tmp_237184;\n                    \n           ",
            "         tmp_237184 = ((__global\n                                   double *) mem_232006)[write_i_228301 +\n                                                         i_237183 *\n                                                         partition_sizze_203667];\n                    ((__global double *) mem_231995)[write_index_206943 *\n                                                     n_203572 + i_237183] =\n                        tmp_237184;\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228305\n}\n__kernel void mainzisegmap_intragroup_206983(__global int *global_failure,\n                                             uint color_232076_backing_offset_0,\n                                             uint color_232075_backing_offset_1,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t i_203760, __global\n                                             unsigned char *mem_229269, __global\n                                             unsigned char *mem_229286, __global\n                                             unsigned char *mem_229289)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232076_backing_1 =\n                           &shared_mem[color_232076_backing_offset_0];\n    volatile unsigned char *color_232075_backing_0 =\n                           &shared_mem[color_232075_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232488;\n    int32_t local_tid_232489;\n    int64_t group_sizze_232492;\n    int32_t wave_sizze_232491;\n    int32_t group_tid_232490;\n    \n    global_tid_232488 = get_global_id(0);\n    local_tid_232489 = get_local_id(0);\n    group_sizze_232492 = get_local_size(0);\n    wave_sizze_23",
            "2491 = LOCKSTEP_WIDTH;\n    group_tid_232490 = get_group_id(0);\n    \n    int32_t phys_tid_206983 = group_tid_232490;\n    int64_t slice_232494 = n_203572;\n    int64_t ltid_pre_232493 = sext_i32_i64(local_tid_232489);\n    int64_t remnant_232495 = sext_i32_i64(local_tid_232489) - ltid_pre_232493;\n    int64_t slice_232496 = partition_sizze_203667;\n    int64_t gtid_206982 = sext_i32_i64(group_tid_232490);\n    int64_t remnant_232497 = sext_i32_i64(group_tid_232490) - gtid_206982;\n    __local unsigned char *color_232075;\n    \n    color_232075 = (__local unsigned char *) color_232075_backing_0;\n    \n    __local unsigned char *color_232076;\n    \n    color_232076 = (__local unsigned char *) color_232076_backing_1;\n    \n    int64_t gtid_206987 = sext_i32_i64(sext_i64_i32(ltid_pre_232493));\n    int32_t phys_tid_206988 = local_tid_232489;\n    double x_206992;\n    \n    x_206992 = ((__global double *) mem_229269)[gtid_206982 * n_203572 +\n                                                gtid_206987];\n    \n    bool isnan_res_206993;\n    \n    isnan_res_206993 = futrts_isnan64(x_206992);\n    \n    bool defunc_0_p_res_206994 = !isnan_res_206993;\n    int64_t defunc_0_f_res_206995 = btoi_bool_i64(defunc_0_p_res_206994);\n    \n    ((__local int64_t *) color_232076)[gtid_206987] = defunc_0_f_res_206995;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232498 = n_203572;\n    int64_t x_206989;\n    int64_t x_206990;\n    int64_t x_232500;\n    int64_t x_232501;\n    bool ltid_in_bounds_232503 = slt64(sext_i32_i64(local_tid_232489),\n                                       n_203572);\n    int32_t skip_threads_232504;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232503) {\n            x_206990 = ((volatile __local\n                         int64_t *) color_232076)[sext_i32_i64(local_tid_232489)];\n            if ((local_tid_232489 - squot32(local_tid_232489, 32) * 32) == 0) {\n                x_206989 = x_206990;\n            }\n        }\n    }\n    // in-block scan (hop",
            "efully no barriers needed)\n    {\n        skip_threads_232504 = 1;\n        while (slt32(skip_threads_232504, 32)) {\n            bool thread_active_232505 = sle32(skip_threads_232504,\n                                              local_tid_232489 -\n                                              squot32(local_tid_232489, 32) *\n                                              32) && ltid_in_bounds_232503;\n            \n            if (thread_active_232505) {\n                // read operands\n                {\n                    x_206989 = ((volatile __local\n                                 int64_t *) color_232076)[sext_i32_i64(local_tid_232489) -\n                                                          sext_i32_i64(skip_threads_232504)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232506 =\n                     slt64(srem64(sext_i32_i64(local_tid_232489), n_203572),\n                           sext_i32_i64(local_tid_232489) -\n                           sext_i32_i64(local_tid_232489 -\n                           skip_threads_232504));\n                \n                if (thread_active_232505 && inactive_232506) {\n                    x_206989 = x_206990;\n                }\n                if (thread_active_232505) {\n                    if (!inactive_232506) {\n                        int64_t defunc_1_op_res_206991 = add64(x_206989,\n                                                               x_206990);\n                        \n                        x_206989 = defunc_1_op_res_206991;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232491, skip_threads_232504)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232505) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232076)[sext_i32_i64(local_tid_232489)] =\n                        x_206989;\n               ",
            "     x_206990 = x_206989;\n                }\n            }\n            if (sle32(wave_sizze_232491, skip_threads_232504)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232504 *= 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_232489 - squot32(local_tid_232489, 32) * 32) == 31 &&\n            ltid_in_bounds_232503) {\n            ((volatile __local\n              int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_232489,\n                                                            32))] = x_206989;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_232507;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232489, 32) == 0 && ltid_in_bounds_232503) {\n                x_232501 = ((volatile __local\n                             int64_t *) color_232076)[sext_i32_i64(local_tid_232489)];\n                if ((local_tid_232489 - squot32(local_tid_232489, 32) * 32) ==\n                    0) {\n                    x_232500 = x_232501;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232507 = 1;\n            while (slt32(skip_threads_232507, 32)) {\n                bool thread_active_232508 = sle32(skip_threads_232507,\n                                                  local_tid_232489 -\n                                                  squot32(local_tid_232489,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232489, 32) == 0 &&\n                      ltid_in_bounds_232503);\n                \n                if (thread_active_232508) {\n                    // read operands\n                    {\n                        x_232500 = ((volatile __loca",
            "l\n                                     int64_t *) color_232076)[sext_i32_i64(local_tid_232489) -\n                                                              sext_i32_i64(skip_threads_232507)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232509 =\n                         slt64(srem64(sext_i32_i64(local_tid_232489 * 32 + 32 -\n                                      1), n_203572),\n                               sext_i32_i64(local_tid_232489 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232489 -\n                                             skip_threads_232507) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232508 && inactive_232509) {\n                        x_232500 = x_232501;\n                    }\n                    if (thread_active_232508) {\n                        if (!inactive_232509) {\n                            int64_t defunc_1_op_res_232502 = add64(x_232500,\n                                                                   x_232501);\n                            \n                            x_232500 = defunc_1_op_res_232502;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232491, skip_threads_232507)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232508) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232076)[sext_i32_i64(local_tid_232489)] =\n                            x_232500;\n                        x_232501 = x_232500;\n                    }\n                }\n                if (sle32(wave_sizze_232491, skip_threads_232507)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232507 *= 2;\n            }\n        }\n    }\n    barrier(CLK",
            "_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232510 = squot32(local_tid_232489, 32) == 0 ||\n         !ltid_in_bounds_232503;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232510) {\n                x_206990 = x_206989;\n                x_206989 = ((__local\n                             int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_232489,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232511 = slt64(srem64(sext_i32_i64(local_tid_232489),\n                                                n_203572),\n                                         sext_i32_i64(local_tid_232489) -\n                                         sext_i32_i64(squot32(local_tid_232489,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232510) {\n                if (inactive_232511) {\n                    x_206989 = x_206990;\n                }\n            }\n            if (!no_carry_in_232510) {\n                if (!inactive_232511) {\n                    int64_t defunc_1_op_res_206991 = add64(x_206989, x_206990);\n                    \n                    x_206989 = defunc_1_op_res_206991;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232510) {\n                ((__local\n                  int64_t *) color_232076)[sext_i32_i64(local_tid_232489)] =\n                    x_206989;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232489, 32) == 0 && ltid_in_bounds_232503) {\n            ((__local int64_t *) color_232076)[sext_i32_i64(local_tid_232489)] =\n                x_206990;\n        }\n    }\n    barrier(CLK_LOCAL_M",
            "EM_FENCE);\n    \n    int64_t last_res_206996;\n    \n    last_res_206996 = ((__local int64_t *) color_232076)[i_203760];\n    ((__local int64_t *) color_232075)[sext_i32_i64(local_tid_232489)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_206999 = sext_i32_i64(sext_i64_i32(ltid_pre_232493));\n    int32_t phys_tid_207000 = local_tid_232489;\n    double x_207001;\n    \n    x_207001 = ((__global double *) mem_229269)[gtid_206982 * n_203572 +\n                                                write_i_206999];\n    \n    bool isnan_res_207004;\n    \n    isnan_res_207004 = futrts_isnan64(x_207001);\n    \n    bool defunc_0_p_res_207005 = !isnan_res_207004;\n    int64_t defunc_1_f_res_207006;\n    \n    if (defunc_0_p_res_207005) {\n        int64_t x_207002;\n        \n        x_207002 = ((__local int64_t *) color_232076)[write_i_206999];\n        \n        int64_t defunc_1_f_res_t_res_207007 = sub64(x_207002, (int64_t) 1);\n        \n        defunc_1_f_res_207006 = defunc_1_f_res_t_res_207007;\n    } else {\n        defunc_1_f_res_207006 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_207006) &&\n        slt64(defunc_1_f_res_207006, n_203572)) {\n        ((__local int64_t *) color_232075)[defunc_1_f_res_207006] =\n            write_i_206999;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232512;\n    \n    tmp_232512 = ((__local\n                   int64_t *) color_232075)[sext_i32_i64(local_tid_232489)];\n    ((__global int64_t *) mem_229286)[gtid_206982 * n_203572 +\n                                      sext_i32_i64(local_tid_232489)] =\n        tmp_232512;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232489 == 0) {\n        ((__global int64_t *) mem_229289)[gtid_206982] = last_res_206996;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207338(__global int *global_failure,\n                                             uint color_232078_backing_offset_0,\n                                             uint color",
            "_232077_backing_offset_1,\n                                             int64_t n_p_203574,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t i_203808,\n                                             int64_t computed_group_sizze_207277,\n                                             __global unsigned char *mem_229314,\n                                             __global unsigned char *mem_229330,\n                                             __global unsigned char *mem_229334)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232078_backing_1 =\n                           &shared_mem[color_232078_backing_offset_0];\n    volatile unsigned char *color_232077_backing_0 =\n                           &shared_mem[color_232077_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232661;\n    int32_t local_tid_232662;\n    int64_t group_sizze_232665;\n    int32_t wave_sizze_232664;\n    int32_t group_tid_232663;\n    \n    global_tid_232661 = get_global_id(0);\n    local_tid_232662 = get_local_id(0);\n    group_sizze_232665 = get_local_size(0);\n    wave_sizze_232664 = LOCKSTEP_WIDTH;\n    group_tid_232663 = get_group_id(0);\n    \n    int32_t phys_tid_207338 = group_tid_232663;\n    int64_t slice_232668 = defunc_0_f_res_203721;\n    int64_t slice_232669 = n_p_203574 * slice_232668;\n    int64_t ltid_pre_232666 = squot64(sext_i32_i64(local_tid_232662),\n                                      slice_232668);\n    int64_t remnant_232670 = sext_i32_i64(local_tid_232662) - ltid_pre_232666 *\n            slice_232668;\n    int64_t ltid_pre_232667 = remnant_232670;\n    int64_t remnant_232671 = remnant_232670 - ltid_pre_232667;\n    int64_t slice_232672 = partition_sizze_203667;\n    int64_t gtid_207337 = sext_i32_i64(group_tid_232663);\n   ",
            " int64_t remnant_232673 = sext_i32_i64(group_tid_232663) - gtid_207337;\n    __local unsigned char *color_232077;\n    \n    color_232077 = (__local unsigned char *) color_232077_backing_0;\n    \n    __local unsigned char *color_232078;\n    \n    color_232078 = (__local unsigned char *) color_232078_backing_1;\n    \n    int64_t gtid_207342 = sext_i32_i64(sext_i64_i32(ltid_pre_232666));\n    int64_t gtid_207343 = sext_i32_i64(sext_i64_i32(ltid_pre_232667));\n    int32_t phys_tid_207344 = local_tid_232662;\n    \n    if (slt64(gtid_207342, n_p_203574) && slt64(gtid_207343,\n                                                defunc_0_f_res_203721)) {\n        double x_207349;\n        \n        x_207349 = ((__global double *) mem_229314)[gtid_207337 *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207342 *\n                                                    defunc_0_f_res_203721 +\n                                                    gtid_207343];\n        \n        bool isnan_res_207350;\n        \n        isnan_res_207350 = futrts_isnan64(x_207349);\n        \n        bool defunc_0_p_res_207351 = !isnan_res_207350;\n        int64_t defunc_0_f_res_207352 = btoi_bool_i64(defunc_0_p_res_207351);\n        \n        ((__local int64_t *) color_232078)[gtid_207342 * defunc_0_f_res_203721 +\n                                           gtid_207343] = defunc_0_f_res_207352;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232674 = n_p_203574 * defunc_0_f_res_203721;\n    int64_t x_207345;\n    int64_t x_207346;\n    int64_t x_232676;\n    int64_t x_232677;\n    bool ltid_in_bounds_232679 = slt64(sext_i32_i64(local_tid_232662),\n                                       n_p_203574 * defunc_0_f_res_203721);\n    int32_t skip_threads_232680;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232679) {\n            x_207346 = ((volatile __local\n                         int64_t *) ",
            "color_232078)[sext_i32_i64(local_tid_232662)];\n            if ((local_tid_232662 - squot32(local_tid_232662, 32) * 32) == 0) {\n                x_207345 = x_207346;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232680 = 1;\n        while (slt32(skip_threads_232680, 32)) {\n            bool thread_active_232681 = sle32(skip_threads_232680,\n                                              local_tid_232662 -\n                                              squot32(local_tid_232662, 32) *\n                                              32) && ltid_in_bounds_232679;\n            \n            if (thread_active_232681) {\n                // read operands\n                {\n                    x_207345 = ((volatile __local\n                                 int64_t *) color_232078)[sext_i32_i64(local_tid_232662) -\n                                                          sext_i32_i64(skip_threads_232680)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232682 =\n                     slt64(srem64(sext_i32_i64(local_tid_232662),\n                                  defunc_0_f_res_203721),\n                           sext_i32_i64(local_tid_232662) -\n                           sext_i32_i64(local_tid_232662 -\n                           skip_threads_232680));\n                \n                if (thread_active_232681 && inactive_232682) {\n                    x_207345 = x_207346;\n                }\n                if (thread_active_232681) {\n                    if (!inactive_232682) {\n                        int64_t defunc_1_op_res_207347 = add64(x_207345,\n                                                               x_207346);\n                        \n                        x_207345 = defunc_1_op_res_207347;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232664, skip_threads_232680)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n       ",
            "     }\n            if (thread_active_232681) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232078)[sext_i32_i64(local_tid_232662)] =\n                        x_207345;\n                    x_207346 = x_207345;\n                }\n            }\n            if (sle32(wave_sizze_232664, skip_threads_232680)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232680 *= 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_232662 - squot32(local_tid_232662, 32) * 32) == 31 &&\n            ltid_in_bounds_232679) {\n            ((volatile __local\n              int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_232662,\n                                                            32))] = x_207345;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_232683;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232662, 32) == 0 && ltid_in_bounds_232679) {\n                x_232677 = ((volatile __local\n                             int64_t *) color_232078)[sext_i32_i64(local_tid_232662)];\n                if ((local_tid_232662 - squot32(local_tid_232662, 32) * 32) ==\n                    0) {\n                    x_232676 = x_232677;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232683 = 1;\n            while (slt32(skip_threads_232683, 32)) {\n                bool thread_active_232684 = sle32(skip_threads_232683,\n                                                  local_tid_232662 -\n                                                  squot32(local_tid_232662,\n                                                          32) * 32) &&\n            ",
            "         (squot32(local_tid_232662, 32) == 0 &&\n                      ltid_in_bounds_232679);\n                \n                if (thread_active_232684) {\n                    // read operands\n                    {\n                        x_232676 = ((volatile __local\n                                     int64_t *) color_232078)[sext_i32_i64(local_tid_232662) -\n                                                              sext_i32_i64(skip_threads_232683)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232685 =\n                         slt64(srem64(sext_i32_i64(local_tid_232662 * 32 + 32 -\n                                      1), defunc_0_f_res_203721),\n                               sext_i32_i64(local_tid_232662 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232662 -\n                                             skip_threads_232683) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232684 && inactive_232685) {\n                        x_232676 = x_232677;\n                    }\n                    if (thread_active_232684) {\n                        if (!inactive_232685) {\n                            int64_t defunc_1_op_res_232678 = add64(x_232676,\n                                                                   x_232677);\n                            \n                            x_232676 = defunc_1_op_res_232678;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232664, skip_threads_232683)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232684) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232078)[sext_i32_i64(local_tid_232662)] =\n                            x_232676;\n                        x_2326",
            "77 = x_232676;\n                    }\n                }\n                if (sle32(wave_sizze_232664, skip_threads_232683)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232683 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232686 = squot32(local_tid_232662, 32) == 0 ||\n         !ltid_in_bounds_232679;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232686) {\n                x_207346 = x_207345;\n                x_207345 = ((__local\n                             int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_232662,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232687 = slt64(srem64(sext_i32_i64(local_tid_232662),\n                                                defunc_0_f_res_203721),\n                                         sext_i32_i64(local_tid_232662) -\n                                         sext_i32_i64(squot32(local_tid_232662,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232686) {\n                if (inactive_232687) {\n                    x_207345 = x_207346;\n                }\n            }\n            if (!no_carry_in_232686) {\n                if (!inactive_232687) {\n                    int64_t defunc_1_op_res_207347 = add64(x_207345, x_207346);\n                    \n                    x_207345 = defunc_1_op_res_207347;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232686) {\n                ((__local\n                  int64_t *) color_232078)[sext_i32_i64(local_tid_232662)] =\n                    x_207345;\n            }\n        }\n    }\n    barrier(CLK",
            "_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232662, 32) == 0 && ltid_in_bounds_232679) {\n            ((__local int64_t *) color_232078)[sext_i32_i64(local_tid_232662)] =\n                x_207346;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232688 = 0; i_232688 < sdiv_up64(n_p_203574 *\n                                                    defunc_0_f_res_203721 -\n                                                    sext_i32_i64(local_tid_232662),\n                                                    computed_group_sizze_207277);\n         i_232688++) {\n        ((__local int64_t *) color_232077)[squot64(i_232688 *\n                                                   computed_group_sizze_207277 +\n                                                   sext_i32_i64(local_tid_232662),\n                                                   defunc_0_f_res_203721) *\n                                           defunc_0_f_res_203721 + (i_232688 *\n                                                                    computed_group_sizze_207277 +\n                                                                    sext_i32_i64(local_tid_232662) -\n                                                                    squot64(i_232688 *\n                                                                            computed_group_sizze_207277 +\n                                                                            sext_i32_i64(local_tid_232662),\n                                                                            defunc_0_f_res_203721) *\n                                                                    defunc_0_f_res_203721)] =\n            (int64_t) -1;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207364 = sext_i32_i64(sext_i64_i32(ltid_pre_232666));\n    int64_t gtid_207365 = sext_i32_i64(sext_i64_i32(ltid_pre_232667));\n    int32_t phys_tid_207366 = local_tid_232662;\n    \n    if (slt64(gtid_207364",
            ", n_p_203574) && slt64(gtid_207365,\n                                                defunc_0_f_res_203721)) {\n        double x_207367;\n        \n        x_207367 = ((__global double *) mem_229314)[gtid_207337 *\n                                                    (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207364 *\n                                                    defunc_0_f_res_203721 +\n                                                    gtid_207365];\n        \n        bool isnan_res_207370;\n        \n        isnan_res_207370 = futrts_isnan64(x_207367);\n        \n        bool defunc_0_p_res_207371 = !isnan_res_207370;\n        int64_t defunc_1_f_res_207372;\n        \n        if (defunc_0_p_res_207371) {\n            int64_t x_207368;\n            \n            x_207368 = ((__local int64_t *) color_232078)[gtid_207364 *\n                                                          defunc_0_f_res_203721 +\n                                                          gtid_207365];\n            \n            int64_t defunc_1_f_res_t_res_207373 = sub64(x_207368, (int64_t) 1);\n            \n            defunc_1_f_res_207372 = defunc_1_f_res_t_res_207373;\n        } else {\n            defunc_1_f_res_207372 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207364) && slt64(gtid_207364,\n                                                      n_p_203574)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207372) &&\n             slt64(defunc_1_f_res_207372, defunc_0_f_res_203721))) {\n            ((__local int64_t *) color_232077)[gtid_207364 *\n                                               defunc_0_f_res_203721 +\n                                               defunc_1_f_res_207372] =\n                gtid_207365;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232689 = 0; i_232689 < sdiv_up64(n_p_203574 *\n                                                    defunc_0_f_res_203721 -\n                                 ",
            "                   sext_i32_i64(local_tid_232662),\n                                                    computed_group_sizze_207277);\n         i_232689++) {\n        int64_t tmp_232690;\n        \n        tmp_232690 = ((__local int64_t *) color_232077)[squot64(i_232689 *\n                                                                computed_group_sizze_207277 +\n                                                                sext_i32_i64(local_tid_232662),\n                                                                defunc_0_f_res_203721) *\n                                                        defunc_0_f_res_203721 +\n                                                        (i_232689 *\n                                                         computed_group_sizze_207277 +\n                                                         sext_i32_i64(local_tid_232662) -\n                                                         squot64(i_232689 *\n                                                                 computed_group_sizze_207277 +\n                                                                 sext_i32_i64(local_tid_232662),\n                                                                 defunc_0_f_res_203721) *\n                                                         defunc_0_f_res_203721)];\n        ((__global int64_t *) mem_229330)[gtid_207337 * (defunc_0_f_res_203721 *\n                                                         n_p_203574) +\n                                          squot64(i_232689 *\n                                                  computed_group_sizze_207277 +\n                                                  sext_i32_i64(local_tid_232662),\n                                                  defunc_0_f_res_203721) *\n                                          defunc_0_f_res_203721 + (i_232689 *\n                                                                   computed_group_sizze_207277 +\n                                                               ",
            "    sext_i32_i64(local_tid_232662) -\n                                                                   squot64(i_232689 *\n                                                                           computed_group_sizze_207277 +\n                                                                           sext_i32_i64(local_tid_232662),\n                                                                           defunc_0_f_res_203721) *\n                                                                   defunc_0_f_res_203721)] =\n            tmp_232690;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232691 = 0; i_232691 < sdiv_up64(n_p_203574 -\n                                                    sext_i32_i64(local_tid_232662),\n                                                    computed_group_sizze_207277);\n         i_232691++) {\n        int64_t tmp_232692;\n        \n        tmp_232692 = ((__local int64_t *) color_232078)[i_203808 + (i_232691 *\n                                                                    computed_group_sizze_207277 +\n                                                                    sext_i32_i64(local_tid_232662)) *\n                                                        defunc_0_f_res_203721];\n        ((__global int64_t *) mem_229334)[gtid_207337 * n_p_203574 + (i_232691 *\n                                                                      computed_group_sizze_207277 +\n                                                                      sext_i32_i64(local_tid_232662))] =\n            tmp_232692;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207614(__global int *global_failure,\n                                             uint color_232080_backing_offset_0,\n                                             uint color_232079_backing_offset_1,\n                                             int64_t n_p_203574,\n                                             int64_t partition_sizze_203667,",
            "\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t i_203808, __global\n                                             unsigned char *mem_229314, __global\n                                             unsigned char *mem_229348, __global\n                                             unsigned char *mem_229352)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232080_backing_1 =\n                           &shared_mem[color_232080_backing_offset_0];\n    volatile unsigned char *color_232079_backing_0 =\n                           &shared_mem[color_232079_backing_offset_1];\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_group_id(0);\n    \n    int32_t phys_tid_207614 = group_tid_232695;\n    int64_t slice_232699 = defunc_0_f_res_203721;\n    int64_t ltid_pre_232698 = sext_i32_i64(local_tid_232694);\n    int64_t remnant_232700 = sext_i32_i64(local_tid_232694) - ltid_pre_232698;\n    int64_t slice_232701 = n_p_203574;\n    int64_t slice_232702 = partition_sizze_203667 * slice_232701;\n    int64_t gtid_207612 = squot64(sext_i32_i64(group_tid_232695), slice_232701);\n    int64_t remnant_232703 = sext_i32_i64(group_tid_232695) - gtid_207612 *\n            slice_232701;\n    int64_t gtid_207613 = remnant_232703;\n    int64_t remnant_232704 = remnant_232703 - gtid_207613;\n    __local unsigned char *color_232079;\n    \n    color_232079 = (__local unsigned char *) color_232079_backing_0;\n    \n    __local unsigned char *color_232080;\n    \n    color_232080 = (__local unsigned char *) color_232080",
            "_backing_1;\n    \n    int64_t gtid_207618 = sext_i32_i64(sext_i64_i32(ltid_pre_232698));\n    int32_t phys_tid_207619 = local_tid_232694;\n    double x_207623;\n    \n    x_207623 = ((__global double *) mem_229314)[gtid_207612 *\n                                                (defunc_0_f_res_203721 *\n                                                 n_p_203574) + gtid_207613 *\n                                                defunc_0_f_res_203721 +\n                                                gtid_207618];\n    \n    bool isnan_res_207624;\n    \n    isnan_res_207624 = futrts_isnan64(x_207623);\n    \n    bool defunc_0_p_res_207625 = !isnan_res_207624;\n    int64_t defunc_0_f_res_207626 = btoi_bool_i64(defunc_0_p_res_207625);\n    \n    ((__local int64_t *) color_232080)[gtid_207618] = defunc_0_f_res_207626;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232705 = defunc_0_f_res_203721;\n    int64_t x_207620;\n    int64_t x_207621;\n    int64_t x_232707;\n    int64_t x_232708;\n    bool ltid_in_bounds_232710 = slt64(sext_i32_i64(local_tid_232694),\n                                       defunc_0_f_res_203721);\n    int32_t skip_threads_232711;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232710) {\n            x_207621 = ((volatile __local\n                         int64_t *) color_232080)[sext_i32_i64(local_tid_232694)];\n            if ((local_tid_232694 - squot32(local_tid_232694, 32) * 32) == 0) {\n                x_207620 = x_207621;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232711 = 1;\n        while (slt32(skip_threads_232711, 32)) {\n            bool thread_active_232712 = sle32(skip_threads_232711,\n                                              local_tid_232694 -\n                                              squot32(local_tid_232694, 32) *\n                                              32) && ltid_in_bounds_232710;\n            \n            if (thread_active_232712) {\n          ",
            "      // read operands\n                {\n                    x_207620 = ((volatile __local\n                                 int64_t *) color_232080)[sext_i32_i64(local_tid_232694) -\n                                                          sext_i32_i64(skip_threads_232711)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232713 =\n                     slt64(srem64(sext_i32_i64(local_tid_232694),\n                                  defunc_0_f_res_203721),\n                           sext_i32_i64(local_tid_232694) -\n                           sext_i32_i64(local_tid_232694 -\n                           skip_threads_232711));\n                \n                if (thread_active_232712 && inactive_232713) {\n                    x_207620 = x_207621;\n                }\n                if (thread_active_232712) {\n                    if (!inactive_232713) {\n                        int64_t defunc_1_op_res_207622 = add64(x_207620,\n                                                               x_207621);\n                        \n                        x_207620 = defunc_1_op_res_207622;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232696, skip_threads_232711)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232712) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232080)[sext_i32_i64(local_tid_232694)] =\n                        x_207620;\n                    x_207621 = x_207620;\n                }\n            }\n            if (sle32(wave_sizze_232696, skip_threads_232711)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232711 *= 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_232694 - squot32(local_tid_232694, 32) * 32) == 31 &&",
            "\n            ltid_in_bounds_232710) {\n            ((volatile __local\n              int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_232694,\n                                                            32))] = x_207620;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_232714;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232694, 32) == 0 && ltid_in_bounds_232710) {\n                x_232708 = ((volatile __local\n                             int64_t *) color_232080)[sext_i32_i64(local_tid_232694)];\n                if ((local_tid_232694 - squot32(local_tid_232694, 32) * 32) ==\n                    0) {\n                    x_232707 = x_232708;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232714 = 1;\n            while (slt32(skip_threads_232714, 32)) {\n                bool thread_active_232715 = sle32(skip_threads_232714,\n                                                  local_tid_232694 -\n                                                  squot32(local_tid_232694,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232694, 32) == 0 &&\n                      ltid_in_bounds_232710);\n                \n                if (thread_active_232715) {\n                    // read operands\n                    {\n                        x_232707 = ((volatile __local\n                                     int64_t *) color_232080)[sext_i32_i64(local_tid_232694) -\n                                                              sext_i32_i64(skip_threads_232714)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232716 =\n                         slt64(srem64(sext_i32_i64(local_tid_232694 * 32 + 32 -\n    ",
            "                                  1), defunc_0_f_res_203721),\n                               sext_i32_i64(local_tid_232694 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232694 -\n                                             skip_threads_232714) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232715 && inactive_232716) {\n                        x_232707 = x_232708;\n                    }\n                    if (thread_active_232715) {\n                        if (!inactive_232716) {\n                            int64_t defunc_1_op_res_232709 = add64(x_232707,\n                                                                   x_232708);\n                            \n                            x_232707 = defunc_1_op_res_232709;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232696, skip_threads_232714)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232715) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232080)[sext_i32_i64(local_tid_232694)] =\n                            x_232707;\n                        x_232708 = x_232707;\n                    }\n                }\n                if (sle32(wave_sizze_232696, skip_threads_232714)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232714 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232717 = squot32(local_tid_232694, 32) == 0 ||\n         !ltid_in_bounds_232710;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232717) {\n                x_207621 = x_207620;\n                x_207620 = ((__local\n                             int64_t *) color_232080)[sext_i32_i64(squo",
            "t32(local_tid_232694,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232718 = slt64(srem64(sext_i32_i64(local_tid_232694),\n                                                defunc_0_f_res_203721),\n                                         sext_i32_i64(local_tid_232694) -\n                                         sext_i32_i64(squot32(local_tid_232694,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232717) {\n                if (inactive_232718) {\n                    x_207620 = x_207621;\n                }\n            }\n            if (!no_carry_in_232717) {\n                if (!inactive_232718) {\n                    int64_t defunc_1_op_res_207622 = add64(x_207620, x_207621);\n                    \n                    x_207620 = defunc_1_op_res_207622;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232717) {\n                ((__local\n                  int64_t *) color_232080)[sext_i32_i64(local_tid_232694)] =\n                    x_207620;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232694, 32) == 0 && ltid_in_bounds_232710) {\n            ((__local int64_t *) color_232080)[sext_i32_i64(local_tid_232694)] =\n                x_207621;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_207627;\n    \n    last_res_207627 = ((__local int64_t *) color_232080)[i_203808];\n    ((__local int64_t *) color_232079)[sext_i32_i64(local_tid_232694)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_207630 = sext_i32_i64(sext_i64_i32(ltid_pre_232698));\n    int32_t phys_tid_207631 = local_tid_232694;\n    double x_2076",
            "32;\n    \n    x_207632 = ((__global double *) mem_229314)[gtid_207612 *\n                                                (defunc_0_f_res_203721 *\n                                                 n_p_203574) + gtid_207613 *\n                                                defunc_0_f_res_203721 +\n                                                write_i_207630];\n    \n    bool isnan_res_207635;\n    \n    isnan_res_207635 = futrts_isnan64(x_207632);\n    \n    bool defunc_0_p_res_207636 = !isnan_res_207635;\n    int64_t defunc_1_f_res_207637;\n    \n    if (defunc_0_p_res_207636) {\n        int64_t x_207633;\n        \n        x_207633 = ((__local int64_t *) color_232080)[write_i_207630];\n        \n        int64_t defunc_1_f_res_t_res_207638 = sub64(x_207633, (int64_t) 1);\n        \n        defunc_1_f_res_207637 = defunc_1_f_res_t_res_207638;\n    } else {\n        defunc_1_f_res_207637 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_207637) &&\n        slt64(defunc_1_f_res_207637, defunc_0_f_res_203721)) {\n        ((__local int64_t *) color_232079)[defunc_1_f_res_207637] =\n            write_i_207630;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232719;\n    \n    tmp_232719 = ((__local\n                   int64_t *) color_232079)[sext_i32_i64(local_tid_232694)];\n    ((__global int64_t *) mem_229348)[gtid_207612 * (defunc_0_f_res_203721 *\n                                                     n_p_203574) + gtid_207613 *\n                                      defunc_0_f_res_203721 +\n                                      sext_i32_i64(local_tid_232694)] =\n        tmp_232719;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232694 == 0) {\n        ((__global int64_t *) mem_229352)[gtid_207612 * n_p_203574 +\n                                          gtid_207613] = last_res_207627;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207867(__global int *global_failure,\n                                             int failure_is_an_option, __glob",
            "al\n                                             int64_t *global_failure_args,\n                                             uint color_232087_backing_offset_0,\n                                             uint color_232086_backing_offset_1,\n                                             uint color_232085_backing_offset_2,\n                                             uint color_232084_backing_offset_3,\n                                             uint color_232083_backing_offset_4,\n                                             uint color_232082_backing_offset_5,\n                                             uint color_232081_backing_offset_6,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t i_203808,\n                                             unsigned char x_203809_bits,\n                                             int64_t min_res_203839,\n                                             unsigned char loop_cond_203844_bits,\n                                             double i64_res_203845,\n                                             int64_t computed_group_sizze_207709,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global unsigned char *mem_229406,\n                                             __global unsigned char *mem_229411)\n{\n  ",
            "  bool x_203809 = x_203809_bits;\n    bool loop_cond_203844 = loop_cond_203844_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232087_backing_6 =\n                           &shared_mem[color_232087_backing_offset_0];\n    volatile unsigned char *color_232086_backing_5 =\n                           &shared_mem[color_232086_backing_offset_1];\n    volatile unsigned char *color_232085_backing_4 =\n                           &shared_mem[color_232085_backing_offset_2];\n    volatile unsigned char *color_232084_backing_3 =\n                           &shared_mem[color_232084_backing_offset_3];\n    volatile unsigned char *color_232083_backing_2 =\n                           &shared_mem[color_232083_backing_offset_4];\n    volatile unsigned char *color_232082_backing_1 =\n                           &shared_mem[color_232082_backing_offset_5];\n    volatile unsigned char *color_232081_backing_0 =\n                           &shared_mem[color_232081_backing_offset_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_232853;\n    int32_t local_tid_232854;\n    int64_t group_sizze_232857;\n    int32_t wave_sizze_232856;\n    int32_t group_tid_232855;\n    \n    global_tid_232853 = get_global_id(0);\n    local_tid_232854 = get_local_id(0);\n    group_sizze_232857 = get_local_size(0);\n    wave_sizze_232856 = LOCKSTEP_WIDTH;\n    group_tid_232855 = get_group_id(0);\n    \n    int32_t phys_tid_207867 = group_tid_232855;\n    int64_t slice_232859 = n_p_203574;\n    int64_t ltid_pre_232858 = sext_i32_i64(local_tid_232854);\n    int64_t remnant_232860 = sext_i32_i64(local_tid_232854) - ltid_pre_232858;\n    int64_t slice_232863 = defunc_0_f_res_203721;\n    int64_t slice_232864 = n_p_203574 * slice_232863;\n    int64_t lt",
            "id_pre_232861 = squot64(sext_i32_i64(local_tid_232854),\n                                      slice_232863);\n    int64_t remnant_232865 = sext_i32_i64(local_tid_232854) - ltid_pre_232861 *\n            slice_232863;\n    int64_t ltid_pre_232862 = remnant_232865;\n    int64_t remnant_232866 = remnant_232865 - ltid_pre_232862;\n    int64_t slice_232869 = s_n_m_203726;\n    int64_t slice_232870 = n_p_203574 * slice_232869;\n    int64_t ltid_pre_232867 = squot64(sext_i32_i64(local_tid_232854),\n                                      slice_232869);\n    int64_t remnant_232871 = sext_i32_i64(local_tid_232854) - ltid_pre_232867 *\n            slice_232869;\n    int64_t ltid_pre_232868 = remnant_232871;\n    int64_t remnant_232872 = remnant_232871 - ltid_pre_232868;\n    int64_t slice_232873 = partition_sizze_203667;\n    int64_t gtid_207866 = sext_i32_i64(group_tid_232855);\n    int64_t remnant_232874 = sext_i32_i64(group_tid_232855) - gtid_207866;\n    __local unsigned char *color_232081;\n    \n    color_232081 = (__local unsigned char *) color_232081_backing_0;\n    \n    __local unsigned char *color_232082;\n    \n    color_232082 = (__local unsigned char *) color_232082_backing_1;\n    \n    __local unsigned char *color_232083;\n    \n    color_232083 = (__local unsigned char *) color_232083_backing_2;\n    \n    __local unsigned char *color_232084;\n    \n    color_232084 = (__local unsigned char *) color_232084_backing_3;\n    \n    __local unsigned char *color_232085;\n    \n    color_232085 = (__local unsigned char *) color_232085_backing_4;\n    \n    __local unsigned char *color_232086;\n    \n    color_232086 = (__local unsigned char *) color_232086_backing_5;\n    \n    __local unsigned char *color_232087;\n    \n    color_232087 = (__local unsigned char *) color_232087_backing_6;\n    \n    int64_t gtid_207873 = sext_i32_i64(sext_i64_i32(ltid_pre_232861));\n    int64_t gtid_207874 = sext_i32_i64(sext_i64_i32(ltid_pre_232862));\n    int32_t phys_tid_207875 = local_tid_232854;\n    \n    if (slt64(gtid_20787",
            "3, n_p_203574) && slt64(gtid_207874,\n                                                defunc_0_f_res_203721)) {\n        int64_t x_207876;\n        \n        x_207876 = ((__global int64_t *) ext_mem_229373)[gtid_207866 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_207873 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_207874];\n        \n        int64_t defunc_0_f_res_207877 = add64((int64_t) 1, x_207876);\n        \n        ((__local int64_t *) color_232087)[gtid_207873 * defunc_0_f_res_203721 +\n                                           gtid_207874] = defunc_0_f_res_207877;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207882 = sext_i32_i64(sext_i64_i32(ltid_pre_232858));\n    int32_t phys_tid_207883 = local_tid_232854;\n    \n    if (slt64(gtid_207882, n_p_203574)) {\n        int64_t x_207884;\n        \n        x_207884 = ((__global int64_t *) ext_mem_229372)[gtid_207866 *\n                                                         n_p_203574 +\n                                                         gtid_207882];\n        \n        int64_t min_arg_207885 = sub64(x_207884, (int64_t) 1);\n        int64_t min_arg_207886 = sub64(x_207884, min_res_203839);\n        int64_t min_res_207887 = smin64(q_s_203575, x_207884);\n        double i64_res_207888 = sitofp_i64_f64(x_207884);\n        double x_207889 = i64_res_203845 - i64_res_207888;\n        double max_arg_207890 = x_207889 / 2.0;\n        double max_res_207891 = fmax64(0.0, max_arg_207890);\n        \n        ((__local int64_t *) color_232086)[gtid_207882] = min_arg_207885;\n        ((__local int64_t *) color_232085)[gtid_207882] = min_arg_207886;\n        ((__local int64_t *) color_232084)[gtid_207882] = min_res_207887;\n        ((__local double *) color_232083",
            ")[gtid_207882] = max_res_207891;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207894 = sext_i32_i64(sext_i64_i32(ltid_pre_232867));\n    int64_t gtid_207895 = sext_i32_i64(sext_i64_i32(ltid_pre_232868));\n    int32_t phys_tid_207896 = local_tid_232854;\n    \n    if (slt64(gtid_207894, n_p_203574) && slt64(gtid_207895, s_n_m_203726)) {\n        int64_t min_arg_207898;\n        \n        min_arg_207898 = ((__local int64_t *) color_232086)[gtid_207894];\n        \n        int64_t min_arg_207899;\n        \n        min_arg_207899 = ((__local int64_t *) color_232085)[gtid_207894];\n        \n        int64_t min_res_207900;\n        \n        min_res_207900 = ((__local int64_t *) color_232084)[gtid_207894];\n        \n        double max_res_207901;\n        \n        max_res_207901 = ((__local double *) color_232083)[gtid_207894];\n        \n        bool cond_207903 = gtid_207895 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_207904;\n        \n        if (cond_207903) {\n            defunc_0_m_fun_res_207904 = (int64_t) 0;\n        } else {\n            int64_t y_207905 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_207906 = gtid_207895 == y_207905;\n            int64_t defunc_0_m_fun_res_f_res_207907;\n            \n            if (cond_207906) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207908 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207907 =\n                    defunc_0_m_fun_res_f_res_t_res_207908;\n            } else {\n                int64_t x_207909 = sub64(gtid_207895, (int64_t) 1);\n                int64_t x_207910 = mul64(jump_s_203581, x_207909);\n                int64_t min_arg_207911 = add64((int64_t) 1, x_207910);\n                int64_t min_res_207912 = smin64(defunc_0_f_res_203721,\n                                                min_arg_207911);\n                \n                defunc_0_m_fun_res_f_res_207907 = min_res_207912;\n            }\n            defunc_",
            "0_m_fun_res_207904 = defunc_0_m_fun_res_f_res_207907;\n        }\n        \n        bool init_idx_207913;\n        int64_t init_idx_207914;\n        int64_t init_idx_207915;\n        bool loop_while_207916;\n        int64_t low_207917;\n        int64_t high_207918;\n        \n        loop_while_207916 = x_203809;\n        low_207917 = (int64_t) 0;\n        high_207918 = i_203808;\n        while (loop_while_207916) {\n            int64_t x_207919 = add64(low_207917, high_207918);\n            int64_t mid_207920 = sdiv64(x_207919, (int64_t) 2);\n            bool x_207921 = sle64((int64_t) 0, mid_207920);\n            bool y_207922 = slt64(mid_207920, defunc_0_f_res_203721);\n            bool bounds_check_207923 = x_207921 && y_207922;\n            bool index_certs_207924;\n            \n            if (!bounds_check_207923) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 2) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_207920;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t mid_id_207925;\n            \n            mid_id_207925 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                               defunc_0_f_res_203721 +\n                                                               mid_207920];\n            \n            bool cond_207926 = slt64(mid_id_207925, (int64_t) 0);\n            int64_t mid_idx_207927;\n            \n            if (cond_207926) {\n                mid_idx_207927 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_207927 = mid_id_207925;\n            }\n            \n            bool cond_207928 = sle64(defunc_0_m_fun_res_207904, mid_idx_207927);\n            int64_t loo",
            "pres_207929;\n            int64_t loopres_207930;\n            \n            if (cond_207928) {\n                int64_t loopres_t_res_207931 = sub64(mid_207920, (int64_t) 1);\n                \n                loopres_207929 = low_207917;\n                loopres_207930 = loopres_t_res_207931;\n            } else {\n                int64_t loopres_f_res_207932 = add64((int64_t) 1, mid_207920);\n                \n                loopres_207929 = loopres_f_res_207932;\n                loopres_207930 = high_207918;\n            }\n            \n            bool loop_cond_207933 = sle64(loopres_207929, loopres_207930);\n            bool loop_while_tmp_232875 = loop_cond_207933;\n            int64_t low_tmp_232876 = loopres_207929;\n            int64_t high_tmp_232877 = loopres_207930;\n            \n            loop_while_207916 = loop_while_tmp_232875;\n            low_207917 = low_tmp_232876;\n            high_207918 = high_tmp_232877;\n        }\n        init_idx_207913 = loop_while_207916;\n        init_idx_207914 = low_207917;\n        init_idx_207915 = high_207918;\n        \n        bool idx_207934;\n        int64_t idx_207935;\n        int64_t idx_207936;\n        int64_t idx_207937;\n        bool loop_while_207938;\n        int64_t l_idx_207939;\n        int64_t r_idx_207940;\n        int64_t span_207941;\n        \n        loop_while_207938 = loop_cond_203844;\n        l_idx_207939 = init_idx_207914;\n        r_idx_207940 = init_idx_207914;\n        span_207941 = (int64_t) 1;\n        while (loop_while_207938) {\n            int64_t max_arg_207942 = sub64(l_idx_207939, (int64_t) 1);\n            int64_t max_res_207943 = smax64((int64_t) 0, max_arg_207942);\n            int64_t min_arg_207944 = add64((int64_t) 1, r_idx_207940);\n            int64_t min_res_207945 = smin64(min_arg_207898, min_arg_207944);\n            bool x_207946 = sle64((int64_t) 0, max_res_207943);\n            bool y_207947 = slt64(max_res_207943, defunc_0_f_res_203721);\n            bool bounds_check_207948 = x_207946 && y_207947;\n    ",
            "        bool index_certs_207949;\n            \n            if (!bounds_check_207948) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 3) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_207943;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207950;\n            \n            x_207950 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                          defunc_0_f_res_203721 +\n                                                          max_res_207943];\n            \n            int64_t abs_arg_207951 = sub64(x_207950, defunc_0_m_fun_res_207904);\n            int64_t abs_res_207952 = abs64(abs_arg_207951);\n            bool x_207953 = sle64((int64_t) 0, min_res_207945);\n            bool y_207954 = slt64(min_res_207945, defunc_0_f_res_203721);\n            bool bounds_check_207955 = x_207953 && y_207954;\n            bool index_certs_207956;\n            \n            if (!bounds_check_207955) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_207945;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207957;\n            \n            x_207957 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                          defunc_0_f_res_203721 +\n                                              ",
            "            min_res_207945];\n            \n            int64_t abs_arg_207958 = sub64(x_207957, defunc_0_m_fun_res_207904);\n            int64_t abs_res_207959 = abs64(abs_arg_207958);\n            bool cond_207960 = max_res_207943 == l_idx_207939;\n            int64_t loopres_207961;\n            int64_t loopres_207962;\n            int64_t loopres_207963;\n            \n            if (cond_207960) {\n                loopres_207961 = l_idx_207939;\n                loopres_207962 = r_idx_207940;\n                loopres_207963 = min_res_203839;\n            } else {\n                bool cond_207964 = slt64(abs_res_207952, abs_res_207959);\n                bool cond_f_res_207965 = min_res_207945 == r_idx_207940;\n                bool x_207966 = !cond_207964;\n                bool y_207967 = cond_f_res_207965 && x_207966;\n                bool cond_207968 = cond_207964 || y_207967;\n                int64_t loopres_f_res_207969;\n                \n                if (cond_207968) {\n                    loopres_f_res_207969 = max_res_207943;\n                } else {\n                    loopres_f_res_207969 = l_idx_207939;\n                }\n                \n                int64_t loopres_f_res_207970;\n                \n                if (cond_207968) {\n                    loopres_f_res_207970 = r_idx_207940;\n                } else {\n                    loopres_f_res_207970 = min_res_207945;\n                }\n                \n                int64_t loopres_f_res_207971;\n                \n                if (cond_207968) {\n                    int64_t loopres_f_res_t_res_207972 = add64((int64_t) 1,\n                                                               span_207941);\n                    \n                    loopres_f_res_207971 = loopres_f_res_t_res_207972;\n                } else {\n                    int64_t loopres_f_res_f_res_207973 = add64((int64_t) 1,\n                                                               span_207941);\n                    \n                    loopres_f_re",
            "s_207971 = loopres_f_res_f_res_207973;\n                }\n                loopres_207961 = loopres_f_res_207969;\n                loopres_207962 = loopres_f_res_207970;\n                loopres_207963 = loopres_f_res_207971;\n            }\n            \n            bool loop_cond_207974 = slt64(loopres_207963, min_res_203839);\n            bool loop_while_tmp_232878 = loop_cond_207974;\n            int64_t l_idx_tmp_232879 = loopres_207961;\n            int64_t r_idx_tmp_232880 = loopres_207962;\n            int64_t span_tmp_232881 = loopres_207963;\n            \n            loop_while_207938 = loop_while_tmp_232878;\n            l_idx_207939 = l_idx_tmp_232879;\n            r_idx_207940 = r_idx_tmp_232880;\n            span_207941 = span_tmp_232881;\n        }\n        idx_207934 = loop_while_207938;\n        idx_207935 = l_idx_207939;\n        idx_207936 = r_idx_207940;\n        idx_207937 = span_207941;\n        \n        int64_t min_res_207975 = smin64(min_arg_207899, idx_207935);\n        int64_t max_res_207976 = smax64((int64_t) 0, min_res_207975);\n        int64_t defunc_0_m_fun_res_207977;\n        \n        if (cond_207903) {\n            defunc_0_m_fun_res_207977 = (int64_t) 0;\n        } else {\n            int64_t y_207978 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_207979 = gtid_207895 == y_207978;\n            int64_t defunc_0_m_fun_res_f_res_207980;\n            \n            if (cond_207979) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207981 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207980 =\n                    defunc_0_m_fun_res_f_res_t_res_207981;\n            } else {\n                int64_t x_207982 = sub64(gtid_207895, (int64_t) 1);\n                int64_t x_207983 = mul64(jump_s_203581, x_207982);\n                int64_t min_arg_207984 = add64((int64_t) 1, x_207983);\n                int64_t min_res_207985 = smin64(defunc_0_f_res_203721,\n                               ",
            "                 min_arg_207984);\n                \n                defunc_0_m_fun_res_f_res_207980 = min_res_207985;\n            }\n            defunc_0_m_fun_res_207977 = defunc_0_m_fun_res_f_res_207980;\n        }\n        \n        int64_t x_207986 = add64(min_res_207900, max_res_207976);\n        int64_t r_207987 = sub64(x_207986, (int64_t) 1);\n        bool x_207988 = sle64((int64_t) 0, r_207987);\n        bool y_207989 = slt64(r_207987, defunc_0_f_res_203721);\n        bool bounds_check_207990 = x_207988 && y_207989;\n        bool index_certs_207991;\n        \n        if (!bounds_check_207990) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 5) == -1) {\n                    global_failure_args[0] = (int64_t) r_207987;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }\n        \n        int64_t x_207992;\n        \n        x_207992 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                      defunc_0_f_res_203721 +\n                                                      r_207987];\n        \n        int64_t abs_arg_207993 = sub64(x_207992, defunc_0_m_fun_res_207977);\n        int64_t abs_res_207994 = abs64(abs_arg_207993);\n        bool x_207995 = sle64((int64_t) 0, max_res_207976);\n        bool y_207996 = slt64(max_res_207976, defunc_0_f_res_203721);\n        bool bounds_check_207997 = x_207995 && y_207996;\n        bool index_certs_207998;\n        \n        if (!bounds_check_207997) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 6) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_207976;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }",
            "\n        \n        int64_t x_207999;\n        \n        x_207999 = ((__local int64_t *) color_232087)[gtid_207894 *\n                                                      defunc_0_f_res_203721 +\n                                                      max_res_207976];\n        \n        int64_t abs_arg_208000 = sub64(x_207999, defunc_0_m_fun_res_207977);\n        int64_t abs_res_208001 = abs64(abs_arg_208000);\n        int64_t max_res_208002 = smax64(abs_res_207994, abs_res_208001);\n        double defunc_0_f_res_208003 = sitofp_i64_f64(max_res_208002);\n        double defunc_1_f_res_208004 = max_res_207901 + defunc_0_f_res_208003;\n        \n        ((__local double *) color_232082)[gtid_207894 * s_n_m_203726 +\n                                          gtid_207895] = defunc_1_f_res_208004;\n        ((__local int64_t *) color_232081)[gtid_207894 * s_n_m_203726 +\n                                           gtid_207895] = max_res_207976;\n    }\n    \n  error_2:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232882 = 0; i_232882 < sdiv_up64(n_p_203574 * s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232854),\n                                                    computed_group_sizze_207709);\n         i_232882++) {\n        int64_t tmp_232883;\n        \n        tmp_232883 = ((__local int64_t *) color_232081)[squot64(i_232882 *\n                                                                computed_group_sizze_207709 +\n                                                                sext_i32_i64(local_tid_232854),\n                                                                s_n_m_203726) *\n                                                        s_n_m_203726 +\n                                                        (i_232882 *\n                                                         computed_group_sizze_207709 +\n                                                         sext",
            "_i32_i64(local_tid_232854) -\n                                                         squot64(i_232882 *\n                                                                 computed_group_sizze_207709 +\n                                                                 sext_i32_i64(local_tid_232854),\n                                                                 s_n_m_203726) *\n                                                         s_n_m_203726)];\n        ((__global int64_t *) mem_229406)[gtid_207866 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          squot64(i_232882 *\n                                                  computed_group_sizze_207709 +\n                                                  sext_i32_i64(local_tid_232854),\n                                                  s_n_m_203726) * s_n_m_203726 +\n                                          (i_232882 *\n                                           computed_group_sizze_207709 +\n                                           sext_i32_i64(local_tid_232854) -\n                                           squot64(i_232882 *\n                                                   computed_group_sizze_207709 +\n                                                   sext_i32_i64(local_tid_232854),\n                                                   s_n_m_203726) *\n                                           s_n_m_203726)] = tmp_232883;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232884 = 0; i_232884 < sdiv_up64(n_p_203574 * s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232854),\n                                                    computed_group_sizze_207709);\n         i_232884++) {\n        double tmp_232885;\n        \n        tmp_232885 = ((__local double *) color_232082)[squot64(i_232884 *\n                                                               computed_group_sizze_207709 +\n                      ",
            "                                         sext_i32_i64(local_tid_232854),\n                                                               s_n_m_203726) *\n                                                       s_n_m_203726 +\n                                                       (i_232884 *\n                                                        computed_group_sizze_207709 +\n                                                        sext_i32_i64(local_tid_232854) -\n                                                        squot64(i_232884 *\n                                                                computed_group_sizze_207709 +\n                                                                sext_i32_i64(local_tid_232854),\n                                                                s_n_m_203726) *\n                                                        s_n_m_203726)];\n        ((__global double *) mem_229411)[gtid_207866 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         squot64(i_232884 *\n                                                 computed_group_sizze_207709 +\n                                                 sext_i32_i64(local_tid_232854),\n                                                 s_n_m_203726) * s_n_m_203726 +\n                                         (i_232884 *\n                                          computed_group_sizze_207709 +\n                                          sext_i32_i64(local_tid_232854) -\n                                          squot64(i_232884 *\n                                                  computed_group_sizze_207709 +\n                                                  sext_i32_i64(local_tid_232854),\n                                                  s_n_m_203726) *\n                                          s_n_m_203726)] = tmp_232885;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_3:\n    return;\n}\n__kernel void mainzisegmap_intragroup_208771(__g",
            "lobal int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_232090_backing_offset_0,\n                                             uint color_232089_backing_offset_1,\n                                             uint color_232088_backing_offset_2,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t i_203808,\n                                             unsigned char x_203809_bits,\n                                             int64_t min_res_203839,\n                                             unsigned char loop_cond_203844_bits,\n                                             double i64_res_203845,\n                                             int64_t computed_group_sizze_208757,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global unsigned char *mem_229428,\n                                             __global unsigned char *mem_229433)\n{\n    bool x_203809 = x_203809_bits;\n    bool loop_cond_203844 = loop_cond_203844_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232090_backi",
            "ng_2 =\n                           &shared_mem[color_232090_backing_offset_0];\n    volatile unsigned char *color_232089_backing_1 =\n                           &shared_mem[color_232089_backing_offset_1];\n    volatile unsigned char *color_232088_backing_0 =\n                           &shared_mem[color_232088_backing_offset_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_232886;\n    int32_t local_tid_232887;\n    int64_t group_sizze_232890;\n    int32_t wave_sizze_232889;\n    int32_t group_tid_232888;\n    \n    global_tid_232886 = get_global_id(0);\n    local_tid_232887 = get_local_id(0);\n    group_sizze_232890 = get_local_size(0);\n    wave_sizze_232889 = LOCKSTEP_WIDTH;\n    group_tid_232888 = get_group_id(0);\n    \n    int32_t phys_tid_208771 = group_tid_232888;\n    int64_t slice_232892 = defunc_0_f_res_203721;\n    int64_t ltid_pre_232891 = sext_i32_i64(local_tid_232887);\n    int64_t remnant_232893 = sext_i32_i64(local_tid_232887) - ltid_pre_232891;\n    int64_t slice_232895 = s_n_m_203726;\n    int64_t ltid_pre_232894 = sext_i32_i64(local_tid_232887);\n    int64_t remnant_232896 = sext_i32_i64(local_tid_232887) - ltid_pre_232894;\n    int64_t slice_232897 = n_p_203574;\n    int64_t slice_232898 = partition_sizze_203667 * slice_232897;\n    int64_t gtid_208769 = squot64(sext_i32_i64(group_tid_232888), slice_232897);\n    int64_t remnant_232899 = sext_i32_i64(group_tid_232888) - gtid_208769 *\n            slice_232897;\n    int64_t gtid_208770 = remnant_232899;\n    int64_t remnant_232900 = remnant_232899 - gtid_208770;\n    __local unsigned char *color_232088;\n    \n    color_232088 = (__local unsigned char *) color_232088_backing_0;\n    \n    __local unsigned char *color_232089;\n    \n    color_232089 = (__local unsigned char *) color_232089_backing_1;\n    \n    __local ",
            "unsigned char *color_232090;\n    \n    color_232090 = (__local unsigned char *) color_232090_backing_2;\n    \n    int64_t x_208774;\n    \n    x_208774 = ((__global int64_t *) ext_mem_229372)[gtid_208769 * n_p_203574 +\n                                                     gtid_208770];\n    \n    int64_t gtid_208776 = sext_i32_i64(sext_i64_i32(ltid_pre_232891));\n    int32_t phys_tid_208777 = local_tid_232887;\n    \n    if (slt64(gtid_208776, defunc_0_f_res_203721)) {\n        int64_t x_208778;\n        \n        x_208778 = ((__global int64_t *) ext_mem_229373)[gtid_208769 *\n                                                         (defunc_0_f_res_203721 *\n                                                          n_p_203574) +\n                                                         gtid_208770 *\n                                                         defunc_0_f_res_203721 +\n                                                         gtid_208776];\n        \n        int64_t defunc_0_f_res_208779 = add64((int64_t) 1, x_208778);\n        \n        ((__local int64_t *) color_232090)[gtid_208776] = defunc_0_f_res_208779;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_208780 = sub64(x_208774, (int64_t) 1);\n    int64_t min_arg_208781 = sub64(x_208774, min_res_203839);\n    int64_t min_res_208782 = smin64(q_s_203575, x_208774);\n    double i64_res_208783 = sitofp_i64_f64(x_208774);\n    double x_208784 = i64_res_203845 - i64_res_208783;\n    double max_arg_208785 = x_208784 / 2.0;\n    double max_res_208786 = fmax64(0.0, max_arg_208785);\n    int64_t gtid_208789 = sext_i32_i64(sext_i64_i32(ltid_pre_232894));\n    int32_t phys_tid_208790 = local_tid_232887;\n    \n    if (slt64(gtid_208789, s_n_m_203726)) {\n        bool cond_208792 = gtid_208789 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208793;\n        \n        if (cond_208792) {\n            defunc_0_m_fun_res_208793 = (int64_t) 0;\n        } else {\n            int64_t y_208794 = sub64(s_n_m_203726, (int64_t) 1);\n            ",
            "bool cond_208795 = gtid_208789 == y_208794;\n            int64_t defunc_0_m_fun_res_f_res_208796;\n            \n            if (cond_208795) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208797 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208796 =\n                    defunc_0_m_fun_res_f_res_t_res_208797;\n            } else {\n                int64_t x_208798 = sub64(gtid_208789, (int64_t) 1);\n                int64_t x_208799 = mul64(jump_s_203581, x_208798);\n                int64_t min_arg_208800 = add64((int64_t) 1, x_208799);\n                int64_t min_res_208801 = smin64(defunc_0_f_res_203721,\n                                                min_arg_208800);\n                \n                defunc_0_m_fun_res_f_res_208796 = min_res_208801;\n            }\n            defunc_0_m_fun_res_208793 = defunc_0_m_fun_res_f_res_208796;\n        }\n        \n        bool init_idx_208802;\n        int64_t init_idx_208803;\n        int64_t init_idx_208804;\n        bool loop_while_208805;\n        int64_t low_208806;\n        int64_t high_208807;\n        \n        loop_while_208805 = x_203809;\n        low_208806 = (int64_t) 0;\n        high_208807 = i_203808;\n        while (loop_while_208805) {\n            int64_t x_208808 = add64(low_208806, high_208807);\n            int64_t mid_208809 = sdiv64(x_208808, (int64_t) 2);\n            bool x_208810 = sle64((int64_t) 0, mid_208809);\n            bool y_208811 = slt64(mid_208809, defunc_0_f_res_203721);\n            bool bounds_check_208812 = x_208810 && y_208811;\n            bool index_certs_208813;\n            \n            if (!bounds_check_208812) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 7) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208809;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n      ",
            "                  ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_208814;\n            \n            mid_id_208814 = ((__local int64_t *) color_232090)[mid_208809];\n            \n            bool cond_208815 = slt64(mid_id_208814, (int64_t) 0);\n            int64_t mid_idx_208816;\n            \n            if (cond_208815) {\n                mid_idx_208816 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208816 = mid_id_208814;\n            }\n            \n            bool cond_208817 = sle64(defunc_0_m_fun_res_208793, mid_idx_208816);\n            int64_t loopres_208818;\n            int64_t loopres_208819;\n            \n            if (cond_208817) {\n                int64_t loopres_t_res_208820 = sub64(mid_208809, (int64_t) 1);\n                \n                loopres_208818 = low_208806;\n                loopres_208819 = loopres_t_res_208820;\n            } else {\n                int64_t loopres_f_res_208821 = add64((int64_t) 1, mid_208809);\n                \n                loopres_208818 = loopres_f_res_208821;\n                loopres_208819 = high_208807;\n            }\n            \n            bool loop_cond_208822 = sle64(loopres_208818, loopres_208819);\n            bool loop_while_tmp_232901 = loop_cond_208822;\n            int64_t low_tmp_232902 = loopres_208818;\n            int64_t high_tmp_232903 = loopres_208819;\n            \n            loop_while_208805 = loop_while_tmp_232901;\n            low_208806 = low_tmp_232902;\n            high_208807 = high_tmp_232903;\n        }\n        init_idx_208802 = loop_while_208805;\n        init_idx_208803 = low_208806;\n        init_idx_208804 = high_208807;\n        \n        bool idx_208823;\n        int64_t idx_208824;\n        int64_t idx_208825;\n        int64_t idx_208826;\n        bool loop_while_208827;\n        int64_t l_idx_208828;\n        int64_t r_idx_208829;\n        int64_t span_",
            "208830;\n        \n        loop_while_208827 = loop_cond_203844;\n        l_idx_208828 = init_idx_208803;\n        r_idx_208829 = init_idx_208803;\n        span_208830 = (int64_t) 1;\n        while (loop_while_208827) {\n            int64_t max_arg_208831 = sub64(l_idx_208828, (int64_t) 1);\n            int64_t max_res_208832 = smax64((int64_t) 0, max_arg_208831);\n            int64_t min_arg_208833 = add64((int64_t) 1, r_idx_208829);\n            int64_t min_res_208834 = smin64(min_arg_208780, min_arg_208833);\n            bool x_208835 = sle64((int64_t) 0, max_res_208832);\n            bool y_208836 = slt64(max_res_208832, defunc_0_f_res_203721);\n            bool bounds_check_208837 = x_208835 && y_208836;\n            bool index_certs_208838;\n            \n            if (!bounds_check_208837) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 8) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208832;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208839;\n            \n            x_208839 = ((__local int64_t *) color_232090)[max_res_208832];\n            \n            int64_t abs_arg_208840 = sub64(x_208839, defunc_0_m_fun_res_208793);\n            int64_t abs_res_208841 = abs64(abs_arg_208840);\n            bool x_208842 = sle64((int64_t) 0, min_res_208834);\n            bool y_208843 = slt64(min_res_208834, defunc_0_f_res_203721);\n            bool bounds_check_208844 = x_208842 && y_208843;\n            bool index_certs_208845;\n            \n            if (!bounds_check_208844) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                        -1) {\n                        global_failure_ar",
            "gs[0] = (int64_t) min_res_208834;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203721;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208846;\n            \n            x_208846 = ((__local int64_t *) color_232090)[min_res_208834];\n            \n            int64_t abs_arg_208847 = sub64(x_208846, defunc_0_m_fun_res_208793);\n            int64_t abs_res_208848 = abs64(abs_arg_208847);\n            bool cond_208849 = max_res_208832 == l_idx_208828;\n            int64_t loopres_208850;\n            int64_t loopres_208851;\n            int64_t loopres_208852;\n            \n            if (cond_208849) {\n                loopres_208850 = l_idx_208828;\n                loopres_208851 = r_idx_208829;\n                loopres_208852 = min_res_203839;\n            } else {\n                bool cond_208853 = slt64(abs_res_208841, abs_res_208848);\n                bool cond_f_res_208854 = min_res_208834 == r_idx_208829;\n                bool x_208855 = !cond_208853;\n                bool y_208856 = cond_f_res_208854 && x_208855;\n                bool cond_208857 = cond_208853 || y_208856;\n                int64_t loopres_f_res_208858;\n                \n                if (cond_208857) {\n                    loopres_f_res_208858 = max_res_208832;\n                } else {\n                    loopres_f_res_208858 = l_idx_208828;\n                }\n                \n                int64_t loopres_f_res_208859;\n                \n                if (cond_208857) {\n                    loopres_f_res_208859 = r_idx_208829;\n                } else {\n                    loopres_f_res_208859 = min_res_208834;\n                }\n                \n                int64_t loopres_f_res_208860;\n                \n                if (cond_208857) {\n                    int64_t loopres_f_res_t_res_208861 = add64((int64_t) 1",
            ",\n                                                               span_208830);\n                    \n                    loopres_f_res_208860 = loopres_f_res_t_res_208861;\n                } else {\n                    int64_t loopres_f_res_f_res_208862 = add64((int64_t) 1,\n                                                               span_208830);\n                    \n                    loopres_f_res_208860 = loopres_f_res_f_res_208862;\n                }\n                loopres_208850 = loopres_f_res_208858;\n                loopres_208851 = loopres_f_res_208859;\n                loopres_208852 = loopres_f_res_208860;\n            }\n            \n            bool loop_cond_208863 = slt64(loopres_208852, min_res_203839);\n            bool loop_while_tmp_232904 = loop_cond_208863;\n            int64_t l_idx_tmp_232905 = loopres_208850;\n            int64_t r_idx_tmp_232906 = loopres_208851;\n            int64_t span_tmp_232907 = loopres_208852;\n            \n            loop_while_208827 = loop_while_tmp_232904;\n            l_idx_208828 = l_idx_tmp_232905;\n            r_idx_208829 = r_idx_tmp_232906;\n            span_208830 = span_tmp_232907;\n        }\n        idx_208823 = loop_while_208827;\n        idx_208824 = l_idx_208828;\n        idx_208825 = r_idx_208829;\n        idx_208826 = span_208830;\n        \n        int64_t min_res_208864 = smin64(min_arg_208781, idx_208824);\n        int64_t max_res_208865 = smax64((int64_t) 0, min_res_208864);\n        int64_t defunc_0_m_fun_res_208866;\n        \n        if (cond_208792) {\n            defunc_0_m_fun_res_208866 = (int64_t) 0;\n        } else {\n            int64_t y_208867 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_208868 = gtid_208789 == y_208867;\n            int64_t defunc_0_m_fun_res_f_res_208869;\n            \n            if (cond_208868) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208870 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f",
            "_res_208869 =\n                    defunc_0_m_fun_res_f_res_t_res_208870;\n            } else {\n                int64_t x_208871 = sub64(gtid_208789, (int64_t) 1);\n                int64_t x_208872 = mul64(jump_s_203581, x_208871);\n                int64_t min_arg_208873 = add64((int64_t) 1, x_208872);\n                int64_t min_res_208874 = smin64(defunc_0_f_res_203721,\n                                                min_arg_208873);\n                \n                defunc_0_m_fun_res_f_res_208869 = min_res_208874;\n            }\n            defunc_0_m_fun_res_208866 = defunc_0_m_fun_res_f_res_208869;\n        }\n        \n        int64_t x_208875 = add64(min_res_208782, max_res_208865);\n        int64_t r_208876 = sub64(x_208875, (int64_t) 1);\n        bool x_208877 = sle64((int64_t) 0, r_208876);\n        bool y_208878 = slt64(r_208876, defunc_0_f_res_203721);\n        bool bounds_check_208879 = x_208877 && y_208878;\n        bool index_certs_208880;\n        \n        if (!bounds_check_208879) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 10) == -1) {\n                    global_failure_args[0] = (int64_t) r_208876;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208881;\n        \n        x_208881 = ((__local int64_t *) color_232090)[r_208876];\n        \n        int64_t abs_arg_208882 = sub64(x_208881, defunc_0_m_fun_res_208866);\n        int64_t abs_res_208883 = abs64(abs_arg_208882);\n        bool x_208884 = sle64((int64_t) 0, max_res_208865);\n        bool y_208885 = slt64(max_res_208865, defunc_0_f_res_203721);\n        bool bounds_check_208886 = x_208884 && y_208885;\n        bool index_certs_208887;\n        \n        if (!bounds_check_208886) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 11) == -1) {\n                    gl",
            "obal_failure_args[0] = (int64_t) max_res_208865;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203721;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208888;\n        \n        x_208888 = ((__local int64_t *) color_232090)[max_res_208865];\n        \n        int64_t abs_arg_208889 = sub64(x_208888, defunc_0_m_fun_res_208866);\n        int64_t abs_res_208890 = abs64(abs_arg_208889);\n        int64_t max_res_208891 = smax64(abs_res_208883, abs_res_208890);\n        double defunc_0_f_res_208892 = sitofp_i64_f64(max_res_208891);\n        double defunc_1_f_res_208893 = max_res_208786 + defunc_0_f_res_208892;\n        \n        ((__local double *) color_232089)[gtid_208789] = defunc_1_f_res_208893;\n        ((__local int64_t *) color_232088)[gtid_208789] = max_res_208865;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232908 = 0; i_232908 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232887),\n                                                    computed_group_sizze_208757);\n         i_232908++) {\n        int64_t tmp_232909;\n        \n        tmp_232909 = ((__local int64_t *) color_232088)[i_232908 *\n                                                        computed_group_sizze_208757 +\n                                                        sext_i32_i64(local_tid_232887)];\n        ((__global int64_t *) mem_229428)[gtid_208769 * (s_n_m_203726 *\n                                                         n_p_203574) +\n                                          gtid_208770 * s_n_m_203726 +\n                                          (i_232908 *\n                                           computed_group_sizze_208757 +\n                                           sext_i32_i64(local_tid_232887))] =\n            tmp",
            "_232909;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232910 = 0; i_232910 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_232887),\n                                                    computed_group_sizze_208757);\n         i_232910++) {\n        double tmp_232911;\n        \n        tmp_232911 = ((__local double *) color_232089)[i_232910 *\n                                                       computed_group_sizze_208757 +\n                                                       sext_i32_i64(local_tid_232887)];\n        ((__global double *) mem_229433)[gtid_208769 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_208770 * s_n_m_203726 +\n                                         (i_232910 *\n                                          computed_group_sizze_208757 +\n                                          sext_i32_i64(local_tid_232887))] =\n            tmp_232911;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209172(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_232093_backing_offset_0,\n                                             uint color_232092_backing_offset_1,\n                                             uint color_232091_backing_offset_2,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_l_203583,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                     ",
            "        unsigned char x_203761_bits,\n                                             int64_t min_res_203971,\n                                             unsigned char loop_cond_203976_bits,\n                                             double i64_res_203977,\n                                             int64_t computed_group_sizze_209063,\n                                             __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global unsigned char *mem_229487,\n                                             __global unsigned char *mem_229491)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_203976 = loop_cond_203976_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232093_backing_2 =\n                           &shared_mem[color_232093_backing_offset_0];\n    volatile unsigned char *color_232092_backing_1 =\n                           &shared_mem[color_232092_backing_offset_1];\n    volatile unsigned char *color_232091_backing_0 =\n                           &shared_mem[color_232091_backing_offset_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_232955;\n    int32_t local_tid_232956;\n    int64_t group_sizze_232959;\n    int32_t wave_sizze_232958;\n    int32_t group_tid_232957;\n    \n    global_tid_232955 = get_global_id(0);\n    local_tid_232956 = get_local_id(0);\n    group_sizze_232959 = get_local_size(0);\n    wave_sizze_232958 = LOCKSTEP_WIDTH;\n    group_tid_232957 = get_group_id(0);\n    \n    int32_t phys_tid_209172 = group_tid_232957;\n    int64_t slice_232961 = n_2",
            "03572;\n    int64_t ltid_pre_232960 = sext_i32_i64(local_tid_232956);\n    int64_t remnant_232962 = sext_i32_i64(local_tid_232956) - ltid_pre_232960;\n    int64_t slice_232964 = l_n_m_203733;\n    int64_t ltid_pre_232963 = sext_i32_i64(local_tid_232956);\n    int64_t remnant_232965 = sext_i32_i64(local_tid_232956) - ltid_pre_232963;\n    int64_t slice_232966 = partition_sizze_203667;\n    int64_t gtid_209171 = sext_i32_i64(group_tid_232957);\n    int64_t remnant_232967 = sext_i32_i64(group_tid_232957) - gtid_209171;\n    __local unsigned char *color_232091;\n    \n    color_232091 = (__local unsigned char *) color_232091_backing_0;\n    \n    __local unsigned char *color_232092;\n    \n    color_232092 = (__local unsigned char *) color_232092_backing_1;\n    \n    __local unsigned char *color_232093;\n    \n    color_232093 = (__local unsigned char *) color_232093_backing_2;\n    \n    int64_t x_209175;\n    \n    x_209175 = ((__global int64_t *) ext_mem_229304)[gtid_209171];\n    \n    int64_t gtid_209177 = sext_i32_i64(sext_i64_i32(ltid_pre_232960));\n    int32_t phys_tid_209178 = local_tid_232956;\n    \n    if (slt64(gtid_209177, n_203572)) {\n        int64_t x_209179;\n        \n        x_209179 = ((__global int64_t *) ext_mem_229305)[gtid_209171 *\n                                                         n_203572 +\n                                                         gtid_209177];\n        \n        int64_t defunc_0_f_res_209180 = add64((int64_t) 1, x_209179);\n        \n        ((__local int64_t *) color_232093)[gtid_209177] = defunc_0_f_res_209180;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209181 = sub64(x_209175, (int64_t) 1);\n    int64_t min_arg_209182 = sub64(x_209175, min_res_203971);\n    int64_t min_res_209183 = smin64(q_l_203577, x_209175);\n    double i64_res_209184 = sitofp_i64_f64(x_209175);\n    double x_209185 = i64_res_203977 - i64_res_209184;\n    double max_arg_209186 = x_209185 / 2.0;\n    double max_res_209187 = fmax64(0.0, max_arg_209186);\n    int64_t gt",
            "id_209190 = sext_i32_i64(sext_i64_i32(ltid_pre_232963));\n    int32_t phys_tid_209191 = local_tid_232956;\n    \n    if (slt64(gtid_209190, l_n_m_203733)) {\n        int64_t min_arg_209193 = mul64(jump_l_203583, gtid_209190);\n        int64_t min_res_209194 = smin64(i_203760, min_arg_209193);\n        int64_t defunc_0_g_res_209195 = add64((int64_t) 1, min_res_209194);\n        bool init_idx_209196;\n        int64_t init_idx_209197;\n        int64_t init_idx_209198;\n        bool loop_while_209199;\n        int64_t low_209200;\n        int64_t high_209201;\n        \n        loop_while_209199 = x_203761;\n        low_209200 = (int64_t) 0;\n        high_209201 = i_203760;\n        while (loop_while_209199) {\n            int64_t x_209202 = add64(low_209200, high_209201);\n            int64_t mid_209203 = sdiv64(x_209202, (int64_t) 2);\n            bool x_209204 = sle64((int64_t) 0, mid_209203);\n            bool y_209205 = slt64(mid_209203, n_203572);\n            bool bounds_check_209206 = x_209204 && y_209205;\n            bool index_certs_209207;\n            \n            if (!bounds_check_209206) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 17) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209203;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209208;\n            \n            mid_id_209208 = ((__local int64_t *) color_232093)[mid_209203];\n            \n            bool cond_209209 = slt64(mid_id_209208, (int64_t) 0);\n            int64_t mid_idx_209210;\n            \n            if (cond_209209) {\n                mid_idx_209210 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209210 = mid_id_209208;\n            }\n            \n            bool cond_209211 ",
            "= sle64(defunc_0_g_res_209195, mid_idx_209210);\n            int64_t loopres_209212;\n            int64_t loopres_209213;\n            \n            if (cond_209211) {\n                int64_t loopres_t_res_209214 = sub64(mid_209203, (int64_t) 1);\n                \n                loopres_209212 = low_209200;\n                loopres_209213 = loopres_t_res_209214;\n            } else {\n                int64_t loopres_f_res_209215 = add64((int64_t) 1, mid_209203);\n                \n                loopres_209212 = loopres_f_res_209215;\n                loopres_209213 = high_209201;\n            }\n            \n            bool loop_cond_209216 = sle64(loopres_209212, loopres_209213);\n            bool loop_while_tmp_232968 = loop_cond_209216;\n            int64_t low_tmp_232969 = loopres_209212;\n            int64_t high_tmp_232970 = loopres_209213;\n            \n            loop_while_209199 = loop_while_tmp_232968;\n            low_209200 = low_tmp_232969;\n            high_209201 = high_tmp_232970;\n        }\n        init_idx_209196 = loop_while_209199;\n        init_idx_209197 = low_209200;\n        init_idx_209198 = high_209201;\n        \n        bool idx_209217;\n        int64_t idx_209218;\n        int64_t idx_209219;\n        int64_t idx_209220;\n        bool loop_while_209221;\n        int64_t l_idx_209222;\n        int64_t r_idx_209223;\n        int64_t span_209224;\n        \n        loop_while_209221 = loop_cond_203976;\n        l_idx_209222 = init_idx_209197;\n        r_idx_209223 = init_idx_209197;\n        span_209224 = (int64_t) 1;\n        while (loop_while_209221) {\n            int64_t max_arg_209225 = sub64(l_idx_209222, (int64_t) 1);\n            int64_t max_res_209226 = smax64((int64_t) 0, max_arg_209225);\n            int64_t min_arg_209227 = add64((int64_t) 1, r_idx_209223);\n            int64_t min_res_209228 = smin64(min_arg_209181, min_arg_209227);\n            bool x_209229 = sle64((int64_t) 0, max_res_209226);\n            bool y_209230 = slt64(max_res_209226, n_203572);\n       ",
            "     bool bounds_check_209231 = x_209229 && y_209230;\n            bool index_certs_209232;\n            \n            if (!bounds_check_209231) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 18) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209226;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209233;\n            \n            x_209233 = ((__local int64_t *) color_232093)[max_res_209226];\n            \n            int64_t abs_arg_209234 = sub64(x_209233, defunc_0_g_res_209195);\n            int64_t abs_res_209235 = abs64(abs_arg_209234);\n            bool x_209236 = sle64((int64_t) 0, min_res_209228);\n            bool y_209237 = slt64(min_res_209228, n_203572);\n            bool bounds_check_209238 = x_209236 && y_209237;\n            bool index_certs_209239;\n            \n            if (!bounds_check_209238) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 19) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209228;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209240;\n            \n            x_209240 = ((__local int64_t *) color_232093)[min_res_209228];\n            \n            int64_t abs_arg_209241 = sub64(x_209240, defunc_0_g_res_209195);\n            int64_t abs_res_209242 = abs64(abs_arg_209241);\n            bool cond_209243 = max_res_209226 == l_idx_209222;\n            int64_t loopres_209244;\n            int64_t loopres_209245;\n            int64_t loopres_20924",
            "6;\n            \n            if (cond_209243) {\n                loopres_209244 = l_idx_209222;\n                loopres_209245 = r_idx_209223;\n                loopres_209246 = min_res_203971;\n            } else {\n                bool cond_209247 = slt64(abs_res_209235, abs_res_209242);\n                bool cond_f_res_209248 = min_res_209228 == r_idx_209223;\n                bool x_209249 = !cond_209247;\n                bool y_209250 = cond_f_res_209248 && x_209249;\n                bool cond_209251 = cond_209247 || y_209250;\n                int64_t loopres_f_res_209252;\n                \n                if (cond_209251) {\n                    loopres_f_res_209252 = max_res_209226;\n                } else {\n                    loopres_f_res_209252 = l_idx_209222;\n                }\n                \n                int64_t loopres_f_res_209253;\n                \n                if (cond_209251) {\n                    loopres_f_res_209253 = r_idx_209223;\n                } else {\n                    loopres_f_res_209253 = min_res_209228;\n                }\n                \n                int64_t loopres_f_res_209254;\n                \n                if (cond_209251) {\n                    int64_t loopres_f_res_t_res_209255 = add64((int64_t) 1,\n                                                               span_209224);\n                    \n                    loopres_f_res_209254 = loopres_f_res_t_res_209255;\n                } else {\n                    int64_t loopres_f_res_f_res_209256 = add64((int64_t) 1,\n                                                               span_209224);\n                    \n                    loopres_f_res_209254 = loopres_f_res_f_res_209256;\n                }\n                loopres_209244 = loopres_f_res_209252;\n                loopres_209245 = loopres_f_res_209253;\n                loopres_209246 = loopres_f_res_209254;\n            }\n            \n            bool loop_cond_209257 = slt64(loopres_209246, min_res_203971);\n            bool loop_while",
            "_tmp_232971 = loop_cond_209257;\n            int64_t l_idx_tmp_232972 = loopres_209244;\n            int64_t r_idx_tmp_232973 = loopres_209245;\n            int64_t span_tmp_232974 = loopres_209246;\n            \n            loop_while_209221 = loop_while_tmp_232971;\n            l_idx_209222 = l_idx_tmp_232972;\n            r_idx_209223 = r_idx_tmp_232973;\n            span_209224 = span_tmp_232974;\n        }\n        idx_209217 = loop_while_209221;\n        idx_209218 = l_idx_209222;\n        idx_209219 = r_idx_209223;\n        idx_209220 = span_209224;\n        \n        int64_t min_res_209258 = smin64(min_arg_209182, idx_209218);\n        int64_t max_res_209259 = smax64((int64_t) 0, min_res_209258);\n        int64_t x_209260 = add64(min_res_209183, max_res_209259);\n        int64_t r_209261 = sub64(x_209260, (int64_t) 1);\n        bool x_209262 = sle64((int64_t) 0, r_209261);\n        bool y_209263 = slt64(r_209261, n_203572);\n        bool bounds_check_209264 = x_209262 && y_209263;\n        bool index_certs_209265;\n        \n        if (!bounds_check_209264) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 20) == -1) {\n                    global_failure_args[0] = (int64_t) r_209261;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209266;\n        \n        x_209266 = ((__global int64_t *) ext_mem_229305)[gtid_209171 *\n                                                         n_203572 + r_209261];\n        \n        int64_t abs_arg_209267 = sub64(x_209266, min_res_209194);\n        int64_t abs_res_209268 = abs64(abs_arg_209267);\n        bool x_209269 = sle64((int64_t) 0, max_res_209259);\n        bool y_209270 = slt64(max_res_209259, n_203572);\n        bool bounds_check_209271 = x_209269 && y_209270;\n        bool index_certs_209272;\n        \n        if (!bounds_check_209271) {\n      ",
            "      {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 21) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209259;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209273;\n        \n        x_209273 = ((__global int64_t *) ext_mem_229305)[gtid_209171 *\n                                                         n_203572 +\n                                                         max_res_209259];\n        \n        int64_t abs_arg_209274 = sub64(x_209273, min_res_209194);\n        int64_t abs_res_209275 = abs64(abs_arg_209274);\n        int64_t max_res_209276 = smax64(abs_res_209268, abs_res_209275);\n        double defunc_0_f_res_209277 = sitofp_i64_f64(max_res_209276);\n        double defunc_1_f_res_209278 = max_res_209187 + defunc_0_f_res_209277;\n        \n        ((__local double *) color_232092)[gtid_209190] = defunc_1_f_res_209278;\n        ((__local int64_t *) color_232091)[gtid_209190] = max_res_209259;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232975 = 0; i_232975 < sdiv_up64(l_n_m_203733 -\n                                                    sext_i32_i64(local_tid_232956),\n                                                    computed_group_sizze_209063);\n         i_232975++) {\n        int64_t tmp_232976;\n        \n        tmp_232976 = ((__local int64_t *) color_232091)[i_232975 *\n                                                        computed_group_sizze_209063 +\n                                                        sext_i32_i64(local_tid_232956)];\n        ((__global int64_t *) mem_229487)[gtid_209171 * l_n_m_203733 +\n                                          (i_232975 *\n                                           computed_group_sizze_209063 +\n         ",
            "                                  sext_i32_i64(local_tid_232956))] =\n            tmp_232976;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232977 = 0; i_232977 < sdiv_up64(l_n_m_203733 -\n                                                    sext_i32_i64(local_tid_232956),\n                                                    computed_group_sizze_209063);\n         i_232977++) {\n        double tmp_232978;\n        \n        tmp_232978 = ((__local double *) color_232092)[i_232977 *\n                                                       computed_group_sizze_209063 +\n                                                       sext_i32_i64(local_tid_232956)];\n        ((__global double *) mem_229491)[gtid_209171 * l_n_m_203733 +\n                                         (i_232977 *\n                                          computed_group_sizze_209063 +\n                                          sext_i32_i64(local_tid_232956))] =\n            tmp_232978;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209798(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_232096_backing_offset_0,\n                                             uint color_232095_backing_offset_1,\n                                             uint color_232094_backing_offset_2,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                                             int64_t i_203760,\n                                             unsigned char x_203761_bits,\n                    ",
            "                         int64_t min_res_204083,\n                                             unsigned char loop_cond_204088_bits,\n                                             double i64_res_204089,\n                                             int64_t computed_group_sizze_209689,\n                                             __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global unsigned char *mem_229536,\n                                             __global unsigned char *mem_229540)\n{\n    bool x_203761 = x_203761_bits;\n    bool loop_cond_204088 = loop_cond_204088_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232096_backing_2 =\n                           &shared_mem[color_232096_backing_offset_0];\n    volatile unsigned char *color_232095_backing_1 =\n                           &shared_mem[color_232095_backing_offset_1];\n    volatile unsigned char *color_232094_backing_0 =\n                           &shared_mem[color_232094_backing_offset_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_233015;\n    int32_t local_tid_233016;\n    int64_t group_sizze_233019;\n    int32_t wave_sizze_233018;\n    int32_t group_tid_233017;\n    \n    global_tid_233015 = get_global_id(0);\n    local_tid_233016 = get_local_id(0);\n    group_sizze_233019 = get_local_size(0);\n    wave_sizze_233018 = LOCKSTEP_WIDTH;\n    group_tid_233017 = get_group_id(0);\n    \n    int32_t phys_tid_209798 = group_tid_233017;\n    int64_t slice_233021 = n_203572;\n    int64_t ltid_pre_233020 = sext_i32_i64(local_t",
            "id_233016);\n    int64_t remnant_233022 = sext_i32_i64(local_tid_233016) - ltid_pre_233020;\n    int64_t slice_233024 = t_n_m_203740;\n    int64_t ltid_pre_233023 = sext_i32_i64(local_tid_233016);\n    int64_t remnant_233025 = sext_i32_i64(local_tid_233016) - ltid_pre_233023;\n    int64_t slice_233026 = partition_sizze_203667;\n    int64_t gtid_209797 = sext_i32_i64(group_tid_233017);\n    int64_t remnant_233027 = sext_i32_i64(group_tid_233017) - gtid_209797;\n    __local unsigned char *color_232094;\n    \n    color_232094 = (__local unsigned char *) color_232094_backing_0;\n    \n    __local unsigned char *color_232095;\n    \n    color_232095 = (__local unsigned char *) color_232095_backing_1;\n    \n    __local unsigned char *color_232096;\n    \n    color_232096 = (__local unsigned char *) color_232096_backing_2;\n    \n    int64_t x_209801;\n    \n    x_209801 = ((__global int64_t *) ext_mem_229304)[gtid_209797];\n    \n    int64_t gtid_209803 = sext_i32_i64(sext_i64_i32(ltid_pre_233020));\n    int32_t phys_tid_209804 = local_tid_233016;\n    \n    if (slt64(gtid_209803, n_203572)) {\n        int64_t x_209805;\n        \n        x_209805 = ((__global int64_t *) ext_mem_229305)[gtid_209797 *\n                                                         n_203572 +\n                                                         gtid_209803];\n        \n        int64_t defunc_0_f_res_209806 = add64((int64_t) 1, x_209805);\n        \n        ((__local int64_t *) color_232096)[gtid_209803] = defunc_0_f_res_209806;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209807 = sub64(x_209801, (int64_t) 1);\n    int64_t min_arg_209808 = sub64(x_209801, min_res_204083);\n    int64_t min_res_209809 = smin64(q_t_203576, x_209801);\n    double i64_res_209810 = sitofp_i64_f64(x_209801);\n    double x_209811 = i64_res_204089 - i64_res_209810;\n    double max_arg_209812 = x_209811 / 2.0;\n    double max_res_209813 = fmax64(0.0, max_arg_209812);\n    int64_t gtid_209816 = sext_i32_i64(sext_i64_i32(ltid_pre_233023));\n",
            "    int32_t phys_tid_209817 = local_tid_233016;\n    \n    if (slt64(gtid_209816, t_n_m_203740)) {\n        int64_t min_arg_209819 = mul64(jump_t_203582, gtid_209816);\n        int64_t min_res_209820 = smin64(i_203760, min_arg_209819);\n        int64_t defunc_0_g_res_209821 = add64((int64_t) 1, min_res_209820);\n        bool init_idx_209822;\n        int64_t init_idx_209823;\n        int64_t init_idx_209824;\n        bool loop_while_209825;\n        int64_t low_209826;\n        int64_t high_209827;\n        \n        loop_while_209825 = x_203761;\n        low_209826 = (int64_t) 0;\n        high_209827 = i_203760;\n        while (loop_while_209825) {\n            int64_t x_209828 = add64(low_209826, high_209827);\n            int64_t mid_209829 = sdiv64(x_209828, (int64_t) 2);\n            bool x_209830 = sle64((int64_t) 0, mid_209829);\n            bool y_209831 = slt64(mid_209829, n_203572);\n            bool bounds_check_209832 = x_209830 && y_209831;\n            bool index_certs_209833;\n            \n            if (!bounds_check_209832) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 27) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209829;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209834;\n            \n            mid_id_209834 = ((__local int64_t *) color_232096)[mid_209829];\n            \n            bool cond_209835 = slt64(mid_id_209834, (int64_t) 0);\n            int64_t mid_idx_209836;\n            \n            if (cond_209835) {\n                mid_idx_209836 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209836 = mid_id_209834;\n            }\n            \n            bool cond_209837 = sle64(defunc_0_g_res_209821, mid_idx_209836);\n         ",
            "   int64_t loopres_209838;\n            int64_t loopres_209839;\n            \n            if (cond_209837) {\n                int64_t loopres_t_res_209840 = sub64(mid_209829, (int64_t) 1);\n                \n                loopres_209838 = low_209826;\n                loopres_209839 = loopres_t_res_209840;\n            } else {\n                int64_t loopres_f_res_209841 = add64((int64_t) 1, mid_209829);\n                \n                loopres_209838 = loopres_f_res_209841;\n                loopres_209839 = high_209827;\n            }\n            \n            bool loop_cond_209842 = sle64(loopres_209838, loopres_209839);\n            bool loop_while_tmp_233028 = loop_cond_209842;\n            int64_t low_tmp_233029 = loopres_209838;\n            int64_t high_tmp_233030 = loopres_209839;\n            \n            loop_while_209825 = loop_while_tmp_233028;\n            low_209826 = low_tmp_233029;\n            high_209827 = high_tmp_233030;\n        }\n        init_idx_209822 = loop_while_209825;\n        init_idx_209823 = low_209826;\n        init_idx_209824 = high_209827;\n        \n        bool idx_209843;\n        int64_t idx_209844;\n        int64_t idx_209845;\n        int64_t idx_209846;\n        bool loop_while_209847;\n        int64_t l_idx_209848;\n        int64_t r_idx_209849;\n        int64_t span_209850;\n        \n        loop_while_209847 = loop_cond_204088;\n        l_idx_209848 = init_idx_209823;\n        r_idx_209849 = init_idx_209823;\n        span_209850 = (int64_t) 1;\n        while (loop_while_209847) {\n            int64_t max_arg_209851 = sub64(l_idx_209848, (int64_t) 1);\n            int64_t max_res_209852 = smax64((int64_t) 0, max_arg_209851);\n            int64_t min_arg_209853 = add64((int64_t) 1, r_idx_209849);\n            int64_t min_res_209854 = smin64(min_arg_209807, min_arg_209853);\n            bool x_209855 = sle64((int64_t) 0, max_res_209852);\n            bool y_209856 = slt64(max_res_209852, n_203572);\n            bool bounds_check_209857 = x_209855 && y_209856;\n   ",
            "         bool index_certs_209858;\n            \n            if (!bounds_check_209857) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 28) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209852;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209859;\n            \n            x_209859 = ((__local int64_t *) color_232096)[max_res_209852];\n            \n            int64_t abs_arg_209860 = sub64(x_209859, defunc_0_g_res_209821);\n            int64_t abs_res_209861 = abs64(abs_arg_209860);\n            bool x_209862 = sle64((int64_t) 0, min_res_209854);\n            bool y_209863 = slt64(min_res_209854, n_203572);\n            bool bounds_check_209864 = x_209862 && y_209863;\n            bool index_certs_209865;\n            \n            if (!bounds_check_209864) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 29) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209854;\n                        global_failure_args[1] = (int64_t) n_203572;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209866;\n            \n            x_209866 = ((__local int64_t *) color_232096)[min_res_209854];\n            \n            int64_t abs_arg_209867 = sub64(x_209866, defunc_0_g_res_209821);\n            int64_t abs_res_209868 = abs64(abs_arg_209867);\n            bool cond_209869 = max_res_209852 == l_idx_209848;\n            int64_t loopres_209870;\n            int64_t loopres_209871;\n            int64_t loopres_209872;\n            \n            if (cond_209869) {\n          ",
            "      loopres_209870 = l_idx_209848;\n                loopres_209871 = r_idx_209849;\n                loopres_209872 = min_res_204083;\n            } else {\n                bool cond_209873 = slt64(abs_res_209861, abs_res_209868);\n                bool cond_f_res_209874 = min_res_209854 == r_idx_209849;\n                bool x_209875 = !cond_209873;\n                bool y_209876 = cond_f_res_209874 && x_209875;\n                bool cond_209877 = cond_209873 || y_209876;\n                int64_t loopres_f_res_209878;\n                \n                if (cond_209877) {\n                    loopres_f_res_209878 = max_res_209852;\n                } else {\n                    loopres_f_res_209878 = l_idx_209848;\n                }\n                \n                int64_t loopres_f_res_209879;\n                \n                if (cond_209877) {\n                    loopres_f_res_209879 = r_idx_209849;\n                } else {\n                    loopres_f_res_209879 = min_res_209854;\n                }\n                \n                int64_t loopres_f_res_209880;\n                \n                if (cond_209877) {\n                    int64_t loopres_f_res_t_res_209881 = add64((int64_t) 1,\n                                                               span_209850);\n                    \n                    loopres_f_res_209880 = loopres_f_res_t_res_209881;\n                } else {\n                    int64_t loopres_f_res_f_res_209882 = add64((int64_t) 1,\n                                                               span_209850);\n                    \n                    loopres_f_res_209880 = loopres_f_res_f_res_209882;\n                }\n                loopres_209870 = loopres_f_res_209878;\n                loopres_209871 = loopres_f_res_209879;\n                loopres_209872 = loopres_f_res_209880;\n            }\n            \n            bool loop_cond_209883 = slt64(loopres_209872, min_res_204083);\n            bool loop_while_tmp_233031 = loop_cond_209883;\n            int64_t l_idx",
            "_tmp_233032 = loopres_209870;\n            int64_t r_idx_tmp_233033 = loopres_209871;\n            int64_t span_tmp_233034 = loopres_209872;\n            \n            loop_while_209847 = loop_while_tmp_233031;\n            l_idx_209848 = l_idx_tmp_233032;\n            r_idx_209849 = r_idx_tmp_233033;\n            span_209850 = span_tmp_233034;\n        }\n        idx_209843 = loop_while_209847;\n        idx_209844 = l_idx_209848;\n        idx_209845 = r_idx_209849;\n        idx_209846 = span_209850;\n        \n        int64_t min_res_209884 = smin64(min_arg_209808, idx_209844);\n        int64_t max_res_209885 = smax64((int64_t) 0, min_res_209884);\n        int64_t x_209886 = add64(min_res_209809, max_res_209885);\n        int64_t r_209887 = sub64(x_209886, (int64_t) 1);\n        bool x_209888 = sle64((int64_t) 0, r_209887);\n        bool y_209889 = slt64(r_209887, n_203572);\n        bool bounds_check_209890 = x_209888 && y_209889;\n        bool index_certs_209891;\n        \n        if (!bounds_check_209890) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 30) == -1) {\n                    global_failure_args[0] = (int64_t) r_209887;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209892;\n        \n        x_209892 = ((__global int64_t *) ext_mem_229305)[gtid_209797 *\n                                                         n_203572 + r_209887];\n        \n        int64_t abs_arg_209893 = sub64(x_209892, min_res_209820);\n        int64_t abs_res_209894 = abs64(abs_arg_209893);\n        bool x_209895 = sle64((int64_t) 0, max_res_209885);\n        bool y_209896 = slt64(max_res_209885, n_203572);\n        bool bounds_check_209897 = x_209895 && y_209896;\n        bool index_certs_209898;\n        \n        if (!bounds_check_209897) {\n            {\n                if (atomic_cmpxchg_i32_global(glo",
            "bal_failure, -1, 31) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209885;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209899;\n        \n        x_209899 = ((__global int64_t *) ext_mem_229305)[gtid_209797 *\n                                                         n_203572 +\n                                                         max_res_209885];\n        \n        int64_t abs_arg_209900 = sub64(x_209899, min_res_209820);\n        int64_t abs_res_209901 = abs64(abs_arg_209900);\n        int64_t max_res_209902 = smax64(abs_res_209894, abs_res_209901);\n        double defunc_0_f_res_209903 = sitofp_i64_f64(max_res_209902);\n        double defunc_1_f_res_209904 = max_res_209813 + defunc_0_f_res_209903;\n        \n        ((__local double *) color_232095)[gtid_209816] = defunc_1_f_res_209904;\n        ((__local int64_t *) color_232094)[gtid_209816] = max_res_209885;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233035 = 0; i_233035 < sdiv_up64(t_n_m_203740 -\n                                                    sext_i32_i64(local_tid_233016),\n                                                    computed_group_sizze_209689);\n         i_233035++) {\n        int64_t tmp_233036;\n        \n        tmp_233036 = ((__local int64_t *) color_232094)[i_233035 *\n                                                        computed_group_sizze_209689 +\n                                                        sext_i32_i64(local_tid_233016)];\n        ((__global int64_t *) mem_229536)[gtid_209797 * t_n_m_203740 +\n                                          (i_233035 *\n                                           computed_group_sizze_209689 +\n                                           sext_i32_i64(local_tid_",
            "233016))] =\n            tmp_233036;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233037 = 0; i_233037 < sdiv_up64(t_n_m_203740 -\n                                                    sext_i32_i64(local_tid_233016),\n                                                    computed_group_sizze_209689);\n         i_233037++) {\n        double tmp_233038;\n        \n        tmp_233038 = ((__local double *) color_232095)[i_233037 *\n                                                       computed_group_sizze_209689 +\n                                                       sext_i32_i64(local_tid_233016)];\n        ((__global double *) mem_229540)[gtid_209797 * t_n_m_203740 +\n                                         (i_233037 *\n                                          computed_group_sizze_209689 +\n                                          sext_i32_i64(local_tid_233016))] =\n            tmp_233038;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_211858(__global int *global_failure,\n                                             uint red_arr_mem_233212_backing_offset_0,\n                                             uint red_arr_mem_233194_backing_offset_1,\n                                             uint color_232102_backing_offset_2,\n                                             uint color_232101_backing_offset_3,\n                                             uint color_232100_backing_offset_4,\n                                             uint color_232099_backing_offset_5,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                              ",
            "               int64_t s_n_m_203726,\n                                             int64_t computed_group_sizze_211760,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_229783)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233212_backing_5 =\n                           &shared_mem[red_arr_mem_233212_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233194_backing_4 =\n                           &shared_mem[red_arr_mem_233194_backing_offset_1];\n    volatile unsigned char *color_232102_backing_3 =\n                           &shared_mem[color_232102_backing_offset_2];\n    volatile unsigned char *color_232101_backing_2 =\n                           &shared_mem[color_232101_backing_offset_3];\n    volatile unsigned char *color_232100_backing_1 =\n                           &shared_mem[color_232100_backing_offset_4];\n    volatile unsigned char *color_232099_backing_0 =\n                           &shared_mem[color_232099_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233176;\n    int32_t local_tid_233177;\n    int64_t group_sizze_233180;\n    int32_t wave_sizze_233179;\n    int32_t group_tid_233178;\n    \n    global_tid_233176 = get_global_id(0);\n ",
            "   local_tid_233177 = get_local_id(0);\n    group_sizze_233180 = get_local_size(0);\n    wave_sizze_233179 = LOCKSTEP_WIDTH;\n    group_tid_233178 = get_group_id(0);\n    \n    int32_t phys_tid_211858 = group_tid_233178;\n    int64_t slice_233182 = s_n_m_203726;\n    int64_t ltid_pre_233181 = sext_i32_i64(local_tid_233177);\n    int64_t remnant_233183 = sext_i32_i64(local_tid_233177) - ltid_pre_233181;\n    int64_t slice_233186 = q_s_203575;\n    int64_t slice_233187 = s_n_m_203726 * slice_233186;\n    int64_t ltid_pre_233184 = squot64(sext_i32_i64(local_tid_233177),\n                                      slice_233186);\n    int64_t remnant_233188 = sext_i32_i64(local_tid_233177) - ltid_pre_233184 *\n            slice_233186;\n    int64_t ltid_pre_233185 = remnant_233188;\n    int64_t remnant_233189 = remnant_233188 - ltid_pre_233185;\n    int64_t slice_233190 = n_p_203574;\n    int64_t slice_233191 = partition_sizze_203667 * slice_233190;\n    int64_t gtid_211856 = squot64(sext_i32_i64(group_tid_233178), slice_233190);\n    int64_t remnant_233192 = sext_i32_i64(group_tid_233178) - gtid_211856 *\n            slice_233190;\n    int64_t gtid_211857 = remnant_233192;\n    int64_t remnant_233193 = remnant_233192 - gtid_211857;\n    __local unsigned char *color_232099;\n    \n    color_232099 = (__local unsigned char *) color_232099_backing_0;\n    \n    __local unsigned char *color_232100;\n    \n    color_232100 = (__local unsigned char *) color_232100_backing_1;\n    \n    __local unsigned char *color_232101;\n    \n    color_232101 = (__local unsigned char *) color_232101_backing_2;\n    \n    __local unsigned char *color_232102;\n    \n    color_232102 = (__local unsigned char *) color_232102_backing_3;\n    \n    int64_t x_211865;\n    \n    x_211865 = ((__global int64_t *) ext_mem_229372)[gtid_211856 * n_p_203574 +\n                                                     gtid_211857];\n    \n    int64_t gtid_211872 = sext_i32_i64(sext_i64_i32(ltid_pre_233181));\n    int32_t phys_tid_211873 = local_tid_233177;\n  ",
            "  \n    if (slt64(gtid_211872, s_n_m_203726)) {\n        bool cond_211875 = gtid_211872 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211876;\n        \n        if (cond_211875) {\n            defunc_0_m_fun_res_211876 = (int64_t) 0;\n        } else {\n            int64_t y_211877 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_211878 = gtid_211872 == y_211877;\n            int64_t defunc_0_m_fun_res_f_res_211879;\n            \n            if (cond_211878) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211880 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211879 =\n                    defunc_0_m_fun_res_f_res_t_res_211880;\n            } else {\n                int64_t x_211881 = sub64(gtid_211872, (int64_t) 1);\n                int64_t x_211882 = mul64(jump_s_203581, x_211881);\n                int64_t min_arg_211883 = add64((int64_t) 1, x_211882);\n                int64_t min_res_211884 = smin64(defunc_0_f_res_203721,\n                                                min_arg_211883);\n                \n                defunc_0_m_fun_res_f_res_211879 = min_res_211884;\n            }\n            defunc_0_m_fun_res_211876 = defunc_0_m_fun_res_f_res_211879;\n        }\n        ((__local int64_t *) color_232100)[gtid_211872] =\n            defunc_0_m_fun_res_211876;\n        ((__local bool *) color_232102)[gtid_211872] = cond_211875;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211886 = sext_i32_i64(sext_i64_i32(ltid_pre_233184));\n    int64_t gtid_211887 = sext_i32_i64(sext_i64_i32(ltid_pre_233185));\n    int32_t phys_tid_211888 = local_tid_233177;\n    __local unsigned char *red_arr_mem_233194;\n    \n    red_arr_mem_233194 = (__local unsigned char *) red_arr_mem_233194_backing_4;\n    if (slt64(gtid_211886, s_n_m_203726) && slt64(gtid_211887, q_s_203575)) {\n        int64_t x_211892;\n        \n        x_211892 = ((__global int64_t *) ext_mem_229471)[gtid_211856 *\n                 ",
            "                                        (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_211857 *\n                                                         s_n_m_203726 +\n                                                         gtid_211886];\n        \n        double x_211893;\n        \n        x_211893 = ((__global double *) ext_mem_229470)[gtid_211856 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_211857 *\n                                                        s_n_m_203726 +\n                                                        gtid_211886];\n        \n        int64_t defunc_0_m_fun_res_211894;\n        \n        defunc_0_m_fun_res_211894 = ((__local\n                                      int64_t *) color_232100)[gtid_211886];\n        \n        bool cond_211896 = sle64(x_211865, gtid_211887);\n        int64_t defunc_0_f_res_211897;\n        \n        if (cond_211896) {\n            defunc_0_f_res_211897 = (int64_t) 0;\n        } else {\n            int64_t i_211898 = add64(gtid_211887, x_211892);\n            int64_t defunc_0_add_arg_211899;\n            \n            defunc_0_add_arg_211899 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_211856 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_211857 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_211898];\n            \n            int64_t defunc_1_add_res_211900 = add64((int64_t) 1,\n                                                 ",
            "   defunc_0_add_arg_211899);\n            \n            defunc_0_f_res_211897 = defunc_1_add_res_211900;\n        }\n        \n        double defunc_0_f_res_211901;\n        \n        if (cond_211896) {\n            defunc_0_f_res_211901 = 0.0;\n        } else {\n            int64_t i_211902 = add64(gtid_211887, x_211892);\n            double defunc_0_add_arg_211903;\n            \n            defunc_0_add_arg_211903 = ((__global\n                                        double *) mem_229639)[gtid_211856 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_211857 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_211902];\n            defunc_0_f_res_211901 = defunc_0_add_arg_211903;\n        }\n        \n        int64_t binop_p_211904 = sub64(defunc_0_f_res_211897,\n                                       defunc_0_m_fun_res_211894);\n        double defunc_0_f_res_211905 = sitofp_i64_f64(binop_p_211904);\n        double abs_res_211906 = fabs(defunc_0_f_res_211905);\n        double tmp1_211907 = abs_res_211906 / x_211893;\n        double x_211908 = tmp1_211907 * tmp1_211907;\n        double y_211909 = tmp1_211907 * x_211908;\n        double tmp2_211910 = 1.0 - y_211909;\n        double x_211911 = tmp2_211910 * tmp2_211910;\n        double tmp3_211912 = tmp2_211910 * x_211911;\n        double w_j_211913 = defunc_0_f_res_211901 * tmp3_211912;\n        \n        ((__local double *) red_arr_mem_233194)[gtid_211886 * q_s_203575 +\n                                                gtid_211887] = w_j_211913;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233196 = s_n_m_203726 * q_s_203575;\n    double x_211889;\n    double x_211890;\n    double x_233198;\n    double x_233199;\n    bool ltid_in_bounds_233201 = slt64(sex",
            "t_i32_i64(local_tid_233177),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233202;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233201) {\n            x_211890 = ((volatile __local\n                         double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177)];\n            if ((local_tid_233177 - squot32(local_tid_233177, 32) * 32) == 0) {\n                x_211889 = x_211890;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233202 = 1;\n        while (slt32(skip_threads_233202, 32)) {\n            bool thread_active_233203 = sle32(skip_threads_233202,\n                                              local_tid_233177 -\n                                              squot32(local_tid_233177, 32) *\n                                              32) && ltid_in_bounds_233201;\n            \n            if (thread_active_233203) {\n                // read operands\n                {\n                    x_211889 = ((volatile __local\n                                 double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177) -\n                                                               sext_i32_i64(skip_threads_233202)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233204 =\n                     slt64(srem64(sext_i32_i64(local_tid_233177), q_s_203575),\n                           sext_i32_i64(local_tid_233177) -\n                           sext_i32_i64(local_tid_233177 -\n                           skip_threads_233202));\n                \n                if (thread_active_233203 && inactive_233204) {\n                    x_211889 = x_211890;\n                }\n                if (thread_active_233203) {\n                    if (!inactive_233204) {\n                        double defunc_1_op_res_211891 = x_211889 + x_211890;\n                        \n                        x_211889 = defun",
            "c_1_op_res_211891;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233179, skip_threads_233202)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233203) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177)] =\n                        x_211889;\n                    x_211890 = x_211889;\n                }\n            }\n            if (sle32(wave_sizze_233179, skip_threads_233202)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233202 *= 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_233177 - squot32(local_tid_233177, 32) * 32) == 31 &&\n            ltid_in_bounds_233201) {\n            ((volatile __local\n              double *) red_arr_mem_233194)[sext_i32_i64(squot32(local_tid_233177,\n                                                                 32))] =\n                x_211889;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233205;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233177, 32) == 0 && ltid_in_bounds_233201) {\n                x_233199 = ((volatile __local\n                             double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177)];\n                if ((local_tid_233177 - squot32(local_tid_233177, 32) * 32) ==\n                    0) {\n                    x_233198 = x_233199;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233205 = 1;\n            while (slt32(skip_threads_233205, 32)) {\n                bool thread_active_233206 = sle32(skip_threads_233205,\n ",
            "                                                 local_tid_233177 -\n                                                  squot32(local_tid_233177,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233177, 32) == 0 &&\n                      ltid_in_bounds_233201);\n                \n                if (thread_active_233206) {\n                    // read operands\n                    {\n                        x_233198 = ((volatile __local\n                                     double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177) -\n                                                                   sext_i32_i64(skip_threads_233205)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233207 =\n                         slt64(srem64(sext_i32_i64(local_tid_233177 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233177 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233177 -\n                                             skip_threads_233205) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233206 && inactive_233207) {\n                        x_233198 = x_233199;\n                    }\n                    if (thread_active_233206) {\n                        if (!inactive_233207) {\n                            double defunc_1_op_res_233200 = x_233198 + x_233199;\n                            \n                            x_233198 = defunc_1_op_res_233200;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233179, skip_threads_233205)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233206) {\n                    // write result\n                    {\n                        ((volatile __local\n ",
            "                         double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177)] =\n                            x_233198;\n                        x_233199 = x_233198;\n                    }\n                }\n                if (sle32(wave_sizze_233179, skip_threads_233205)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233205 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233208 = squot32(local_tid_233177, 32) == 0 ||\n         !ltid_in_bounds_233201;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233208) {\n                x_211890 = x_211889;\n                x_211889 = ((__local\n                             double *) red_arr_mem_233194)[sext_i32_i64(squot32(local_tid_233177,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233209 = slt64(srem64(sext_i32_i64(local_tid_233177),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233177) -\n                                         sext_i32_i64(squot32(local_tid_233177,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233208) {\n                if (inactive_233209) {\n                    x_211889 = x_211890;\n                }\n            }\n            if (!no_carry_in_233208) {\n                if (!inactive_233209) {\n                    double defunc_1_op_res_211891 = x_211889 + x_211890;\n                    \n                    x_211889 = defunc_1_op_res_211891;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233208) {\n                ((__loca",
            "l\n                  double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177)] =\n                    x_211889;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233177, 32) == 0 && ltid_in_bounds_233201) {\n            ((__local\n              double *) red_arr_mem_233194)[sext_i32_i64(local_tid_233177)] =\n                x_211890;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233210 = 0; i_233210 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233177),\n                                                    computed_group_sizze_211760);\n         i_233210++) {\n        double tmp_233211;\n        \n        tmp_233211 = ((__local double *) red_arr_mem_233194)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233210 *\n                                                              computed_group_sizze_211760 +\n                                                              sext_i32_i64(local_tid_233177)) *\n                                                             q_s_203575];\n        ((__local double *) color_232099)[i_233210 *\n                                          computed_group_sizze_211760 +\n                                          sext_i32_i64(local_tid_233177)] =\n            tmp_233211;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211916 = sext_i32_i64(sext_i64_i32(ltid_pre_233181));\n    int32_t phys_tid_211917 = local_tid_233177;\n    \n    if (slt64(gtid_211916, s_n_m_203726)) {\n        bool index_primexp_228805 = gtid_211916 == (int64_t) 0;\n        double defunc_2_reduce_res_211920;\n        \n        defunc_2_reduce_res_211920 = ((__local\n                                       double *) color_232099)[gtid_211916",
            "];\n        \n        double a0_211921 = 1.0 / defunc_2_reduce_res_211920;\n        int64_t defunc_0_m_fun_res_211922;\n        \n        if (index_primexp_228805) {\n            defunc_0_m_fun_res_211922 = (int64_t) 0;\n        } else {\n            int64_t y_211923 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_211924 = gtid_211916 == y_211923;\n            int64_t defunc_0_m_fun_res_f_res_211925;\n            \n            if (cond_211924) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211926 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211925 =\n                    defunc_0_m_fun_res_f_res_t_res_211926;\n            } else {\n                int64_t x_211927 = sub64(gtid_211916, (int64_t) 1);\n                int64_t x_211928 = mul64(jump_s_203581, x_211927);\n                int64_t min_arg_211929 = add64((int64_t) 1, x_211928);\n                int64_t min_res_211930 = smin64(defunc_0_f_res_203721,\n                                                min_arg_211929);\n                \n                defunc_0_m_fun_res_f_res_211925 = min_res_211930;\n            }\n            defunc_0_m_fun_res_211922 = defunc_0_m_fun_res_f_res_211925;\n        }\n        ((__local double *) color_232101)[gtid_211916] = a0_211921;\n        ((__local int64_t *) color_232100)[gtid_211916] =\n            defunc_0_m_fun_res_211922;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211932 = sext_i32_i64(sext_i64_i32(ltid_pre_233184));\n    int64_t gtid_211933 = sext_i32_i64(sext_i64_i32(ltid_pre_233185));\n    int32_t phys_tid_211934 = local_tid_233177;\n    __local unsigned char *red_arr_mem_233212;\n    \n    red_arr_mem_233212 = (__local unsigned char *) red_arr_mem_233212_backing_5;\n    if (slt64(gtid_211932, s_n_m_203726) && slt64(gtid_211933, q_s_203575)) {\n        int64_t x_211938;\n        \n        x_211938 = ((__global int64_t *) ext_mem_229471)[gtid_211856 *\n                                     ",
            "                    (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_211857 *\n                                                         s_n_m_203726 +\n                                                         gtid_211932];\n        \n        double x_211939;\n        \n        x_211939 = ((__global double *) ext_mem_229470)[gtid_211856 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_211857 *\n                                                        s_n_m_203726 +\n                                                        gtid_211932];\n        \n        double a0_211940;\n        \n        a0_211940 = ((__local double *) color_232101)[gtid_211932];\n        \n        int64_t defunc_0_m_fun_res_211941;\n        \n        defunc_0_m_fun_res_211941 = ((__local\n                                      int64_t *) color_232100)[gtid_211932];\n        \n        bool cond_211943 = sle64(x_211865, gtid_211933);\n        int64_t defunc_0_f_res_211944;\n        \n        if (cond_211943) {\n            defunc_0_f_res_211944 = (int64_t) 0;\n        } else {\n            int64_t i_211945 = add64(gtid_211933, x_211938);\n            int64_t defunc_0_add_arg_211946;\n            \n            defunc_0_add_arg_211946 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_211856 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_211857 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_211945];\n            \n            int64_t de",
            "func_1_add_res_211947 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_211946);\n            \n            defunc_0_f_res_211944 = defunc_1_add_res_211947;\n        }\n        \n        double defunc_0_f_res_211948;\n        \n        if (cond_211943) {\n            defunc_0_f_res_211948 = 0.0;\n        } else {\n            int64_t i_211949 = add64(gtid_211933, x_211938);\n            double defunc_0_add_arg_211950;\n            \n            defunc_0_add_arg_211950 = ((__global\n                                        double *) mem_229639)[gtid_211856 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_211857 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_211949];\n            defunc_0_f_res_211948 = defunc_0_add_arg_211950;\n        }\n        \n        int64_t binop_p_211951 = sub64(defunc_0_f_res_211944,\n                                       defunc_0_m_fun_res_211941);\n        double defunc_0_f_res_211952 = sitofp_i64_f64(binop_p_211951);\n        double abs_res_211953 = fabs(defunc_0_f_res_211952);\n        double tmp1_211954 = abs_res_211953 / x_211939;\n        double x_211955 = tmp1_211954 * tmp1_211954;\n        double y_211956 = tmp1_211954 * x_211955;\n        double tmp2_211957 = 1.0 - y_211956;\n        double x_211958 = tmp2_211957 * tmp2_211957;\n        double tmp3_211959 = tmp2_211957 * x_211958;\n        double tmp4_211960 = defunc_0_f_res_211948 * tmp3_211959;\n        double defunc_0_f_res_211961;\n        \n        if (cond_211943) {\n            defunc_0_f_res_211961 = 0.0;\n        } else {\n            int64_t i_211962 = add64(gtid_211933, x_211938);\n            double defunc_0_add_arg_211963;\n            \n            defunc_0_add_arg_211963 = ((__glo",
            "bal\n                                        double *) mem_229634)[gtid_211856 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_211857 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_211962];\n            defunc_0_f_res_211961 = defunc_0_add_arg_211963;\n        }\n        \n        double x_211964 = a0_211940 * tmp4_211960;\n        double defunc_9_fit_fun_res_211965 = defunc_0_f_res_211961 * x_211964;\n        \n        ((__local double *) red_arr_mem_233212)[gtid_211932 * q_s_203575 +\n                                                gtid_211933] =\n            defunc_9_fit_fun_res_211965;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233214 = s_n_m_203726 * q_s_203575;\n    double x_211935;\n    double x_211936;\n    double x_233216;\n    double x_233217;\n    bool ltid_in_bounds_233219 = slt64(sext_i32_i64(local_tid_233177),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233220;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233219) {\n            x_211936 = ((volatile __local\n                         double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177)];\n            if ((local_tid_233177 - squot32(local_tid_233177, 32) * 32) == 0) {\n                x_211935 = x_211936;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233220 = 1;\n        while (slt32(skip_threads_233220, 32)) {\n            bool thread_active_233221 = sle32(skip_threads_233220,\n                                              local_tid_233177 -\n                                              squot32(local_tid_233177, 32) *\n                                              32) && l",
            "tid_in_bounds_233219;\n            \n            if (thread_active_233221) {\n                // read operands\n                {\n                    x_211935 = ((volatile __local\n                                 double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177) -\n                                                               sext_i32_i64(skip_threads_233220)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233222 =\n                     slt64(srem64(sext_i32_i64(local_tid_233177), q_s_203575),\n                           sext_i32_i64(local_tid_233177) -\n                           sext_i32_i64(local_tid_233177 -\n                           skip_threads_233220));\n                \n                if (thread_active_233221 && inactive_233222) {\n                    x_211935 = x_211936;\n                }\n                if (thread_active_233221) {\n                    if (!inactive_233222) {\n                        double defunc_1_op_res_211937 = x_211935 + x_211936;\n                        \n                        x_211935 = defunc_1_op_res_211937;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233179, skip_threads_233220)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233221) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177)] =\n                        x_211935;\n                    x_211936 = x_211935;\n                }\n            }\n            if (sle32(wave_sizze_233179, skip_threads_233220)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233220 *= 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_233177 - squot32(local_tid_233177, 32) * 32) == 31 &&\n            lt",
            "id_in_bounds_233219) {\n            ((volatile __local\n              double *) red_arr_mem_233212)[sext_i32_i64(squot32(local_tid_233177,\n                                                                 32))] =\n                x_211935;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233223;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233177, 32) == 0 && ltid_in_bounds_233219) {\n                x_233217 = ((volatile __local\n                             double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177)];\n                if ((local_tid_233177 - squot32(local_tid_233177, 32) * 32) ==\n                    0) {\n                    x_233216 = x_233217;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233223 = 1;\n            while (slt32(skip_threads_233223, 32)) {\n                bool thread_active_233224 = sle32(skip_threads_233223,\n                                                  local_tid_233177 -\n                                                  squot32(local_tid_233177,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233177, 32) == 0 &&\n                      ltid_in_bounds_233219);\n                \n                if (thread_active_233224) {\n                    // read operands\n                    {\n                        x_233216 = ((volatile __local\n                                     double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177) -\n                                                                   sext_i32_i64(skip_threads_233223)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233225 =\n                         slt64(srem64(sext_i32_i64(local_t",
            "id_233177 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233177 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233177 -\n                                             skip_threads_233223) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233224 && inactive_233225) {\n                        x_233216 = x_233217;\n                    }\n                    if (thread_active_233224) {\n                        if (!inactive_233225) {\n                            double defunc_1_op_res_233218 = x_233216 + x_233217;\n                            \n                            x_233216 = defunc_1_op_res_233218;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233179, skip_threads_233223)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233224) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177)] =\n                            x_233216;\n                        x_233217 = x_233216;\n                    }\n                }\n                if (sle32(wave_sizze_233179, skip_threads_233223)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233223 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233226 = squot32(local_tid_233177, 32) == 0 ||\n         !ltid_in_bounds_233219;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233226) {\n                x_211936 = x_211935;\n                x_211935 = ((__local\n                             double *) red_arr_mem_233212)[sext_i32_i64(squot32(local_tid_233177,\n                           ",
            "                                                     32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233227 = slt64(srem64(sext_i32_i64(local_tid_233177),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233177) -\n                                         sext_i32_i64(squot32(local_tid_233177,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233226) {\n                if (inactive_233227) {\n                    x_211935 = x_211936;\n                }\n            }\n            if (!no_carry_in_233226) {\n                if (!inactive_233227) {\n                    double defunc_1_op_res_211937 = x_211935 + x_211936;\n                    \n                    x_211935 = defunc_1_op_res_211937;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233226) {\n                ((__local\n                  double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177)] =\n                    x_211935;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233177, 32) == 0 && ltid_in_bounds_233219) {\n            ((__local\n              double *) red_arr_mem_233212)[sext_i32_i64(local_tid_233177)] =\n                x_211936;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233228 = 0; i_233228 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233177),\n                                                    computed_group_sizze_211760);\n         i_233228++) {\n        double tmp_233229;\n        \n        tmp_233229 = ((__local double *) red_arr_mem_233212)[q_s_203575 -\n             ",
            "                                                (int64_t) 1 +\n                                                             (i_233228 *\n                                                              computed_group_sizze_211760 +\n                                                              sext_i32_i64(local_tid_233177)) *\n                                                             q_s_203575];\n        ((__local double *) color_232099)[i_233228 *\n                                          computed_group_sizze_211760 +\n                                          sext_i32_i64(local_tid_233177)] =\n            tmp_233229;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233230 = 0; i_233230 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233177),\n                                                    computed_group_sizze_211760);\n         i_233230++) {\n        double tmp_233231;\n        \n        tmp_233231 = ((__local double *) color_232099)[i_233230 *\n                                                       computed_group_sizze_211760 +\n                                                       sext_i32_i64(local_tid_233177)];\n        ((__global double *) mem_229783)[gtid_211856 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_211857 * s_n_m_203726 +\n                                         (i_233230 *\n                                          computed_group_sizze_211760 +\n                                          sext_i32_i64(local_tid_233177))] =\n            tmp_233231;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_213926(__global int *global_failure,\n                                             uint red_arr_mem_233534_backing_offset_0,\n                                             uint red_arr_mem_233532_backing_offset_1,\n                 ",
            "                            uint red_arr_mem_233502_backing_offset_2,\n                                             uint red_arr_mem_233500_backing_offset_3,\n                                             uint red_arr_mem_233498_backing_offset_4,\n                                             uint color_232114_backing_offset_5,\n                                             uint color_232113_backing_offset_6,\n                                             uint color_232112_backing_offset_7,\n                                             uint color_232111_backing_offset_8,\n                                             uint color_232110_backing_offset_9,\n                                             uint color_232109_backing_offset_10,\n                                             uint color_232108_backing_offset_11,\n                                             uint color_232107_backing_offset_12,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t computed_group_sizze_213795,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n            ",
            "                                 __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230059,\n                                             __global unsigned char *mem_230064)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233534_backing_12 =\n                           &shared_mem[red_arr_mem_233534_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233532_backing_11 =\n                           &shared_mem[red_arr_mem_233532_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233502_backing_10 =\n                           &shared_mem[red_arr_mem_233502_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233500_backing_9 =\n                           &shared_mem[red_arr_mem_233500_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233498_backing_8 =\n                           &shared_mem[red_arr_mem_233498_backing_offset_4];\n    volatile unsigned char *color_232114_backing_7 =\n                           &shared_mem[color_232114_backing_offset_5];\n    volatile unsigned char *color_232113_backing_6 =\n                           &shared_mem[color_232113_backing_offset_6];\n    volatile unsigned char *color_232112_backing_5 =\n                           &shared_mem[color_232112_backing_offset_7];\n    volatile unsigned char *color_232111_backing_4 =\n                           &shared_mem[color_232111_backing_offset_8];\n    volatile unsigned char *color_232110_backing_3 =\n                           &shared_mem[color_232110_backing_offset_9];\n    volatile unsigned char *color_232109_backing_2 =\n                           &shared_mem[color_232109_backing_offset_10];\n    volatile unsigned char *color_232108_backing_1 =\n                           &shared_mem[color_232108_backing_offset_11];\n    volatile unsigned char *color_232107_ba",
            "cking_0 =\n                           &shared_mem[color_232107_backing_offset_12];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233480;\n    int32_t local_tid_233481;\n    int64_t group_sizze_233484;\n    int32_t wave_sizze_233483;\n    int32_t group_tid_233482;\n    \n    global_tid_233480 = get_global_id(0);\n    local_tid_233481 = get_local_id(0);\n    group_sizze_233484 = get_local_size(0);\n    wave_sizze_233483 = LOCKSTEP_WIDTH;\n    group_tid_233482 = get_group_id(0);\n    \n    int32_t phys_tid_213926 = group_tid_233482;\n    int64_t slice_233486 = s_n_m_203726;\n    int64_t ltid_pre_233485 = sext_i32_i64(local_tid_233481);\n    int64_t remnant_233487 = sext_i32_i64(local_tid_233481) - ltid_pre_233485;\n    int64_t slice_233490 = q_s_203575;\n    int64_t slice_233491 = s_n_m_203726 * slice_233490;\n    int64_t ltid_pre_233488 = squot64(sext_i32_i64(local_tid_233481),\n                                      slice_233490);\n    int64_t remnant_233492 = sext_i32_i64(local_tid_233481) - ltid_pre_233488 *\n            slice_233490;\n    int64_t ltid_pre_233489 = remnant_233492;\n    int64_t remnant_233493 = remnant_233492 - ltid_pre_233489;\n    int64_t slice_233494 = n_p_203574;\n    int64_t slice_233495 = partition_sizze_203667 * slice_233494;\n    int64_t gtid_213924 = squot64(sext_i32_i64(group_tid_233482), slice_233494);\n    int64_t remnant_233496 = sext_i32_i64(group_tid_233482) - gtid_213924 *\n            slice_233494;\n    int64_t gtid_213925 = remnant_233496;\n    int64_t remnant_233497 = remnant_233496 - gtid_213925;\n    __local unsigned char *color_232107;\n    \n    color_232107 = (__local unsigned char *) color_232107_backing_0;\n    \n    __local unsigned char *color_232108;\n    \n    color_232108 = (__local unsigned char *) color_232108_backing_1;\n    \n    __local unsigned char *color_232109;\n    \n    color_232109 = (__local unsigned char *) color_232109_backing_2;\n    \n    __local unsigned char *color_232110;\n    \n    color_232110 = (__local unsign",
            "ed char *) color_232110_backing_3;\n    \n    __local unsigned char *color_232111;\n    \n    color_232111 = (__local unsigned char *) color_232111_backing_4;\n    \n    __local unsigned char *color_232112;\n    \n    color_232112 = (__local unsigned char *) color_232112_backing_5;\n    \n    __local unsigned char *color_232113;\n    \n    color_232113 = (__local unsigned char *) color_232113_backing_6;\n    \n    __local unsigned char *color_232114;\n    \n    color_232114 = (__local unsigned char *) color_232114_backing_7;\n    \n    int64_t x_213933;\n    \n    x_213933 = ((__global int64_t *) ext_mem_229372)[gtid_213924 * n_p_203574 +\n                                                     gtid_213925];\n    \n    int64_t gtid_213940 = sext_i32_i64(sext_i64_i32(ltid_pre_233485));\n    int32_t phys_tid_213941 = local_tid_233481;\n    \n    if (slt64(gtid_213940, s_n_m_203726)) {\n        bool cond_213943 = gtid_213940 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_213944;\n        \n        if (cond_213943) {\n            defunc_0_m_fun_res_213944 = (int64_t) 0;\n        } else {\n            int64_t y_213945 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_213946 = gtid_213940 == y_213945;\n            int64_t defunc_0_m_fun_res_f_res_213947;\n            \n            if (cond_213946) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_213948 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_213947 =\n                    defunc_0_m_fun_res_f_res_t_res_213948;\n            } else {\n                int64_t x_213949 = sub64(gtid_213940, (int64_t) 1);\n                int64_t x_213950 = mul64(jump_s_203581, x_213949);\n                int64_t min_arg_213951 = add64((int64_t) 1, x_213950);\n                int64_t min_res_213952 = smin64(defunc_0_f_res_203721,\n                                                min_arg_213951);\n                \n                defunc_0_m_fun_res_f_res_213947 = min_res_213952;\n           ",
            " }\n            defunc_0_m_fun_res_213944 = defunc_0_m_fun_res_f_res_213947;\n        }\n        ((__local int64_t *) color_232109)[gtid_213940] =\n            defunc_0_m_fun_res_213944;\n        ((__local bool *) color_232114)[gtid_213940] = cond_213943;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213956 = sext_i32_i64(sext_i64_i32(ltid_pre_233488));\n    int64_t gtid_213957 = sext_i32_i64(sext_i64_i32(ltid_pre_233489));\n    int32_t phys_tid_213958 = local_tid_233481;\n    __local unsigned char *red_arr_mem_233498;\n    \n    red_arr_mem_233498 = (__local unsigned char *) red_arr_mem_233498_backing_8;\n    \n    __local unsigned char *red_arr_mem_233500;\n    \n    red_arr_mem_233500 = (__local unsigned char *) red_arr_mem_233500_backing_9;\n    \n    __local unsigned char *red_arr_mem_233502;\n    \n    red_arr_mem_233502 = (__local\n                          unsigned char *) red_arr_mem_233502_backing_10;\n    if (slt64(gtid_213956, s_n_m_203726) && slt64(gtid_213957, q_s_203575)) {\n        int64_t x_213968;\n        \n        x_213968 = ((__global int64_t *) ext_mem_229471)[gtid_213924 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_213925 *\n                                                         s_n_m_203726 +\n                                                         gtid_213956];\n        \n        double x_213969;\n        \n        x_213969 = ((__global double *) ext_mem_229470)[gtid_213924 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_213925 *\n                                                        s_n_m_203726 +\n                                                        gtid_213956];\n        \n        int64_t defunc_0_m_fun_res_213970;\n        \n       ",
            " defunc_0_m_fun_res_213970 = ((__local\n                                      int64_t *) color_232109)[gtid_213956];\n        \n        bool cond_213972 = sle64(x_213933, gtid_213957);\n        int64_t defunc_0_f_res_213973;\n        \n        if (cond_213972) {\n            defunc_0_f_res_213973 = (int64_t) 0;\n        } else {\n            int64_t i_213974 = add64(gtid_213957, x_213968);\n            int64_t defunc_0_add_arg_213975;\n            \n            defunc_0_add_arg_213975 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_213924 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_213925 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_213974];\n            \n            int64_t defunc_1_add_res_213976 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_213975);\n            \n            defunc_0_f_res_213973 = defunc_1_add_res_213976;\n        }\n        \n        double defunc_0_f_res_213977;\n        \n        if (cond_213972) {\n            defunc_0_f_res_213977 = 0.0;\n        } else {\n            int64_t i_213978 = add64(gtid_213957, x_213968);\n            double defunc_0_add_arg_213979;\n            \n            defunc_0_add_arg_213979 = ((__global\n                                        double *) mem_229639)[gtid_213924 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_213925 *\n                                                              defunc_0_f_res_203721 +\n                                                      ",
            "        i_213978];\n            defunc_0_f_res_213977 = defunc_0_add_arg_213979;\n        }\n        \n        int64_t binop_p_213980 = sub64(defunc_0_f_res_213973,\n                                       defunc_0_m_fun_res_213970);\n        double defunc_0_f_res_213981 = sitofp_i64_f64(binop_p_213980);\n        double abs_res_213982 = fabs(defunc_0_f_res_213981);\n        double tmp1_213983 = abs_res_213982 / x_213969;\n        double x_213984 = tmp1_213983 * tmp1_213983;\n        double y_213985 = tmp1_213983 * x_213984;\n        double tmp2_213986 = 1.0 - y_213985;\n        double x_213987 = tmp2_213986 * tmp2_213986;\n        double tmp3_213988 = tmp2_213986 * x_213987;\n        double w_j_213989 = defunc_0_f_res_213977 * tmp3_213988;\n        double xw_j_213990 = defunc_0_f_res_213981 * w_j_213989;\n        double x2w_j_213991 = defunc_0_f_res_213981 * xw_j_213990;\n        \n        ((__local double *) red_arr_mem_233498)[gtid_213956 * q_s_203575 +\n                                                gtid_213957] = w_j_213989;\n        ((__local double *) red_arr_mem_233500)[gtid_213956 * q_s_203575 +\n                                                gtid_213957] = xw_j_213990;\n        ((__local double *) red_arr_mem_233502)[gtid_213956 * q_s_203575 +\n                                                gtid_213957] = x2w_j_213991;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233504 = s_n_m_203726 * q_s_203575;\n    double x_213959;\n    double x_213960;\n    double x_213961;\n    double x_213962;\n    double x_213963;\n    double x_213964;\n    double x_233508;\n    double x_233509;\n    double x_233510;\n    double x_233511;\n    double x_233512;\n    double x_233513;\n    bool ltid_in_bounds_233517 = slt64(sext_i32_i64(local_tid_233481),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233518;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233517) {\n            x_213962 = ((volatile __local\n                   ",
            "      double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481)];\n            x_213963 = ((volatile __local\n                         double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481)];\n            x_213964 = ((volatile __local\n                         double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481)];\n            if ((local_tid_233481 - squot32(local_tid_233481, 32) * 32) == 0) {\n                x_213959 = x_213962;\n                x_213960 = x_213963;\n                x_213961 = x_213964;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233518 = 1;\n        while (slt32(skip_threads_233518, 32)) {\n            bool thread_active_233519 = sle32(skip_threads_233518,\n                                              local_tid_233481 -\n                                              squot32(local_tid_233481, 32) *\n                                              32) && ltid_in_bounds_233517;\n            \n            if (thread_active_233519) {\n                // read operands\n                {\n                    x_213959 = ((volatile __local\n                                 double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481) -\n                                                               sext_i32_i64(skip_threads_233518)];\n                    x_213960 = ((volatile __local\n                                 double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481) -\n                                                               sext_i32_i64(skip_threads_233518)];\n                    x_213961 = ((volatile __local\n                                 double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481) -\n                                                               sext_i32_i64(skip_threads_233518)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233520 =\n                     slt64(srem64(sext_i32_i64(local_tid_233481), q",
            "_s_203575),\n                           sext_i32_i64(local_tid_233481) -\n                           sext_i32_i64(local_tid_233481 -\n                           skip_threads_233518));\n                \n                if (thread_active_233519 && inactive_233520) {\n                    x_213959 = x_213962;\n                    x_213960 = x_213963;\n                    x_213961 = x_213964;\n                }\n                if (thread_active_233519) {\n                    if (!inactive_233520) {\n                        double defunc_1_op_res_213965 = x_213959 + x_213962;\n                        double defunc_1_op_res_213966 = x_213960 + x_213963;\n                        double defunc_1_op_res_213967 = x_213961 + x_213964;\n                        \n                        x_213959 = defunc_1_op_res_213965;\n                        x_213960 = defunc_1_op_res_213966;\n                        x_213961 = defunc_1_op_res_213967;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233483, skip_threads_233518)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233519) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481)] =\n                        x_213959;\n                    x_213962 = x_213959;\n                    ((volatile __local\n                      double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481)] =\n                        x_213960;\n                    x_213963 = x_213960;\n                    ((volatile __local\n                      double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481)] =\n                        x_213961;\n                    x_213964 = x_213961;\n                }\n            }\n            if (sle32(wave_sizze_233483, skip_threads_233518)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233518 *= 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_233481 - squot32(local_tid_233481, 32) * 32) == 31 &&\n            ltid_in_bounds_233517) {\n            ((volatile __local\n              double *) red_arr_mem_233498)[sext_i32_i64(squot32(local_tid_233481,\n                                                                 32))] =\n                x_213959;\n            ((volatile __local\n              double *) red_arr_mem_233500)[sext_i32_i64(squot32(local_tid_233481,\n                                                                 32))] =\n                x_213960;\n            ((volatile __local\n              double *) red_arr_mem_233502)[sext_i32_i64(squot32(local_tid_233481,\n                                                                 32))] =\n                x_213961;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233521;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233481, 32) == 0 && ltid_in_bounds_233517) {\n                x_233511 = ((volatile __local\n                             double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481)];\n                x_233512 = ((volatile __local\n                             double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481)];\n                x_233513 = ((volatile __local\n                             double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481)];\n                if ((local_tid_233481 - squot32(local_tid_233481, 32) * 32) ==\n                    0) {\n                    x_233508 = x_233511;\n                    x_233509 = x_233512;\n                    x_233510 = x_233513;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233521 = 1;\n            while (slt32(skip_threads",
            "_233521, 32)) {\n                bool thread_active_233522 = sle32(skip_threads_233521,\n                                                  local_tid_233481 -\n                                                  squot32(local_tid_233481,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233481, 32) == 0 &&\n                      ltid_in_bounds_233517);\n                \n                if (thread_active_233522) {\n                    // read operands\n                    {\n                        x_233508 = ((volatile __local\n                                     double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481) -\n                                                                   sext_i32_i64(skip_threads_233521)];\n                        x_233509 = ((volatile __local\n                                     double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481) -\n                                                                   sext_i32_i64(skip_threads_233521)];\n                        x_233510 = ((volatile __local\n                                     double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481) -\n                                                                   sext_i32_i64(skip_threads_233521)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233523 =\n                         slt64(srem64(sext_i32_i64(local_tid_233481 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233481 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233481 -\n                                             skip_threads_233521) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233522 && inactive_233523) {\n                        x_233508 = x_233511;\n                        x_233509 = x_2",
            "33512;\n                        x_233510 = x_233513;\n                    }\n                    if (thread_active_233522) {\n                        if (!inactive_233523) {\n                            double defunc_1_op_res_233514 = x_233508 + x_233511;\n                            double defunc_1_op_res_233515 = x_233509 + x_233512;\n                            double defunc_1_op_res_233516 = x_233510 + x_233513;\n                            \n                            x_233508 = defunc_1_op_res_233514;\n                            x_233509 = defunc_1_op_res_233515;\n                            x_233510 = defunc_1_op_res_233516;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233483, skip_threads_233521)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233522) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481)] =\n                            x_233508;\n                        x_233511 = x_233508;\n                        ((volatile __local\n                          double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481)] =\n                            x_233509;\n                        x_233512 = x_233509;\n                        ((volatile __local\n                          double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481)] =\n                            x_233510;\n                        x_233513 = x_233510;\n                    }\n                }\n                if (sle32(wave_sizze_233483, skip_threads_233521)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233521 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233524 = squot32(local_tid_233481, 32) == 0 ||\n         !ltid_in_bounds_233517;\n    \n    // carry-in for ev",
            "ery block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233524) {\n                x_213962 = x_213959;\n                x_213963 = x_213960;\n                x_213964 = x_213961;\n                x_213959 = ((__local\n                             double *) red_arr_mem_233498)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213960 = ((__local\n                             double *) red_arr_mem_233500)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213961 = ((__local\n                             double *) red_arr_mem_233502)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233525 = slt64(srem64(sext_i32_i64(local_tid_233481),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233481) -\n                                         sext_i32_i64(squot32(local_tid_233481,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233524) {\n                if (inactive_233525) {\n                    x_213959 = x_213962;\n                    x_213960 = x_213963;\n                    x_213961 = x_213964;\n                }\n            }\n            if (!no_carry_in_233524) {\n                if (!inactive_233525) {\n                    double defunc_1_op_res_213965 = x_213959 + x_213962;\n                    double defunc_1_op_res_213966 = x_213960 + ",
            "x_213963;\n                    double defunc_1_op_res_213967 = x_213961 + x_213964;\n                    \n                    x_213959 = defunc_1_op_res_213965;\n                    x_213960 = defunc_1_op_res_213966;\n                    x_213961 = defunc_1_op_res_213967;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233524) {\n                ((__local\n                  double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481)] =\n                    x_213959;\n                ((__local\n                  double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481)] =\n                    x_213960;\n                ((__local\n                  double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481)] =\n                    x_213961;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233481, 32) == 0 && ltid_in_bounds_233517) {\n            ((__local\n              double *) red_arr_mem_233498)[sext_i32_i64(local_tid_233481)] =\n                x_213962;\n            ((__local\n              double *) red_arr_mem_233500)[sext_i32_i64(local_tid_233481)] =\n                x_213963;\n            ((__local\n              double *) red_arr_mem_233502)[sext_i32_i64(local_tid_233481)] =\n                x_213964;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233526 = 0; i_233526 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233526++) {\n        double tmp_233527;\n        \n        tmp_233527 = ((__local double *) red_arr_mem_233498)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233526 *\n                             ",
            "                                 computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233481)) *\n                                                             q_s_203575];\n        ((__local double *) color_232113)[i_233526 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481)] =\n            tmp_233527;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233528 = 0; i_233528 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233528++) {\n        double tmp_233529;\n        \n        tmp_233529 = ((__local double *) red_arr_mem_233500)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233528 *\n                                                              computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233481)) *\n                                                             q_s_203575];\n        ((__local double *) color_232108)[i_233528 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481)] =\n            tmp_233529;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233530 = 0; i_233530 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233530++) {\n        double tmp_233531;\n        \n        tmp_233531 = ((__local double *) red_arr_mem_233502)[q_s_203575 -\n                                                             (int64_t) 1 +\n                    ",
            "                                         (i_233530 *\n                                                              computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233481)) *\n                                                             q_s_203575];\n        ((__local double *) color_232107)[i_233530 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481)] =\n            tmp_233531;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213996 = sext_i32_i64(sext_i64_i32(ltid_pre_233485));\n    int32_t phys_tid_213997 = local_tid_233481;\n    \n    if (slt64(gtid_213996, s_n_m_203726)) {\n        bool index_primexp_228811 = gtid_213996 == (int64_t) 0;\n        double defunc_2_reduce_res_214000;\n        \n        defunc_2_reduce_res_214000 = ((__local\n                                       double *) color_232113)[gtid_213996];\n        \n        double defunc_2_reduce_res_214001;\n        \n        defunc_2_reduce_res_214001 = ((__local\n                                       double *) color_232108)[gtid_213996];\n        \n        double defunc_2_reduce_res_214002;\n        \n        defunc_2_reduce_res_214002 = ((__local\n                                       double *) color_232107)[gtid_213996];\n        \n        double x_214003 = defunc_2_reduce_res_214000 *\n               defunc_2_reduce_res_214002;\n        double y_214004 = defunc_2_reduce_res_214001 *\n               defunc_2_reduce_res_214001;\n        double y_214005 = x_214003 - y_214004;\n        double det1_214006 = 1.0 / y_214005;\n        double a11_214007 = defunc_2_reduce_res_214002 * det1_214006;\n        double x_214008 = 0.0 - defunc_2_reduce_res_214001;\n        double b11_214009 = det1_214006 * x_214008;\n        double c11_214010 = defunc_2_reduce_res_214000 * det1_214006;\n        int64_t defunc_0_m_fun_res_214011;\n        \n  ",
            "      if (index_primexp_228811) {\n            defunc_0_m_fun_res_214011 = (int64_t) 0;\n        } else {\n            int64_t y_214012 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_214013 = gtid_213996 == y_214012;\n            int64_t defunc_0_m_fun_res_f_res_214014;\n            \n            if (cond_214013) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214015 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214014 =\n                    defunc_0_m_fun_res_f_res_t_res_214015;\n            } else {\n                int64_t x_214016 = sub64(gtid_213996, (int64_t) 1);\n                int64_t x_214017 = mul64(jump_s_203581, x_214016);\n                int64_t min_arg_214018 = add64((int64_t) 1, x_214017);\n                int64_t min_res_214019 = smin64(defunc_0_f_res_203721,\n                                                min_arg_214018);\n                \n                defunc_0_m_fun_res_f_res_214014 = min_res_214019;\n            }\n            defunc_0_m_fun_res_214011 = defunc_0_m_fun_res_f_res_214014;\n        }\n        ((__local double *) color_232112)[gtid_213996] = a11_214007;\n        ((__local double *) color_232111)[gtid_213996] = b11_214009;\n        ((__local double *) color_232110)[gtid_213996] = c11_214010;\n        ((__local int64_t *) color_232109)[gtid_213996] =\n            defunc_0_m_fun_res_214011;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_214022 = sext_i32_i64(sext_i64_i32(ltid_pre_233488));\n    int64_t gtid_214023 = sext_i32_i64(sext_i64_i32(ltid_pre_233489));\n    int32_t phys_tid_214024 = local_tid_233481;\n    __local unsigned char *red_arr_mem_233532;\n    \n    red_arr_mem_233532 = (__local\n                          unsigned char *) red_arr_mem_233532_backing_11;\n    \n    __local unsigned char *red_arr_mem_233534;\n    \n    red_arr_mem_233534 = (__local\n                          unsigned char *) red_arr_mem_233534_backing_12;\n    if (slt64(gti",
            "d_214022, s_n_m_203726) && slt64(gtid_214023, q_s_203575)) {\n        int64_t x_214031;\n        \n        x_214031 = ((__global int64_t *) ext_mem_229471)[gtid_213924 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_213925 *\n                                                         s_n_m_203726 +\n                                                         gtid_214022];\n        \n        double x_214032;\n        \n        x_214032 = ((__global double *) ext_mem_229470)[gtid_213924 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_213925 *\n                                                        s_n_m_203726 +\n                                                        gtid_214022];\n        \n        double a11_214033;\n        \n        a11_214033 = ((__local double *) color_232112)[gtid_214022];\n        \n        double b11_214034;\n        \n        b11_214034 = ((__local double *) color_232111)[gtid_214022];\n        \n        double c11_214035;\n        \n        c11_214035 = ((__local double *) color_232110)[gtid_214022];\n        \n        int64_t defunc_0_m_fun_res_214036;\n        \n        defunc_0_m_fun_res_214036 = ((__local\n                                      int64_t *) color_232109)[gtid_214022];\n        \n        bool cond_214038 = sle64(x_213933, gtid_214023);\n        int64_t defunc_0_f_res_214039;\n        \n        if (cond_214038) {\n            defunc_0_f_res_214039 = (int64_t) 0;\n        } else {\n            int64_t i_214040 = add64(gtid_214023, x_214031);\n            int64_t defunc_0_add_arg_214041;\n            \n            defunc_0_add_arg_214041 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_213924 *\n                         ",
            "                                          (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_213925 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_214040];\n            \n            int64_t defunc_1_add_res_214042 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_214041);\n            \n            defunc_0_f_res_214039 = defunc_1_add_res_214042;\n        }\n        \n        double defunc_0_f_res_214043;\n        \n        if (cond_214038) {\n            defunc_0_f_res_214043 = 0.0;\n        } else {\n            int64_t i_214044 = add64(gtid_214023, x_214031);\n            double defunc_0_add_arg_214045;\n            \n            defunc_0_add_arg_214045 = ((__global\n                                        double *) mem_229639)[gtid_213924 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_213925 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_214044];\n            defunc_0_f_res_214043 = defunc_0_add_arg_214045;\n        }\n        \n        int64_t binop_p_214046 = sub64(defunc_0_f_res_214039,\n                                       defunc_0_m_fun_res_214036);\n        double defunc_0_f_res_214047 = sitofp_i64_f64(binop_p_214046);\n        double abs_res_214048 = fabs(defunc_0_f_res_214047);\n        double tmp1_214049 = abs_res_214048 / x_214032;\n        double x_214050 = tmp1_214049 * tmp1_214049;\n        double y_214051 = tmp1_214049 * x_214050;\n        double tmp2_214052 = 1.0 - y_214051;\n        double x_214053 = tmp2_21",
            "4052 * tmp2_214052;\n        double tmp3_214054 = tmp2_214052 * x_214053;\n        double tmp4_214055 = defunc_0_f_res_214043 * tmp3_214054;\n        double defunc_1_f_res_214056 = defunc_0_f_res_214047 * tmp4_214055;\n        double defunc_0_f_res_214057;\n        \n        if (cond_214038) {\n            defunc_0_f_res_214057 = 0.0;\n        } else {\n            int64_t i_214058 = add64(gtid_214023, x_214031);\n            double defunc_0_add_arg_214059;\n            \n            defunc_0_add_arg_214059 = ((__global\n                                        double *) mem_229634)[gtid_213924 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_213925 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_214058];\n            defunc_0_f_res_214057 = defunc_0_add_arg_214059;\n        }\n        \n        double x_214060 = a11_214033 * tmp4_214055;\n        double y_214061 = b11_214034 * defunc_1_f_res_214056;\n        double x_214062 = x_214060 + y_214061;\n        double defunc_9_fit_fun_res_214063 = defunc_0_f_res_214057 * x_214062;\n        double x_214064 = b11_214034 * tmp4_214055;\n        double y_214065 = c11_214035 * defunc_1_f_res_214056;\n        double x_214066 = x_214064 + y_214065;\n        double defunc_9_slope_fun_res_214067 = defunc_0_f_res_214057 * x_214066;\n        \n        ((__local double *) red_arr_mem_233532)[gtid_214022 * q_s_203575 +\n                                                gtid_214023] =\n            defunc_9_fit_fun_res_214063;\n        ((__local double *) red_arr_mem_233534)[gtid_214022 * q_s_203575 +\n                                                gtid_214023] =\n            defunc_9_slope_fun_res_214067;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233536 = s_n_",
            "m_203726 * q_s_203575;\n    double x_214025;\n    double x_214026;\n    double x_214027;\n    double x_214028;\n    double x_233539;\n    double x_233540;\n    double x_233541;\n    double x_233542;\n    bool ltid_in_bounds_233545 = slt64(sext_i32_i64(local_tid_233481),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233546;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233545) {\n            x_214027 = ((volatile __local\n                         double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481)];\n            x_214028 = ((volatile __local\n                         double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481)];\n            if ((local_tid_233481 - squot32(local_tid_233481, 32) * 32) == 0) {\n                x_214025 = x_214027;\n                x_214026 = x_214028;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233546 = 1;\n        while (slt32(skip_threads_233546, 32)) {\n            bool thread_active_233547 = sle32(skip_threads_233546,\n                                              local_tid_233481 -\n                                              squot32(local_tid_233481, 32) *\n                                              32) && ltid_in_bounds_233545;\n            \n            if (thread_active_233547) {\n                // read operands\n                {\n                    x_214025 = ((volatile __local\n                                 double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481) -\n                                                               sext_i32_i64(skip_threads_233546)];\n                    x_214026 = ((volatile __local\n                                 double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481) -\n                                                               sext_i32_i64(skip_threads_233546)];\n                }\n            }\n            // perform operation\n            {\n           ",
            "     bool inactive_233548 =\n                     slt64(srem64(sext_i32_i64(local_tid_233481), q_s_203575),\n                           sext_i32_i64(local_tid_233481) -\n                           sext_i32_i64(local_tid_233481 -\n                           skip_threads_233546));\n                \n                if (thread_active_233547 && inactive_233548) {\n                    x_214025 = x_214027;\n                    x_214026 = x_214028;\n                }\n                if (thread_active_233547) {\n                    if (!inactive_233548) {\n                        double defunc_1_op_res_214029 = x_214025 + x_214027;\n                        double defunc_1_op_res_214030 = x_214026 + x_214028;\n                        \n                        x_214025 = defunc_1_op_res_214029;\n                        x_214026 = defunc_1_op_res_214030;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233483, skip_threads_233546)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233547) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481)] =\n                        x_214025;\n                    x_214027 = x_214025;\n                    ((volatile __local\n                      double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481)] =\n                        x_214026;\n                    x_214028 = x_214026;\n                }\n            }\n            if (sle32(wave_sizze_233483, skip_threads_233546)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233546 *= 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_233481 - squot32(local_tid_233481, 32) * 32) == 31 &&\n            ltid_in_bounds_233545) {\n            ((volatile __local\n              double *) red_ar",
            "r_mem_233532)[sext_i32_i64(squot32(local_tid_233481,\n                                                                 32))] =\n                x_214025;\n            ((volatile __local\n              double *) red_arr_mem_233534)[sext_i32_i64(squot32(local_tid_233481,\n                                                                 32))] =\n                x_214026;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233549;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233481, 32) == 0 && ltid_in_bounds_233545) {\n                x_233541 = ((volatile __local\n                             double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481)];\n                x_233542 = ((volatile __local\n                             double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481)];\n                if ((local_tid_233481 - squot32(local_tid_233481, 32) * 32) ==\n                    0) {\n                    x_233539 = x_233541;\n                    x_233540 = x_233542;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233549 = 1;\n            while (slt32(skip_threads_233549, 32)) {\n                bool thread_active_233550 = sle32(skip_threads_233549,\n                                                  local_tid_233481 -\n                                                  squot32(local_tid_233481,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233481, 32) == 0 &&\n                      ltid_in_bounds_233545);\n                \n                if (thread_active_233550) {\n                    // read operands\n                    {\n                        x_233539 = ((volatile __local\n                                     double *) red_arr_mem_233532)[sext_i32_i64(local_tid_2",
            "33481) -\n                                                                   sext_i32_i64(skip_threads_233549)];\n                        x_233540 = ((volatile __local\n                                     double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481) -\n                                                                   sext_i32_i64(skip_threads_233549)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233551 =\n                         slt64(srem64(sext_i32_i64(local_tid_233481 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233481 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233481 -\n                                             skip_threads_233549) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233550 && inactive_233551) {\n                        x_233539 = x_233541;\n                        x_233540 = x_233542;\n                    }\n                    if (thread_active_233550) {\n                        if (!inactive_233551) {\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                    }\n                }\n                if (sle32(wave_sizze_233483, skip_threads_233549)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233550) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481)] =\n                            x_233539;\n             ",
            "           x_233541 = x_233539;\n                        ((volatile __local\n                          double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481)] =\n                            x_233540;\n                        x_233542 = x_233540;\n                    }\n                }\n                if (sle32(wave_sizze_233483, skip_threads_233549)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233549 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233552 = squot32(local_tid_233481, 32) == 0 ||\n         !ltid_in_bounds_233545;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233552) {\n                x_214027 = x_214025;\n                x_214028 = x_214026;\n                x_214025 = ((__local\n                             double *) red_arr_mem_233532)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_214026 = ((__local\n                             double *) red_arr_mem_233534)[sext_i32_i64(squot32(local_tid_233481,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233553 = slt64(srem64(sext_i32_i64(local_tid_233481),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233481) -\n                                         sext_i32_i64(squot32(local_tid_233481,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233552) {\n                if (inactive_233553) {\n                    x_214025 = x_21402",
            "7;\n                    x_214026 = x_214028;\n                }\n            }\n            if (!no_carry_in_233552) {\n                if (!inactive_233553) {\n                    double defunc_1_op_res_214029 = x_214025 + x_214027;\n                    double defunc_1_op_res_214030 = x_214026 + x_214028;\n                    \n                    x_214025 = defunc_1_op_res_214029;\n                    x_214026 = defunc_1_op_res_214030;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233552) {\n                ((__local\n                  double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481)] =\n                    x_214025;\n                ((__local\n                  double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481)] =\n                    x_214026;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233481, 32) == 0 && ltid_in_bounds_233545) {\n            ((__local\n              double *) red_arr_mem_233532)[sext_i32_i64(local_tid_233481)] =\n                x_214027;\n            ((__local\n              double *) red_arr_mem_233534)[sext_i32_i64(local_tid_233481)] =\n                x_214028;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233554 = 0; i_233554 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233554++) {\n        double tmp_233555;\n        \n        tmp_233555 = ((__local double *) red_arr_mem_233532)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233554 *\n                                                              computed_group_sizze_213795 +\n                                      ",
            "                        sext_i32_i64(local_tid_233481)) *\n                                                             q_s_203575];\n        ((__local double *) color_232108)[i_233554 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481)] =\n            tmp_233555;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233556 = 0; i_233556 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233556++) {\n        double tmp_233557;\n        \n        tmp_233557 = ((__local double *) red_arr_mem_233534)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233556 *\n                                                              computed_group_sizze_213795 +\n                                                              sext_i32_i64(local_tid_233481)) *\n                                                             q_s_203575];\n        ((__local double *) color_232107)[i_233556 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481)] =\n            tmp_233557;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233558 = 0; i_233558 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233558++) {\n        double tmp_233559;\n        \n        tmp_233559 = ((__local double *) color_232108)[i_233558 *\n                                                       computed_group_sizze_213795 +\n                                                       sext_i32_i64(local_tid_233481)",
            "];\n        ((__global double *) mem_230059)[gtid_213924 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_213925 * s_n_m_203726 +\n                                         (i_233558 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481))] =\n            tmp_233559;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233560 = 0; i_233560 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233481),\n                                                    computed_group_sizze_213795);\n         i_233560++) {\n        double tmp_233561;\n        \n        tmp_233561 = ((__local double *) color_232107)[i_233560 *\n                                                       computed_group_sizze_213795 +\n                                                       sext_i32_i64(local_tid_233481)];\n        ((__global double *) mem_230064)[gtid_213924 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_213925 * s_n_m_203726 +\n                                         (i_233560 *\n                                          computed_group_sizze_213795 +\n                                          sext_i32_i64(local_tid_233481))] =\n            tmp_233561;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_216501(__global int *global_failure,\n                                             uint red_arr_mem_233929_backing_offset_0,\n                                             uint red_arr_mem_233927_backing_offset_1,\n                                             uint red_arr_mem_233885_backing_offset_2,\n                                             uint red_arr_mem_233883_backing_offset_3,\n                                             uint red_arr_m",
            "em_233881_backing_offset_4,\n                                             uint red_arr_mem_233879_backing_offset_5,\n                                             uint red_arr_mem_233877_backing_offset_6,\n                                             uint color_232130_backing_offset_7,\n                                             uint color_232129_backing_offset_8,\n                                             uint color_232128_backing_offset_9,\n                                             uint color_232127_backing_offset_10,\n                                             uint color_232126_backing_offset_11,\n                                             uint color_232125_backing_offset_12,\n                                             uint color_232124_backing_offset_13,\n                                             uint color_232123_backing_offset_14,\n                                             uint color_232122_backing_offset_15,\n                                             uint color_232121_backing_offset_16,\n                                             uint color_232120_backing_offset_17,\n                                             uint color_232119_backing_offset_18,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726,\n                                             int64_t computed_group_sizze_216338,\n                                             __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *",
            "ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230398,\n                                             __global unsigned char *mem_230403)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233929_backing_18 =\n                           &shared_mem[red_arr_mem_233929_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233927_backing_17 =\n                           &shared_mem[red_arr_mem_233927_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233885_backing_16 =\n                           &shared_mem[red_arr_mem_233885_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233883_backing_15 =\n                           &shared_mem[red_arr_mem_233883_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233881_backing_14 =\n                           &shared_mem[red_arr_mem_233881_backing_offset_4];\n    volatile unsigned char *red_arr_mem_233879_backing_13 =\n                           &shared_mem[red_arr_mem_233879_backing_offset_5];\n    volatile unsigned char *red_arr_mem_233877_backing_12 =\n                           &shared_mem[red_arr_mem_233877_backing_offset_6];\n    volatile unsigned char *color_232130_backing_11 =\n                           &shared_mem[color_232130_backing_offset_7];\n    volatile unsigned char *color_232129_backing_10 =\n                           &shared_mem[color_232129_backing_offset_8];\n    volatile unsigned char *color_232128_backing_9 =\n                           &shared_mem[color_2",
            "32128_backing_offset_9];\n    volatile unsigned char *color_232127_backing_8 =\n                           &shared_mem[color_232127_backing_offset_10];\n    volatile unsigned char *color_232126_backing_7 =\n                           &shared_mem[color_232126_backing_offset_11];\n    volatile unsigned char *color_232125_backing_6 =\n                           &shared_mem[color_232125_backing_offset_12];\n    volatile unsigned char *color_232124_backing_5 =\n                           &shared_mem[color_232124_backing_offset_13];\n    volatile unsigned char *color_232123_backing_4 =\n                           &shared_mem[color_232123_backing_offset_14];\n    volatile unsigned char *color_232122_backing_3 =\n                           &shared_mem[color_232122_backing_offset_15];\n    volatile unsigned char *color_232121_backing_2 =\n                           &shared_mem[color_232121_backing_offset_16];\n    volatile unsigned char *color_232120_backing_1 =\n                           &shared_mem[color_232120_backing_offset_17];\n    volatile unsigned char *color_232119_backing_0 =\n                           &shared_mem[color_232119_backing_offset_18];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233859;\n    int32_t local_tid_233860;\n    int64_t group_sizze_233863;\n    int32_t wave_sizze_233862;\n    int32_t group_tid_233861;\n    \n    global_tid_233859 = get_global_id(0);\n    local_tid_233860 = get_local_id(0);\n    group_sizze_233863 = get_local_size(0);\n    wave_sizze_233862 = LOCKSTEP_WIDTH;\n    group_tid_233861 = get_group_id(0);\n    \n    int32_t phys_tid_216501 = group_tid_233861;\n    int64_t slice_233865 = s_n_m_203726;\n    int64_t ltid_pre_233864 = sext_i32_i64(local_tid_233860);\n    int64_t remnant_233866 = sext_i32_i64(local_tid_233860) - ltid_pre_233864;\n    int64_t slice_233869 = q_s_203575;\n    int64_t slice_233870 = s_n_m_203726 * slice_233869;\n    int64_t ltid_pre_233867 = squot64(sext_i32_i64(local_tid_233860),\n                             ",
            "         slice_233869);\n    int64_t remnant_233871 = sext_i32_i64(local_tid_233860) - ltid_pre_233867 *\n            slice_233869;\n    int64_t ltid_pre_233868 = remnant_233871;\n    int64_t remnant_233872 = remnant_233871 - ltid_pre_233868;\n    int64_t slice_233873 = n_p_203574;\n    int64_t slice_233874 = partition_sizze_203667 * slice_233873;\n    int64_t gtid_216499 = squot64(sext_i32_i64(group_tid_233861), slice_233873);\n    int64_t remnant_233875 = sext_i32_i64(group_tid_233861) - gtid_216499 *\n            slice_233873;\n    int64_t gtid_216500 = remnant_233875;\n    int64_t remnant_233876 = remnant_233875 - gtid_216500;\n    __local unsigned char *color_232119;\n    \n    color_232119 = (__local unsigned char *) color_232119_backing_0;\n    \n    __local unsigned char *color_232120;\n    \n    color_232120 = (__local unsigned char *) color_232120_backing_1;\n    \n    __local unsigned char *color_232121;\n    \n    color_232121 = (__local unsigned char *) color_232121_backing_2;\n    \n    __local unsigned char *color_232122;\n    \n    color_232122 = (__local unsigned char *) color_232122_backing_3;\n    \n    __local unsigned char *color_232123;\n    \n    color_232123 = (__local unsigned char *) color_232123_backing_4;\n    \n    __local unsigned char *color_232124;\n    \n    color_232124 = (__local unsigned char *) color_232124_backing_5;\n    \n    __local unsigned char *color_232125;\n    \n    color_232125 = (__local unsigned char *) color_232125_backing_6;\n    \n    __local unsigned char *color_232126;\n    \n    color_232126 = (__local unsigned char *) color_232126_backing_7;\n    \n    __local unsigned char *color_232127;\n    \n    color_232127 = (__local unsigned char *) color_232127_backing_8;\n    \n    __local unsigned char *color_232128;\n    \n    color_232128 = (__local unsigned char *) color_232128_backing_9;\n    \n    __local unsigned char *color_232129;\n    \n    color_232129 = (__local unsigned char *) color_232129_backing_10;\n    \n    __local unsigned char *color_232130;\n    \n    c",
            "olor_232130 = (__local unsigned char *) color_232130_backing_11;\n    \n    int64_t x_216508;\n    \n    x_216508 = ((__global int64_t *) ext_mem_229372)[gtid_216499 * n_p_203574 +\n                                                     gtid_216500];\n    \n    int64_t gtid_216515 = sext_i32_i64(sext_i64_i32(ltid_pre_233864));\n    int32_t phys_tid_216516 = local_tid_233860;\n    \n    if (slt64(gtid_216515, s_n_m_203726)) {\n        bool cond_216518 = gtid_216515 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216519;\n        \n        if (cond_216518) {\n            defunc_0_m_fun_res_216519 = (int64_t) 0;\n        } else {\n            int64_t y_216520 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216521 = gtid_216515 == y_216520;\n            int64_t defunc_0_m_fun_res_f_res_216522;\n            \n            if (cond_216521) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216523 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216522 =\n                    defunc_0_m_fun_res_f_res_t_res_216523;\n            } else {\n                int64_t x_216524 = sub64(gtid_216515, (int64_t) 1);\n                int64_t x_216525 = mul64(jump_s_203581, x_216524);\n                int64_t min_arg_216526 = add64((int64_t) 1, x_216525);\n                int64_t min_res_216527 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216526);\n                \n                defunc_0_m_fun_res_f_res_216522 = min_res_216527;\n            }\n            defunc_0_m_fun_res_216519 = defunc_0_m_fun_res_f_res_216522;\n        }\n        ((__local int64_t *) color_232121)[gtid_216515] =\n            defunc_0_m_fun_res_216519;\n        ((__local bool *) color_232130)[gtid_216515] = cond_216518;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216533 = sext_i32_i64(sext_i64_i32(ltid_pre_233867));\n    int64_t gtid_216534 = sext_i32_i64(sext_i64_i32(ltid_pre_233868));\n    int32_t ",
            "phys_tid_216535 = local_tid_233860;\n    __local unsigned char *red_arr_mem_233877;\n    \n    red_arr_mem_233877 = (__local\n                          unsigned char *) red_arr_mem_233877_backing_12;\n    \n    __local unsigned char *red_arr_mem_233879;\n    \n    red_arr_mem_233879 = (__local\n                          unsigned char *) red_arr_mem_233879_backing_13;\n    \n    __local unsigned char *red_arr_mem_233881;\n    \n    red_arr_mem_233881 = (__local\n                          unsigned char *) red_arr_mem_233881_backing_14;\n    \n    __local unsigned char *red_arr_mem_233883;\n    \n    red_arr_mem_233883 = (__local\n                          unsigned char *) red_arr_mem_233883_backing_15;\n    \n    __local unsigned char *red_arr_mem_233885;\n    \n    red_arr_mem_233885 = (__local\n                          unsigned char *) red_arr_mem_233885_backing_16;\n    if (slt64(gtid_216533, s_n_m_203726) && slt64(gtid_216534, q_s_203575)) {\n        int64_t x_216551;\n        \n        x_216551 = ((__global int64_t *) ext_mem_229471)[gtid_216499 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_216500 *\n                                                         s_n_m_203726 +\n                                                         gtid_216533];\n        \n        double x_216552;\n        \n        x_216552 = ((__global double *) ext_mem_229470)[gtid_216499 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_216500 *\n                                                        s_n_m_203726 +\n                                                        gtid_216533];\n        \n        int64_t defunc_0_m_fun_res_216553;\n        \n        defunc_0_m_fun_res_216553 = ((__local\n                           ",
            "           int64_t *) color_232121)[gtid_216533];\n        \n        bool cond_216555 = sle64(x_216508, gtid_216534);\n        int64_t defunc_0_f_res_216556;\n        \n        if (cond_216555) {\n            defunc_0_f_res_216556 = (int64_t) 0;\n        } else {\n            int64_t i_216557 = add64(gtid_216534, x_216551);\n            int64_t defunc_0_add_arg_216558;\n            \n            defunc_0_add_arg_216558 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_216499 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_216500 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_216557];\n            \n            int64_t defunc_1_add_res_216559 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216558);\n            \n            defunc_0_f_res_216556 = defunc_1_add_res_216559;\n        }\n        \n        double defunc_0_f_res_216560;\n        \n        if (cond_216555) {\n            defunc_0_f_res_216560 = 0.0;\n        } else {\n            int64_t i_216561 = add64(gtid_216534, x_216551);\n            double defunc_0_add_arg_216562;\n            \n            defunc_0_add_arg_216562 = ((__global\n                                        double *) mem_229639)[gtid_216499 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_216500 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_216561];\n            defunc_0_f_res_216560 = defunc_0_ad",
            "d_arg_216562;\n        }\n        \n        int64_t binop_p_216563 = sub64(defunc_0_f_res_216556,\n                                       defunc_0_m_fun_res_216553);\n        double defunc_0_f_res_216564 = sitofp_i64_f64(binop_p_216563);\n        double abs_res_216565 = fabs(defunc_0_f_res_216564);\n        double tmp1_216566 = abs_res_216565 / x_216552;\n        double x_216567 = tmp1_216566 * tmp1_216566;\n        double y_216568 = tmp1_216566 * x_216567;\n        double tmp2_216569 = 1.0 - y_216568;\n        double x_216570 = tmp2_216569 * tmp2_216569;\n        double tmp3_216571 = tmp2_216569 * x_216570;\n        double w_j_216572 = defunc_0_f_res_216560 * tmp3_216571;\n        double xw_j_216573 = defunc_0_f_res_216564 * w_j_216572;\n        double x2w_j_216574 = defunc_0_f_res_216564 * xw_j_216573;\n        double x3w_j_216575 = defunc_0_f_res_216564 * x2w_j_216574;\n        double x4w_j_216576 = defunc_0_f_res_216564 * x3w_j_216575;\n        \n        ((__local double *) red_arr_mem_233877)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = w_j_216572;\n        ((__local double *) red_arr_mem_233879)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = xw_j_216573;\n        ((__local double *) red_arr_mem_233881)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = x2w_j_216574;\n        ((__local double *) red_arr_mem_233883)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = x3w_j_216575;\n        ((__local double *) red_arr_mem_233885)[gtid_216533 * q_s_203575 +\n                                                gtid_216534] = x4w_j_216576;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233887 = s_n_m_203726 * q_s_203575;\n    double x_216536;\n    double x_216537;\n    double x_216538;\n    double x_216539;\n    double x_216540;\n    double x_216541;\n    double x_216542;\n    double x_216543;\n    double x_216544;\n    d",
            "ouble x_216545;\n    double x_233893;\n    double x_233894;\n    double x_233895;\n    double x_233896;\n    double x_233897;\n    double x_233898;\n    double x_233899;\n    double x_233900;\n    double x_233901;\n    double x_233902;\n    bool ltid_in_bounds_233908 = slt64(sext_i32_i64(local_tid_233860),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233909;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233908) {\n            x_216541 = ((volatile __local\n                         double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860)];\n            x_216542 = ((volatile __local\n                         double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860)];\n            x_216543 = ((volatile __local\n                         double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860)];\n            x_216544 = ((volatile __local\n                         double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860)];\n            x_216545 = ((volatile __local\n                         double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860)];\n            if ((local_tid_233860 - squot32(local_tid_233860, 32) * 32) == 0) {\n                x_216536 = x_216541;\n                x_216537 = x_216542;\n                x_216538 = x_216543;\n                x_216539 = x_216544;\n                x_216540 = x_216545;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233909 = 1;\n        while (slt32(skip_threads_233909, 32)) {\n            bool thread_active_233910 = sle32(skip_threads_233909,\n                                              local_tid_233860 -\n                                              squot32(local_tid_233860, 32) *\n                                              32) && ltid_in_bounds_233908;\n            \n            if (thread_active_233910) {\n                // read operands\n                {\n                    x_216536 = ((volatile __",
            "local\n                                 double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233909)];\n                    x_216537 = ((volatile __local\n                                 double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233909)];\n                    x_216538 = ((volatile __local\n                                 double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233909)];\n                    x_216539 = ((volatile __local\n                                 double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233909)];\n                    x_216540 = ((volatile __local\n                                 double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233909)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233911 =\n                     slt64(srem64(sext_i32_i64(local_tid_233860), q_s_203575),\n                           sext_i32_i64(local_tid_233860) -\n                           sext_i32_i64(local_tid_233860 -\n                           skip_threads_233909));\n                \n                if (thread_active_233910 && inactive_233911) {\n                    x_216536 = x_216541;\n                    x_216537 = x_216542;\n                    x_216538 = x_216543;\n                    x_216539 = x_216544;\n                    x_216540 = x_216545;\n                }\n                if (thread_active_233910) {\n                    if (!inactive_233911) {\n                        double defunc_1_op_res_216546 = x_2165",
            "36 + x_216541;\n                        double defunc_1_op_res_216547 = x_216537 + x_216542;\n                        double defunc_1_op_res_216548 = x_216538 + x_216543;\n                        double defunc_1_op_res_216549 = x_216539 + x_216544;\n                        double defunc_1_op_res_216550 = x_216540 + x_216545;\n                        \n                        x_216536 = defunc_1_op_res_216546;\n                        x_216537 = defunc_1_op_res_216547;\n                        x_216538 = defunc_1_op_res_216548;\n                        x_216539 = defunc_1_op_res_216549;\n                        x_216540 = defunc_1_op_res_216550;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233862, skip_threads_233909)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233910) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860)] =\n                        x_216536;\n                    x_216541 = x_216536;\n                    ((volatile __local\n                      double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860)] =\n                        x_216537;\n                    x_216542 = x_216537;\n                    ((volatile __local\n                      double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860)] =\n                        x_216538;\n                    x_216543 = x_216538;\n                    ((volatile __local\n                      double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860)] =\n                        x_216539;\n                    x_216544 = x_216539;\n                    ((volatile __local\n                      double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860)] =\n                        x_216540;\n                    x_216545 = x_216540;\n                }\n            }\n            if (sle32(wave_sizze_233862, skip_threads_23",
            "3909)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233909 *= 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_233860 - squot32(local_tid_233860, 32) * 32) == 31 &&\n            ltid_in_bounds_233908) {\n            ((volatile __local\n              double *) red_arr_mem_233877)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216536;\n            ((volatile __local\n              double *) red_arr_mem_233879)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216537;\n            ((volatile __local\n              double *) red_arr_mem_233881)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216538;\n            ((volatile __local\n              double *) red_arr_mem_233883)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216539;\n            ((volatile __local\n              double *) red_arr_mem_233885)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216540;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233912;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233860, 32) == 0 && ltid_in_bounds_233908) {\n                x_233898 = ((volatile __local\n                             double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860)];\n                x_233899 = ((volatile __local\n                             double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860)];\n ",
            "               x_233900 = ((volatile __local\n                             double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860)];\n                x_233901 = ((volatile __local\n                             double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860)];\n                x_233902 = ((volatile __local\n                             double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860)];\n                if ((local_tid_233860 - squot32(local_tid_233860, 32) * 32) ==\n                    0) {\n                    x_233893 = x_233898;\n                    x_233894 = x_233899;\n                    x_233895 = x_233900;\n                    x_233896 = x_233901;\n                    x_233897 = x_233902;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233912 = 1;\n            while (slt32(skip_threads_233912, 32)) {\n                bool thread_active_233913 = sle32(skip_threads_233912,\n                                                  local_tid_233860 -\n                                                  squot32(local_tid_233860,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233860, 32) == 0 &&\n                      ltid_in_bounds_233908);\n                \n                if (thread_active_233913) {\n                    // read operands\n                    {\n                        x_233893 = ((volatile __local\n                                     double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233912)];\n                        x_233894 = ((volatile __local\n                                     double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233912)];\n                        x_233895 = ((volatile __local",
            "\n                                     double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233912)];\n                        x_233896 = ((volatile __local\n                                     double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233912)];\n                        x_233897 = ((volatile __local\n                                     double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233912)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233914 =\n                         slt64(srem64(sext_i32_i64(local_tid_233860 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233860 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233860 -\n                                             skip_threads_233912) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233913 && inactive_233914) {\n                        x_233893 = x_233898;\n                        x_233894 = x_233899;\n                        x_233895 = x_233900;\n                        x_233896 = x_233901;\n                        x_233897 = x_233902;\n                    }\n                    if (thread_active_233913) {\n                        if (!inactive_233914) {\n                            double defunc_1_op_res_233903 = x_233893 + x_233898;\n                            double defunc_1_op_res_233904 = x_233894 + x_233899;\n                            double defunc_1_op_res_233905 = x_233895 + x_233900;\n                            double defunc_1_op_res_233906 = x_233896 + x_233901",
            ";\n                            double defunc_1_op_res_233907 = x_233897 + x_233902;\n                            \n                            x_233893 = defunc_1_op_res_233903;\n                            x_233894 = defunc_1_op_res_233904;\n                            x_233895 = defunc_1_op_res_233905;\n                            x_233896 = defunc_1_op_res_233906;\n                            x_233897 = defunc_1_op_res_233907;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233862, skip_threads_233912)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233913) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860)] =\n                            x_233893;\n                        x_233898 = x_233893;\n                        ((volatile __local\n                          double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860)] =\n                            x_233894;\n                        x_233899 = x_233894;\n                        ((volatile __local\n                          double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860)] =\n                            x_233895;\n                        x_233900 = x_233895;\n                        ((volatile __local\n                          double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860)] =\n                            x_233896;\n                        x_233901 = x_233896;\n                        ((volatile __local\n                          double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860)] =\n                            x_233897;\n                        x_233902 = x_233897;\n                    }\n                }\n                if (sle32(wave_sizze_233862, skip_threads_233912)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n           ",
            "     skip_threads_233912 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233915 = squot32(local_tid_233860, 32) == 0 ||\n         !ltid_in_bounds_233908;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233915) {\n                x_216541 = x_216536;\n                x_216542 = x_216537;\n                x_216543 = x_216538;\n                x_216544 = x_216539;\n                x_216545 = x_216540;\n                x_216536 = ((__local\n                             double *) red_arr_mem_233877)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216537 = ((__local\n                             double *) red_arr_mem_233879)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216538 = ((__local\n                             double *) red_arr_mem_233881)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216539 = ((__local\n                             double *) red_arr_mem_233883)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216540 = ((__local\n                             double *) red_arr_mem_233885)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n     ",
            "       }\n        }\n        // perform operation\n        {\n            bool inactive_233916 = slt64(srem64(sext_i32_i64(local_tid_233860),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233860) -\n                                         sext_i32_i64(squot32(local_tid_233860,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233915) {\n                if (inactive_233916) {\n                    x_216536 = x_216541;\n                    x_216537 = x_216542;\n                    x_216538 = x_216543;\n                    x_216539 = x_216544;\n                    x_216540 = x_216545;\n                }\n            }\n            if (!no_carry_in_233915) {\n                if (!inactive_233916) {\n                    double defunc_1_op_res_216546 = x_216536 + x_216541;\n                    double defunc_1_op_res_216547 = x_216537 + x_216542;\n                    double defunc_1_op_res_216548 = x_216538 + x_216543;\n                    double defunc_1_op_res_216549 = x_216539 + x_216544;\n                    double defunc_1_op_res_216550 = x_216540 + x_216545;\n                    \n                    x_216536 = defunc_1_op_res_216546;\n                    x_216537 = defunc_1_op_res_216547;\n                    x_216538 = defunc_1_op_res_216548;\n                    x_216539 = defunc_1_op_res_216549;\n                    x_216540 = defunc_1_op_res_216550;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233915) {\n                ((__local\n                  double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860)] =\n                    x_216536;\n                ((__local\n                  double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860)] =\n                    x_216537;\n                ((__local\n                  double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860)",
            "] =\n                    x_216538;\n                ((__local\n                  double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860)] =\n                    x_216539;\n                ((__local\n                  double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860)] =\n                    x_216540;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233860, 32) == 0 && ltid_in_bounds_233908) {\n            ((__local\n              double *) red_arr_mem_233877)[sext_i32_i64(local_tid_233860)] =\n                x_216541;\n            ((__local\n              double *) red_arr_mem_233879)[sext_i32_i64(local_tid_233860)] =\n                x_216542;\n            ((__local\n              double *) red_arr_mem_233881)[sext_i32_i64(local_tid_233860)] =\n                x_216543;\n            ((__local\n              double *) red_arr_mem_233883)[sext_i32_i64(local_tid_233860)] =\n                x_216544;\n            ((__local\n              double *) red_arr_mem_233885)[sext_i32_i64(local_tid_233860)] =\n                x_216545;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233917 = 0; i_233917 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233917++) {\n        double tmp_233918;\n        \n        tmp_233918 = ((__local double *) red_arr_mem_233877)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233917 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233860)) *\n                                                             q_s_203575];\n        (",
            "(__local double *) color_232129)[i_233917 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233918;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233919 = 0; i_233919 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233919++) {\n        double tmp_233920;\n        \n        tmp_233920 = ((__local double *) red_arr_mem_233879)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233919 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233860)) *\n                                                             q_s_203575];\n        ((__local double *) color_232128)[i_233919 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233920;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233921 = 0; i_233921 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233921++) {\n        double tmp_233922;\n        \n        tmp_233922 = ((__local double *) red_arr_mem_233881)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233921 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233860)) *\n ",
            "                                                            q_s_203575];\n        ((__local double *) color_232127)[i_233921 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233922;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233923 = 0; i_233923 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233923++) {\n        double tmp_233924;\n        \n        tmp_233924 = ((__local double *) red_arr_mem_233883)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233923 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233860)) *\n                                                             q_s_203575];\n        ((__local double *) color_232120)[i_233923 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233924;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233925 = 0; i_233925 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233925++) {\n        double tmp_233926;\n        \n        tmp_233926 = ((__local double *) red_arr_mem_233885)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233925 *\n                                                              computed_group_sizze_216338 +\n               ",
            "                                               sext_i32_i64(local_tid_233860)) *\n                                                             q_s_203575];\n        ((__local double *) color_232119)[i_233925 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233926;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216583 = sext_i32_i64(sext_i64_i32(ltid_pre_233864));\n    int32_t phys_tid_216584 = local_tid_233860;\n    \n    if (slt64(gtid_216583, s_n_m_203726)) {\n        bool index_primexp_228817 = gtid_216583 == (int64_t) 0;\n        double defunc_2_reduce_res_216587;\n        \n        defunc_2_reduce_res_216587 = ((__local\n                                       double *) color_232129)[gtid_216583];\n        \n        double defunc_2_reduce_res_216588;\n        \n        defunc_2_reduce_res_216588 = ((__local\n                                       double *) color_232128)[gtid_216583];\n        \n        double defunc_2_reduce_res_216589;\n        \n        defunc_2_reduce_res_216589 = ((__local\n                                       double *) color_232127)[gtid_216583];\n        \n        double defunc_2_reduce_res_216590;\n        \n        defunc_2_reduce_res_216590 = ((__local\n                                       double *) color_232120)[gtid_216583];\n        \n        double defunc_2_reduce_res_216591;\n        \n        defunc_2_reduce_res_216591 = ((__local\n                                       double *) color_232119)[gtid_216583];\n        \n        double x_216592 = defunc_2_reduce_res_216589 *\n               defunc_2_reduce_res_216591;\n        double y_216593 = defunc_2_reduce_res_216590 *\n               defunc_2_reduce_res_216590;\n        double a12_216594 = x_216592 - y_216593;\n        double x_216595 = defunc_2_reduce_res_216589 *\n               defunc_2_reduce_res_216590;\n        double y_216596 = defunc_2_reduce",
            "_res_216588 *\n               defunc_2_reduce_res_216591;\n        double b12_216597 = x_216595 - y_216596;\n        double x_216598 = defunc_2_reduce_res_216588 *\n               defunc_2_reduce_res_216590;\n        double y_216599 = defunc_2_reduce_res_216589 *\n               defunc_2_reduce_res_216589;\n        double c12_216600 = x_216598 - y_216599;\n        double x_216601 = defunc_2_reduce_res_216587 *\n               defunc_2_reduce_res_216591;\n        double b2_216602 = x_216601 - y_216599;\n        double x_216603 = defunc_2_reduce_res_216588 *\n               defunc_2_reduce_res_216589;\n        double y_216604 = defunc_2_reduce_res_216587 *\n               defunc_2_reduce_res_216590;\n        double c2_216605 = x_216603 - y_216604;\n        double x_216606 = defunc_2_reduce_res_216587 * a12_216594;\n        double y_216607 = defunc_2_reduce_res_216588 * b12_216597;\n        double x_216608 = x_216606 + y_216607;\n        double y_216609 = defunc_2_reduce_res_216589 * c12_216600;\n        double y_216610 = x_216608 + y_216609;\n        double det_216611 = 1.0 / y_216610;\n        double a12_216612 = a12_216594 * det_216611;\n        double b12_216613 = b12_216597 * det_216611;\n        double c12_216614 = c12_216600 * det_216611;\n        double b2_216615 = b2_216602 * det_216611;\n        double c2_216616 = c2_216605 * det_216611;\n        int64_t defunc_0_m_fun_res_216617;\n        \n        if (index_primexp_228817) {\n            defunc_0_m_fun_res_216617 = (int64_t) 0;\n        } else {\n            int64_t y_216618 = sub64(s_n_m_203726, (int64_t) 1);\n            bool cond_216619 = gtid_216583 == y_216618;\n            int64_t defunc_0_m_fun_res_f_res_216620;\n            \n            if (cond_216619) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216621 =\n                        sub64(pad_css_len_203722, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216620 =\n                    defunc_0_m_fun_res_f_res_t_res_216621;\n            } else {\n        ",
            "        int64_t x_216622 = sub64(gtid_216583, (int64_t) 1);\n                int64_t x_216623 = mul64(jump_s_203581, x_216622);\n                int64_t min_arg_216624 = add64((int64_t) 1, x_216623);\n                int64_t min_res_216625 = smin64(defunc_0_f_res_203721,\n                                                min_arg_216624);\n                \n                defunc_0_m_fun_res_f_res_216620 = min_res_216625;\n            }\n            defunc_0_m_fun_res_216617 = defunc_0_m_fun_res_f_res_216620;\n        }\n        ((__local double *) color_232126)[gtid_216583] = a12_216612;\n        ((__local double *) color_232125)[gtid_216583] = b12_216613;\n        ((__local double *) color_232124)[gtid_216583] = c12_216614;\n        ((__local double *) color_232123)[gtid_216583] = b2_216615;\n        ((__local double *) color_232122)[gtid_216583] = c2_216616;\n        ((__local int64_t *) color_232121)[gtid_216583] =\n            defunc_0_m_fun_res_216617;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216628 = sext_i32_i64(sext_i64_i32(ltid_pre_233867));\n    int64_t gtid_216629 = sext_i32_i64(sext_i64_i32(ltid_pre_233868));\n    int32_t phys_tid_216630 = local_tid_233860;\n    __local unsigned char *red_arr_mem_233927;\n    \n    red_arr_mem_233927 = (__local\n                          unsigned char *) red_arr_mem_233927_backing_17;\n    \n    __local unsigned char *red_arr_mem_233929;\n    \n    red_arr_mem_233929 = (__local\n                          unsigned char *) red_arr_mem_233929_backing_18;\n    if (slt64(gtid_216628, s_n_m_203726) && slt64(gtid_216629, q_s_203575)) {\n        int64_t x_216637;\n        \n        x_216637 = ((__global int64_t *) ext_mem_229471)[gtid_216499 *\n                                                         (s_n_m_203726 *\n                                                          n_p_203574) +\n                                                         gtid_216500 *\n                                                         s_n_m_203726 +\n              ",
            "                                           gtid_216628];\n        \n        double x_216638;\n        \n        x_216638 = ((__global double *) ext_mem_229470)[gtid_216499 *\n                                                        (s_n_m_203726 *\n                                                         n_p_203574) +\n                                                        gtid_216500 *\n                                                        s_n_m_203726 +\n                                                        gtid_216628];\n        \n        double a12_216639;\n        \n        a12_216639 = ((__local double *) color_232126)[gtid_216628];\n        \n        double b12_216640;\n        \n        b12_216640 = ((__local double *) color_232125)[gtid_216628];\n        \n        double c12_216641;\n        \n        c12_216641 = ((__local double *) color_232124)[gtid_216628];\n        \n        double b2_216642;\n        \n        b2_216642 = ((__local double *) color_232123)[gtid_216628];\n        \n        double c2_216643;\n        \n        c2_216643 = ((__local double *) color_232122)[gtid_216628];\n        \n        int64_t defunc_0_m_fun_res_216644;\n        \n        defunc_0_m_fun_res_216644 = ((__local\n                                      int64_t *) color_232121)[gtid_216628];\n        \n        bool cond_216646 = sle64(x_216508, gtid_216629);\n        int64_t defunc_0_f_res_216647;\n        \n        if (cond_216646) {\n            defunc_0_f_res_216647 = (int64_t) 0;\n        } else {\n            int64_t i_216648 = add64(gtid_216629, x_216637);\n            int64_t defunc_0_add_arg_216649;\n            \n            defunc_0_add_arg_216649 = ((__global\n                                        int64_t *) ext_mem_229373)[gtid_216499 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_216500 *\n               ",
            "                                                    defunc_0_f_res_203721 +\n                                                                   i_216648];\n            \n            int64_t defunc_1_add_res_216650 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216649);\n            \n            defunc_0_f_res_216647 = defunc_1_add_res_216650;\n        }\n        \n        double defunc_0_f_res_216651;\n        \n        if (cond_216646) {\n            defunc_0_f_res_216651 = 0.0;\n        } else {\n            int64_t i_216652 = add64(gtid_216629, x_216637);\n            double defunc_0_add_arg_216653;\n            \n            defunc_0_add_arg_216653 = ((__global\n                                        double *) mem_229639)[gtid_216499 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_216500 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_216652];\n            defunc_0_f_res_216651 = defunc_0_add_arg_216653;\n        }\n        \n        int64_t binop_p_216654 = sub64(defunc_0_f_res_216647,\n                                       defunc_0_m_fun_res_216644);\n        double defunc_0_f_res_216655 = sitofp_i64_f64(binop_p_216654);\n        double abs_res_216656 = fabs(defunc_0_f_res_216655);\n        double tmp1_216657 = abs_res_216656 / x_216638;\n        double x_216658 = tmp1_216657 * tmp1_216657;\n        double y_216659 = tmp1_216657 * x_216658;\n        double tmp2_216660 = 1.0 - y_216659;\n        double x_216661 = tmp2_216660 * tmp2_216660;\n        double tmp3_216662 = tmp2_216660 * x_216661;\n        double tmp4_216663 = defunc_0_f_res_216651 * tmp3_216662;\n        double defunc_1_f_res_216664 = defunc_0_f_res_216655 * tmp4_216663;\n        double defunc_1_f_res_",
            "216665 = defunc_0_f_res_216655 *\n               defunc_1_f_res_216664;\n        double defunc_0_f_res_216666;\n        \n        if (cond_216646) {\n            defunc_0_f_res_216666 = 0.0;\n        } else {\n            int64_t i_216667 = add64(gtid_216629, x_216637);\n            double defunc_0_add_arg_216668;\n            \n            defunc_0_add_arg_216668 = ((__global\n                                        double *) mem_229634)[gtid_216499 *\n                                                              (defunc_0_f_res_203721 *\n                                                               n_p_203574) +\n                                                              gtid_216500 *\n                                                              defunc_0_f_res_203721 +\n                                                              i_216667];\n            defunc_0_f_res_216666 = defunc_0_add_arg_216668;\n        }\n        \n        double x_216669 = a12_216639 * tmp4_216663;\n        double y_216670 = b12_216640 * defunc_1_f_res_216664;\n        double x_216671 = x_216669 + y_216670;\n        double y_216672 = c12_216641 * defunc_1_f_res_216665;\n        double x_216673 = x_216671 + y_216672;\n        double defunc_9_fit_fun_res_216674 = defunc_0_f_res_216666 * x_216673;\n        double x_216675 = b12_216640 * tmp4_216663;\n        double y_216676 = b2_216642 * defunc_1_f_res_216664;\n        double x_216677 = x_216675 + y_216676;\n        double y_216678 = c2_216643 * defunc_1_f_res_216665;\n        double x_216679 = x_216677 + y_216678;\n        double defunc_9_slope_fun_res_216680 = defunc_0_f_res_216666 * x_216679;\n        \n        ((__local double *) red_arr_mem_233927)[gtid_216628 * q_s_203575 +\n                                                gtid_216629] =\n            defunc_9_fit_fun_res_216674;\n        ((__local double *) red_arr_mem_233929)[gtid_216628 * q_s_203575 +\n                                                gtid_216629] =\n            defunc_9_slope_fun_res_216680;\n    }\n  ",
            "  barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233931 = s_n_m_203726 * q_s_203575;\n    double x_216631;\n    double x_216632;\n    double x_216633;\n    double x_216634;\n    double x_233934;\n    double x_233935;\n    double x_233936;\n    double x_233937;\n    bool ltid_in_bounds_233940 = slt64(sext_i32_i64(local_tid_233860),\n                                       s_n_m_203726 * q_s_203575);\n    int32_t skip_threads_233941;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233940) {\n            x_216633 = ((volatile __local\n                         double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860)];\n            x_216634 = ((volatile __local\n                         double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860)];\n            if ((local_tid_233860 - squot32(local_tid_233860, 32) * 32) == 0) {\n                x_216631 = x_216633;\n                x_216632 = x_216634;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233941 = 1;\n        while (slt32(skip_threads_233941, 32)) {\n            bool thread_active_233942 = sle32(skip_threads_233941,\n                                              local_tid_233860 -\n                                              squot32(local_tid_233860, 32) *\n                                              32) && ltid_in_bounds_233940;\n            \n            if (thread_active_233942) {\n                // read operands\n                {\n                    x_216631 = ((volatile __local\n                                 double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233941)];\n                    x_216632 = ((volatile __local\n                                 double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860) -\n                                                               sext_i32_i64(skip_threads_233941)];\n                }\n",
            "            }\n            // perform operation\n            {\n                bool inactive_233943 =\n                     slt64(srem64(sext_i32_i64(local_tid_233860), q_s_203575),\n                           sext_i32_i64(local_tid_233860) -\n                           sext_i32_i64(local_tid_233860 -\n                           skip_threads_233941));\n                \n                if (thread_active_233942 && inactive_233943) {\n                    x_216631 = x_216633;\n                    x_216632 = x_216634;\n                }\n                if (thread_active_233942) {\n                    if (!inactive_233943) {\n                        double defunc_1_op_res_216635 = x_216631 + x_216633;\n                        double defunc_1_op_res_216636 = x_216632 + x_216634;\n                        \n                        x_216631 = defunc_1_op_res_216635;\n                        x_216632 = defunc_1_op_res_216636;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233862, skip_threads_233941)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233942) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860)] =\n                        x_216631;\n                    x_216633 = x_216631;\n                    ((volatile __local\n                      double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860)] =\n                        x_216632;\n                    x_216634 = x_216632;\n                }\n            }\n            if (sle32(wave_sizze_233862, skip_threads_233941)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233941 *= 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_233860 - squot32(local_tid_233860, 32) * 32) == 31 &&\n            ltid_in_bounds",
            "_233940) {\n            ((volatile __local\n              double *) red_arr_mem_233927)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216631;\n            ((volatile __local\n              double *) red_arr_mem_233929)[sext_i32_i64(squot32(local_tid_233860,\n                                                                 32))] =\n                x_216632;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233944;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233860, 32) == 0 && ltid_in_bounds_233940) {\n                x_233936 = ((volatile __local\n                             double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860)];\n                x_233937 = ((volatile __local\n                             double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860)];\n                if ((local_tid_233860 - squot32(local_tid_233860, 32) * 32) ==\n                    0) {\n                    x_233934 = x_233936;\n                    x_233935 = x_233937;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233944 = 1;\n            while (slt32(skip_threads_233944, 32)) {\n                bool thread_active_233945 = sle32(skip_threads_233944,\n                                                  local_tid_233860 -\n                                                  squot32(local_tid_233860,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233860, 32) == 0 &&\n                      ltid_in_bounds_233940);\n                \n                if (thread_active_233945) {\n                    // read operands\n                    {\n                        x_233934 = ((volatile __local\n                   ",
            "                  double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233944)];\n                        x_233935 = ((volatile __local\n                                     double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860) -\n                                                                   sext_i32_i64(skip_threads_233944)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233946 =\n                         slt64(srem64(sext_i32_i64(local_tid_233860 * 32 + 32 -\n                                      1), q_s_203575),\n                               sext_i32_i64(local_tid_233860 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233860 -\n                                             skip_threads_233944) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233945 && inactive_233946) {\n                        x_233934 = x_233936;\n                        x_233935 = x_233937;\n                    }\n                    if (thread_active_233945) {\n                        if (!inactive_233946) {\n                            double defunc_1_op_res_233938 = x_233934 + x_233936;\n                            double defunc_1_op_res_233939 = x_233935 + x_233937;\n                            \n                            x_233934 = defunc_1_op_res_233938;\n                            x_233935 = defunc_1_op_res_233939;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233862, skip_threads_233944)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233945) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233927)[sext_i32_i64(",
            "local_tid_233860)] =\n                            x_233934;\n                        x_233936 = x_233934;\n                        ((volatile __local\n                          double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860)] =\n                            x_233935;\n                        x_233937 = x_233935;\n                    }\n                }\n                if (sle32(wave_sizze_233862, skip_threads_233944)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233944 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233947 = squot32(local_tid_233860, 32) == 0 ||\n         !ltid_in_bounds_233940;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233947) {\n                x_216633 = x_216631;\n                x_216634 = x_216632;\n                x_216631 = ((__local\n                             double *) red_arr_mem_233927)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216632 = ((__local\n                             double *) red_arr_mem_233929)[sext_i32_i64(squot32(local_tid_233860,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233948 = slt64(srem64(sext_i32_i64(local_tid_233860),\n                                                q_s_203575),\n                                         sext_i32_i64(local_tid_233860) -\n                                         sext_i32_i64(squot32(local_tid_233860,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233947) {\n     ",
            "           if (inactive_233948) {\n                    x_216631 = x_216633;\n                    x_216632 = x_216634;\n                }\n            }\n            if (!no_carry_in_233947) {\n                if (!inactive_233948) {\n                    double defunc_1_op_res_216635 = x_216631 + x_216633;\n                    double defunc_1_op_res_216636 = x_216632 + x_216634;\n                    \n                    x_216631 = defunc_1_op_res_216635;\n                    x_216632 = defunc_1_op_res_216636;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233947) {\n                ((__local\n                  double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860)] =\n                    x_216631;\n                ((__local\n                  double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860)] =\n                    x_216632;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233860, 32) == 0 && ltid_in_bounds_233940) {\n            ((__local\n              double *) red_arr_mem_233927)[sext_i32_i64(local_tid_233860)] =\n                x_216633;\n            ((__local\n              double *) red_arr_mem_233929)[sext_i32_i64(local_tid_233860)] =\n                x_216634;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233949 = 0; i_233949 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233949++) {\n        double tmp_233950;\n        \n        tmp_233950 = ((__local double *) red_arr_mem_233927)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233949 *\n                                                          ",
            "    computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233860)) *\n                                                             q_s_203575];\n        ((__local double *) color_232120)[i_233949 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233950;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233951 = 0; i_233951 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233951++) {\n        double tmp_233952;\n        \n        tmp_233952 = ((__local double *) red_arr_mem_233929)[q_s_203575 -\n                                                             (int64_t) 1 +\n                                                             (i_233951 *\n                                                              computed_group_sizze_216338 +\n                                                              sext_i32_i64(local_tid_233860)) *\n                                                             q_s_203575];\n        ((__local double *) color_232119)[i_233951 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860)] =\n            tmp_233952;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233953 = 0; i_233953 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233953++) {\n        double tmp_233954;\n        \n        tmp_233954 = ((__local double *) color_232120)[i_233953 *\n                                                       computed_group_sizze_216338 +\n             ",
            "                                          sext_i32_i64(local_tid_233860)];\n        ((__global double *) mem_230398)[gtid_216499 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216500 * s_n_m_203726 +\n                                         (i_233953 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860))] =\n            tmp_233954;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233955 = 0; i_233955 < sdiv_up64(s_n_m_203726 -\n                                                    sext_i32_i64(local_tid_233860),\n                                                    computed_group_sizze_216338);\n         i_233955++) {\n        double tmp_233956;\n        \n        tmp_233956 = ((__local double *) color_232119)[i_233955 *\n                                                       computed_group_sizze_216338 +\n                                                       sext_i32_i64(local_tid_233860)];\n        ((__global double *) mem_230403)[gtid_216499 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_216500 * s_n_m_203726 +\n                                         (i_233955 *\n                                          computed_group_sizze_216338 +\n                                          sext_i32_i64(local_tid_233860))] =\n            tmp_233956;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217273(__global int *global_failure,\n                                             uint red_arr_mem_234244_backing_offset_0,\n                                             uint red_arr_mem_234240_backing_offset_1,\n                                             uint color_232131_backing_offset_2,\n                                             int64_t n_p_203574,\n               ",
            "                              int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726, __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230544)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234244_backing_2 =\n                           &shared_mem[red_arr_mem_234244_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234240_backing_1 =\n                           &shared_mem[red_arr_mem_234240_backing_offset_1];\n    volatile unsigned char *color_232131_backing_0 =\n                           &shared_mem[color_232131_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234226;\n    int32_t local_tid_234227;\n    int64_t group_sizze_234230;\n    int32_t wave_sizze_234229;\n    int32_t group_tid_234228;\n    \n    global_tid_234226 = get_global_id(0);\n    local_tid_234227 = get_local_id(0);\n    group_sizze_234230 = get_local_size(0);\n    wave_sizze_234229 = LOCKSTEP_WIDTH;\n  ",
            "  group_tid_234228 = get_group_id(0);\n    \n    int32_t phys_tid_217273 = group_tid_234228;\n    int64_t slice_234232 = q_s_203575;\n    int64_t ltid_pre_234231 = sext_i32_i64(local_tid_234227);\n    int64_t remnant_234233 = sext_i32_i64(local_tid_234227) - ltid_pre_234231;\n    int64_t slice_234234 = s_n_m_203726;\n    int64_t slice_234235 = n_p_203574 * slice_234234;\n    int64_t slice_234236 = partition_sizze_203667 * slice_234235;\n    int64_t gtid_217270 = squot64(sext_i32_i64(group_tid_234228), slice_234235);\n    int64_t remnant_234237 = sext_i32_i64(group_tid_234228) - gtid_217270 *\n            slice_234235;\n    int64_t gtid_217271 = squot64(remnant_234237, slice_234234);\n    int64_t remnant_234238 = remnant_234237 - gtid_217271 * slice_234234;\n    int64_t gtid_217272 = remnant_234238;\n    int64_t remnant_234239 = remnant_234238 - gtid_217272;\n    __local unsigned char *color_232131;\n    \n    color_232131 = (__local unsigned char *) color_232131_backing_0;\n    \n    int64_t x_217280;\n    \n    x_217280 = ((__global int64_t *) ext_mem_229372)[gtid_217270 * n_p_203574 +\n                                                     gtid_217271];\n    \n    int64_t x_217282;\n    \n    x_217282 = ((__global int64_t *) ext_mem_229471)[gtid_217270 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_217271 *\n                                                     s_n_m_203726 +\n                                                     gtid_217272];\n    \n    double x_217283;\n    \n    x_217283 = ((__global double *) ext_mem_229470)[gtid_217270 *\n                                                    (s_n_m_203726 *\n                                                     n_p_203574) + gtid_217271 *\n                                                    s_n_m_203726 + gtid_217272];\n    \n    bool cond_217284 = gtid_217272 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res",
            "_217285;\n    \n    if (cond_217284) {\n        defunc_0_m_fun_res_217285 = (int64_t) 0;\n    } else {\n        int64_t y_217286 = sub64(s_n_m_203726, (int64_t) 1);\n        bool cond_217287 = gtid_217272 == y_217286;\n        int64_t defunc_0_m_fun_res_f_res_217288;\n        \n        if (cond_217287) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217289 =\n                    sub64(pad_css_len_203722, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217288 =\n                defunc_0_m_fun_res_f_res_t_res_217289;\n        } else {\n            int64_t x_217290 = sub64(gtid_217272, (int64_t) 1);\n            int64_t x_217291 = mul64(jump_s_203581, x_217290);\n            int64_t min_arg_217292 = add64((int64_t) 1, x_217291);\n            int64_t min_res_217293 = smin64(defunc_0_f_res_203721,\n                                            min_arg_217292);\n            \n            defunc_0_m_fun_res_f_res_217288 = min_res_217293;\n        }\n        defunc_0_m_fun_res_217285 = defunc_0_m_fun_res_f_res_217288;\n    }\n    \n    double defunc_2_reduce_res_217294;\n    int64_t gtid_217296 = sext_i32_i64(sext_i64_i32(ltid_pre_234231));\n    int32_t phys_tid_217297 = local_tid_234227;\n    __local unsigned char *red_arr_mem_234240;\n    \n    red_arr_mem_234240 = (__local unsigned char *) red_arr_mem_234240_backing_1;\n    \n    bool cond_217302 = sle64(x_217280, gtid_217296);\n    int64_t defunc_0_f_res_217303;\n    \n    if (cond_217302) {\n        defunc_0_f_res_217303 = (int64_t) 0;\n    } else {\n        int64_t i_217304 = add64(x_217282, gtid_217296);\n        int64_t defunc_0_add_arg_217305;\n        \n        defunc_0_add_arg_217305 = ((__global\n                                    int64_t *) ext_mem_229373)[gtid_217270 *\n                                                               (defunc_0_f_res_203721 *\n                                                                n_p_203574) +\n                                                               gtid_217271 *\n                       ",
            "                                        defunc_0_f_res_203721 +\n                                                               i_217304];\n        \n        int64_t defunc_1_add_res_217306 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217305);\n        \n        defunc_0_f_res_217303 = defunc_1_add_res_217306;\n    }\n    \n    double defunc_0_f_res_217307;\n    \n    if (cond_217302) {\n        defunc_0_f_res_217307 = 0.0;\n    } else {\n        int64_t i_217308 = add64(x_217282, gtid_217296);\n        double defunc_0_add_arg_217309;\n        \n        defunc_0_add_arg_217309 = ((__global double *) mem_229639)[gtid_217270 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217271 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217308];\n        defunc_0_f_res_217307 = defunc_0_add_arg_217309;\n    }\n    \n    int64_t binop_p_217310 = sub64(defunc_0_f_res_217303,\n                                   defunc_0_m_fun_res_217285);\n    double defunc_0_f_res_217311 = sitofp_i64_f64(binop_p_217310);\n    double abs_res_217312 = fabs(defunc_0_f_res_217311);\n    double tmp1_217313 = abs_res_217312 / x_217283;\n    double x_217314 = tmp1_217313 * tmp1_217313;\n    double y_217315 = tmp1_217313 * x_217314;\n    double tmp2_217316 = 1.0 - y_217315;\n    double x_217317 = tmp2_217316 * tmp2_217316;\n    double tmp3_217318 = tmp2_217316 * x_217317;\n    double tmp4_217319 = defunc_0_f_res_217307 * tmp3_217318;\n    \n    ((__local double *) red_arr_mem_234240)[gtid_217296] = tmp4_217319;\n    ((__local double *) color_232131)[gtid_217296] = tmp4_217319;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234242;\n    int32_t skip_waves_234243 = 1;\n    double x_",
            "217298;\n    double x_217299;\n    \n    offset_234242 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234227, sext_i64_i32(q_s_203575))) {\n            x_217298 = ((__local\n                         double *) red_arr_mem_234240)[sext_i32_i64(local_tid_234227 +\n                                                       offset_234242)];\n        }\n    }\n    offset_234242 = 1;\n    while (slt32(offset_234242, wave_sizze_234229)) {\n        if (slt32(local_tid_234227 + offset_234242, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234227 - squot32(local_tid_234227, wave_sizze_234229) *\n              wave_sizze_234229) & (2 * offset_234242 - 1)) == 0) {\n            // read array element\n            {\n                x_217299 = ((volatile __local\n                             double *) red_arr_mem_234240)[sext_i32_i64(local_tid_234227 +\n                                                           offset_234242)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217300 = x_217298 + x_217299;\n                \n                x_217298 = defunc_1_op_res_217300;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234240)[sext_i32_i64(local_tid_234227)] =\n                    x_217298;\n            }\n        }\n        offset_234242 *= 2;\n    }\n    while (slt32(skip_waves_234243, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234229 - 1,\n                                            wave_sizze_234229))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234242 = skip_waves_234243 * wave_sizze_234229;\n        if (slt32(local_tid_234227 + offset_234242, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234227 - squot32(local_tid_234227, wave_sizze_234229) *\n              wave_sizze_234229) == 0 && (squot32(local_tid_234227,\n                            ",
            "                      wave_sizze_234229) & (2 *\n                                                                        skip_waves_234243 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217299 = ((__local\n                             double *) red_arr_mem_234240)[sext_i32_i64(local_tid_234227 +\n                                                           offset_234242)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217300 = x_217298 + x_217299;\n                \n                x_217298 = defunc_1_op_res_217300;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234240)[sext_i32_i64(local_tid_234227)] =\n                    x_217298;\n            }\n        }\n        skip_waves_234243 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217294 = ((__local\n                                   double *) red_arr_mem_234240)[(int64_t) 0];\n    \n    double a0_217320 = 1.0 / defunc_2_reduce_res_217294;\n    double defunc_2_reduce_res_217321;\n    int64_t gtid_217322 = sext_i32_i64(sext_i64_i32(ltid_pre_234231));\n    int32_t phys_tid_217323 = local_tid_234227;\n    __local unsigned char *red_arr_mem_234244;\n    \n    red_arr_mem_234244 = (__local unsigned char *) red_arr_mem_234244_backing_2;\n    \n    double x_217328;\n    \n    x_217328 = ((__local double *) color_232131)[gtid_217322];\n    \n    bool cond_217329 = sle64(x_217280, gtid_217322);\n    double defunc_0_f_res_217330;\n    \n    if (cond_217329) {\n        defunc_0_f_res_217330 = 0.0;\n    } else {\n        int64_t i_217331 = add64(x_217282, gtid_217322);\n        double defunc_0_add_arg_217332;\n        \n        defunc_0_add_arg_217332 = ((__global double *) mem_229634)[gtid_217270 *\n                                                                   (defunc_",
            "0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217271 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217331];\n        defunc_0_f_res_217330 = defunc_0_add_arg_217332;\n    }\n    \n    double x_217333 = a0_217320 * x_217328;\n    double defunc_9_fit_fun_res_217334 = defunc_0_f_res_217330 * x_217333;\n    \n    ((__local double *) red_arr_mem_234244)[gtid_217322] =\n        defunc_9_fit_fun_res_217334;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234246;\n    int32_t skip_waves_234247 = 1;\n    double x_217324;\n    double x_217325;\n    \n    offset_234246 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234227, sext_i64_i32(q_s_203575))) {\n            x_217324 = ((__local\n                         double *) red_arr_mem_234244)[sext_i32_i64(local_tid_234227 +\n                                                       offset_234246)];\n        }\n    }\n    offset_234246 = 1;\n    while (slt32(offset_234246, wave_sizze_234229)) {\n        if (slt32(local_tid_234227 + offset_234246, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234227 - squot32(local_tid_234227, wave_sizze_234229) *\n              wave_sizze_234229) & (2 * offset_234246 - 1)) == 0) {\n            // read array element\n            {\n                x_217325 = ((volatile __local\n                             double *) red_arr_mem_234244)[sext_i32_i64(local_tid_234227 +\n                                                           offset_234246)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217326 = x_217324 + x_217325;\n                \n                x_217324 = defunc_1_op_res_217326;\n            }\n            // write result of operation\n            {\n                (",
            "(volatile __local\n                  double *) red_arr_mem_234244)[sext_i32_i64(local_tid_234227)] =\n                    x_217324;\n            }\n        }\n        offset_234246 *= 2;\n    }\n    while (slt32(skip_waves_234247, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234229 - 1,\n                                            wave_sizze_234229))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234246 = skip_waves_234247 * wave_sizze_234229;\n        if (slt32(local_tid_234227 + offset_234246, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234227 - squot32(local_tid_234227, wave_sizze_234229) *\n              wave_sizze_234229) == 0 && (squot32(local_tid_234227,\n                                                  wave_sizze_234229) & (2 *\n                                                                        skip_waves_234247 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217325 = ((__local\n                             double *) red_arr_mem_234244)[sext_i32_i64(local_tid_234227 +\n                                                           offset_234246)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217326 = x_217324 + x_217325;\n                \n                x_217324 = defunc_1_op_res_217326;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234244)[sext_i32_i64(local_tid_234227)] =\n                    x_217324;\n            }\n        }\n        skip_waves_234247 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217321 = ((__local\n                                   double *) red_arr_mem_234244)[(int64_t) 0];\n    if (local_tid_234227 == 0) {\n        ((__global double *) mem_230544)[gtid_217270 * (s_n_m_203726 *\n                        ",
            "                                n_p_203574) +\n                                         gtid_217271 * s_n_m_203726 +\n                                         gtid_217272] =\n            defunc_2_reduce_res_217321;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217594(__global int *global_failure,\n                                             uint red_arr_mem_234272_backing_offset_0,\n                                             uint red_arr_mem_234270_backing_offset_1,\n                                             uint red_arr_mem_234266_backing_offset_2,\n                                             uint red_arr_mem_234264_backing_offset_3,\n                                             uint red_arr_mem_234262_backing_offset_4,\n                                             uint color_232133_backing_offset_5,\n                                             uint color_232132_backing_offset_6,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726, __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                 ",
            "            __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230558,\n                                             __global unsigned char *mem_230563)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234272_backing_6 =\n                           &shared_mem[red_arr_mem_234272_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234270_backing_5 =\n                           &shared_mem[red_arr_mem_234270_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234266_backing_4 =\n                           &shared_mem[red_arr_mem_234266_backing_offset_2];\n    volatile unsigned char *red_arr_mem_234264_backing_3 =\n                           &shared_mem[red_arr_mem_234264_backing_offset_3];\n    volatile unsigned char *red_arr_mem_234262_backing_2 =\n                           &shared_mem[red_arr_mem_234262_backing_offset_4];\n    volatile unsigned char *color_232133_backing_1 =\n                           &shared_mem[color_232133_backing_offset_5];\n    volatile unsigned char *color_232132_backing_0 =\n                           &shared_mem[color_232132_backing_offset_6];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234248;\n    int32_t local_tid_234249;\n    int64_t group_sizze_234252;\n    int32_t wave_sizze_234251;\n    int32_t group_tid_234250;\n    \n    global_tid_234248 = get_global_id(0);\n    local_tid_234249 = get_local_id(0);\n    group_sizze_234252 = get_local_size(0);\n    wave_sizze_234251 = LOCKSTEP_WIDTH;\n    group_tid_234250 = get_group_id(0);\n    \n    int32_t phys_tid_217594 = group_tid_234250;\n    int64_t slice_234254 = q_s_203575;\n    int64_t ltid_pre_234253 = sext_i32_i64(local_tid_234249);\n    int64_t remnant_234255 = sext_i32_i64(local_tid_234249) - ltid_pre_234253;\n    int64_t slice_234256 = s_n_m_203726;\n    int64_t slice_234257 = n_p_203574 * slice_234256;\n    int64_t slice_234",
            "258 = partition_sizze_203667 * slice_234257;\n    int64_t gtid_217591 = squot64(sext_i32_i64(group_tid_234250), slice_234257);\n    int64_t remnant_234259 = sext_i32_i64(group_tid_234250) - gtid_217591 *\n            slice_234257;\n    int64_t gtid_217592 = squot64(remnant_234259, slice_234256);\n    int64_t remnant_234260 = remnant_234259 - gtid_217592 * slice_234256;\n    int64_t gtid_217593 = remnant_234260;\n    int64_t remnant_234261 = remnant_234260 - gtid_217593;\n    __local unsigned char *color_232132;\n    \n    color_232132 = (__local unsigned char *) color_232132_backing_0;\n    \n    __local unsigned char *color_232133;\n    \n    color_232133 = (__local unsigned char *) color_232133_backing_1;\n    \n    int64_t x_217601;\n    \n    x_217601 = ((__global int64_t *) ext_mem_229372)[gtid_217591 * n_p_203574 +\n                                                     gtid_217592];\n    \n    int64_t x_217603;\n    \n    x_217603 = ((__global int64_t *) ext_mem_229471)[gtid_217591 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_217592 *\n                                                     s_n_m_203726 +\n                                                     gtid_217593];\n    \n    double x_217604;\n    \n    x_217604 = ((__global double *) ext_mem_229470)[gtid_217591 *\n                                                    (s_n_m_203726 *\n                                                     n_p_203574) + gtid_217592 *\n                                                    s_n_m_203726 + gtid_217593];\n    \n    bool cond_217605 = gtid_217593 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217606;\n    \n    if (cond_217605) {\n        defunc_0_m_fun_res_217606 = (int64_t) 0;\n    } else {\n        int64_t y_217607 = sub64(s_n_m_203726, (int64_t) 1);\n        bool cond_217608 = gtid_217593 == y_217607;\n        int64_t defunc_0_m_fun_res_f_res_217609;\n      ",
            "  \n        if (cond_217608) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217610 =\n                    sub64(pad_css_len_203722, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217609 =\n                defunc_0_m_fun_res_f_res_t_res_217610;\n        } else {\n            int64_t x_217611 = sub64(gtid_217593, (int64_t) 1);\n            int64_t x_217612 = mul64(jump_s_203581, x_217611);\n            int64_t min_arg_217613 = add64((int64_t) 1, x_217612);\n            int64_t min_res_217614 = smin64(defunc_0_f_res_203721,\n                                            min_arg_217613);\n            \n            defunc_0_m_fun_res_f_res_217609 = min_res_217614;\n        }\n        defunc_0_m_fun_res_217606 = defunc_0_m_fun_res_f_res_217609;\n    }\n    \n    double defunc_2_reduce_res_217615;\n    double defunc_2_reduce_res_217616;\n    double defunc_2_reduce_res_217617;\n    int64_t gtid_217620 = sext_i32_i64(sext_i64_i32(ltid_pre_234253));\n    int32_t phys_tid_217621 = local_tid_234249;\n    __local unsigned char *red_arr_mem_234262;\n    \n    red_arr_mem_234262 = (__local unsigned char *) red_arr_mem_234262_backing_2;\n    \n    __local unsigned char *red_arr_mem_234264;\n    \n    red_arr_mem_234264 = (__local unsigned char *) red_arr_mem_234264_backing_3;\n    \n    __local unsigned char *red_arr_mem_234266;\n    \n    red_arr_mem_234266 = (__local unsigned char *) red_arr_mem_234266_backing_4;\n    \n    bool cond_217632 = sle64(x_217601, gtid_217620);\n    int64_t defunc_0_f_res_217633;\n    \n    if (cond_217632) {\n        defunc_0_f_res_217633 = (int64_t) 0;\n    } else {\n        int64_t i_217634 = add64(x_217603, gtid_217620);\n        int64_t defunc_0_add_arg_217635;\n        \n        defunc_0_add_arg_217635 = ((__global\n                                    int64_t *) ext_mem_229373)[gtid_217591 *\n                                                               (defunc_0_f_res_203721 *\n                                                                n_p_203574) +\n             ",
            "                                                  gtid_217592 *\n                                                               defunc_0_f_res_203721 +\n                                                               i_217634];\n        \n        int64_t defunc_1_add_res_217636 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217635);\n        \n        defunc_0_f_res_217633 = defunc_1_add_res_217636;\n    }\n    \n    double defunc_0_f_res_217637;\n    \n    if (cond_217632) {\n        defunc_0_f_res_217637 = 0.0;\n    } else {\n        int64_t i_217638 = add64(x_217603, gtid_217620);\n        double defunc_0_add_arg_217639;\n        \n        defunc_0_add_arg_217639 = ((__global double *) mem_229639)[gtid_217591 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217592 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_217638];\n        defunc_0_f_res_217637 = defunc_0_add_arg_217639;\n    }\n    \n    int64_t binop_p_217640 = sub64(defunc_0_f_res_217633,\n                                   defunc_0_m_fun_res_217606);\n    double defunc_0_f_res_217641 = sitofp_i64_f64(binop_p_217640);\n    double abs_res_217642 = fabs(defunc_0_f_res_217641);\n    double tmp1_217643 = abs_res_217642 / x_217604;\n    double x_217644 = tmp1_217643 * tmp1_217643;\n    double y_217645 = tmp1_217643 * x_217644;\n    double tmp2_217646 = 1.0 - y_217645;\n    double x_217647 = tmp2_217646 * tmp2_217646;\n    double tmp3_217648 = tmp2_217646 * x_217647;\n    double tmp4_217649 = defunc_0_f_res_217637 * tmp3_217648;\n    double defunc_1_f_res_217650 = defunc_0_f_res_217641 * tmp4_217649;\n    double defunc_1_f_res_217651 = defunc_0_f_res_217641 *\n           defunc_1_f_res_217650;\n    \n",
            "    ((__local double *) red_arr_mem_234262)[gtid_217620] = tmp4_217649;\n    ((__local double *) red_arr_mem_234264)[gtid_217620] =\n        defunc_1_f_res_217650;\n    ((__local double *) red_arr_mem_234266)[gtid_217620] =\n        defunc_1_f_res_217651;\n    ((__local double *) color_232133)[gtid_217620] = defunc_1_f_res_217650;\n    ((__local double *) color_232132)[gtid_217620] = tmp4_217649;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234268;\n    int32_t skip_waves_234269 = 1;\n    double x_217622;\n    double x_217623;\n    double x_217624;\n    double x_217625;\n    double x_217626;\n    double x_217627;\n    \n    offset_234268 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234249, sext_i64_i32(q_s_203575))) {\n            x_217622 = ((__local\n                         double *) red_arr_mem_234262)[sext_i32_i64(local_tid_234249 +\n                                                       offset_234268)];\n            x_217623 = ((__local\n                         double *) red_arr_mem_234264)[sext_i32_i64(local_tid_234249 +\n                                                       offset_234268)];\n            x_217624 = ((__local\n                         double *) red_arr_mem_234266)[sext_i32_i64(local_tid_234249 +\n                                                       offset_234268)];\n        }\n    }\n    offset_234268 = 1;\n    while (slt32(offset_234268, wave_sizze_234251)) {\n        if (slt32(local_tid_234249 + offset_234268, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234249 - squot32(local_tid_234249, wave_sizze_234251) *\n              wave_sizze_234251) & (2 * offset_234268 - 1)) == 0) {\n            // read array element\n            {\n                x_217625 = ((volatile __local\n                             double *) red_arr_mem_234262)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234268)];\n                x_217626 = ((volatile __local\n                     ",
            "        double *) red_arr_mem_234264)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234268)];\n                x_217627 = ((volatile __local\n                             double *) red_arr_mem_234266)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234268)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217628 = x_217622 + x_217625;\n                double defunc_1_op_res_217629 = x_217623 + x_217626;\n                double defunc_1_op_res_217630 = x_217624 + x_217627;\n                \n                x_217622 = defunc_1_op_res_217628;\n                x_217623 = defunc_1_op_res_217629;\n                x_217624 = defunc_1_op_res_217630;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234262)[sext_i32_i64(local_tid_234249)] =\n                    x_217622;\n                ((volatile __local\n                  double *) red_arr_mem_234264)[sext_i32_i64(local_tid_234249)] =\n                    x_217623;\n                ((volatile __local\n                  double *) red_arr_mem_234266)[sext_i32_i64(local_tid_234249)] =\n                    x_217624;\n            }\n        }\n        offset_234268 *= 2;\n    }\n    while (slt32(skip_waves_234269, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234251 - 1,\n                                            wave_sizze_234251))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234268 = skip_waves_234269 * wave_sizze_234251;\n        if (slt32(local_tid_234249 + offset_234268, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234249 - squot32(local_tid_234249, wave_sizze_234251) *\n              wave_sizze_234251) == 0 && (squot32(local_tid_234249,\n                                                  wave_sizze_234251) & (2 *\n                ",
            "                                                        skip_waves_234269 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217625 = ((__local\n                             double *) red_arr_mem_234262)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234268)];\n                x_217626 = ((__local\n                             double *) red_arr_mem_234264)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234268)];\n                x_217627 = ((__local\n                             double *) red_arr_mem_234266)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234268)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217628 = x_217622 + x_217625;\n                double defunc_1_op_res_217629 = x_217623 + x_217626;\n                double defunc_1_op_res_217630 = x_217624 + x_217627;\n                \n                x_217622 = defunc_1_op_res_217628;\n                x_217623 = defunc_1_op_res_217629;\n                x_217624 = defunc_1_op_res_217630;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234262)[sext_i32_i64(local_tid_234249)] =\n                    x_217622;\n                ((__local\n                  double *) red_arr_mem_234264)[sext_i32_i64(local_tid_234249)] =\n                    x_217623;\n                ((__local\n                  double *) red_arr_mem_234266)[sext_i32_i64(local_tid_234249)] =\n                    x_217624;\n            }\n        }\n        skip_waves_234269 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217615 = ((__local\n                                   double *) red_arr_mem_234262)[(int64_t) 0];\n    defunc_2_reduce",
            "_res_217616 = ((__local\n                                   double *) red_arr_mem_234264)[(int64_t) 0];\n    defunc_2_reduce_res_217617 = ((__local\n                                   double *) red_arr_mem_234266)[(int64_t) 0];\n    \n    double x_217652 = defunc_2_reduce_res_217615 * defunc_2_reduce_res_217617;\n    double y_217653 = defunc_2_reduce_res_217616 * defunc_2_reduce_res_217616;\n    double y_217654 = x_217652 - y_217653;\n    double det1_217655 = 1.0 / y_217654;\n    double a11_217656 = defunc_2_reduce_res_217617 * det1_217655;\n    double x_217657 = 0.0 - defunc_2_reduce_res_217616;\n    double b11_217658 = det1_217655 * x_217657;\n    double c11_217659 = defunc_2_reduce_res_217615 * det1_217655;\n    double defunc_2_reduce_res_217660;\n    double defunc_2_reduce_res_217661;\n    int64_t gtid_217662 = sext_i32_i64(sext_i64_i32(ltid_pre_234253));\n    int32_t phys_tid_217663 = local_tid_234249;\n    __local unsigned char *red_arr_mem_234270;\n    \n    red_arr_mem_234270 = (__local unsigned char *) red_arr_mem_234270_backing_5;\n    \n    __local unsigned char *red_arr_mem_234272;\n    \n    red_arr_mem_234272 = (__local unsigned char *) red_arr_mem_234272_backing_6;\n    \n    double x_217671;\n    \n    x_217671 = ((__local double *) color_232132)[gtid_217662];\n    \n    double x_217672;\n    \n    x_217672 = ((__local double *) color_232133)[gtid_217662];\n    \n    bool cond_217673 = sle64(x_217601, gtid_217662);\n    double defunc_0_f_res_217674;\n    \n    if (cond_217673) {\n        defunc_0_f_res_217674 = 0.0;\n    } else {\n        int64_t i_217675 = add64(x_217603, gtid_217662);\n        double defunc_0_add_arg_217676;\n        \n        defunc_0_add_arg_217676 = ((__global double *) mem_229634)[gtid_217591 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_217592 *\n                        ",
            "                                           defunc_0_f_res_203721 +\n                                                                   i_217675];\n        defunc_0_f_res_217674 = defunc_0_add_arg_217676;\n    }\n    \n    double x_217677 = a11_217656 * x_217671;\n    double y_217678 = b11_217658 * x_217672;\n    double x_217679 = x_217677 + y_217678;\n    double defunc_9_fit_fun_res_217680 = defunc_0_f_res_217674 * x_217679;\n    double x_217681 = b11_217658 * x_217671;\n    double y_217682 = c11_217659 * x_217672;\n    double x_217683 = x_217681 + y_217682;\n    double defunc_9_slope_fun_res_217684 = defunc_0_f_res_217674 * x_217683;\n    \n    ((__local double *) red_arr_mem_234270)[gtid_217662] =\n        defunc_9_fit_fun_res_217680;\n    ((__local double *) red_arr_mem_234272)[gtid_217662] =\n        defunc_9_slope_fun_res_217684;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234274;\n    int32_t skip_waves_234275 = 1;\n    double x_217664;\n    double x_217665;\n    double x_217666;\n    double x_217667;\n    \n    offset_234274 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234249, sext_i64_i32(q_s_203575))) {\n            x_217664 = ((__local\n                         double *) red_arr_mem_234270)[sext_i32_i64(local_tid_234249 +\n                                                       offset_234274)];\n            x_217665 = ((__local\n                         double *) red_arr_mem_234272)[sext_i32_i64(local_tid_234249 +\n                                                       offset_234274)];\n        }\n    }\n    offset_234274 = 1;\n    while (slt32(offset_234274, wave_sizze_234251)) {\n        if (slt32(local_tid_234249 + offset_234274, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234249 - squot32(local_tid_234249, wave_sizze_234251) *\n              wave_sizze_234251) & (2 * offset_234274 - 1)) == 0) {\n            // read array element\n            {\n                x_217666 = ((volatile __local\n                             dou",
            "ble *) red_arr_mem_234270)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234274)];\n                x_217667 = ((volatile __local\n                             double *) red_arr_mem_234272)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234274)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217668 = x_217664 + x_217666;\n                double defunc_1_op_res_217669 = x_217665 + x_217667;\n                \n                x_217664 = defunc_1_op_res_217668;\n                x_217665 = defunc_1_op_res_217669;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234270)[sext_i32_i64(local_tid_234249)] =\n                    x_217664;\n                ((volatile __local\n                  double *) red_arr_mem_234272)[sext_i32_i64(local_tid_234249)] =\n                    x_217665;\n            }\n        }\n        offset_234274 *= 2;\n    }\n    while (slt32(skip_waves_234275, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234251 - 1,\n                                            wave_sizze_234251))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234274 = skip_waves_234275 * wave_sizze_234251;\n        if (slt32(local_tid_234249 + offset_234274, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234249 - squot32(local_tid_234249, wave_sizze_234251) *\n              wave_sizze_234251) == 0 && (squot32(local_tid_234249,\n                                                  wave_sizze_234251) & (2 *\n                                                                        skip_waves_234275 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217666 = ((__local\n                   ",
            "          double *) red_arr_mem_234270)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234274)];\n                x_217667 = ((__local\n                             double *) red_arr_mem_234272)[sext_i32_i64(local_tid_234249 +\n                                                           offset_234274)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217668 = x_217664 + x_217666;\n                double defunc_1_op_res_217669 = x_217665 + x_217667;\n                \n                x_217664 = defunc_1_op_res_217668;\n                x_217665 = defunc_1_op_res_217669;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234270)[sext_i32_i64(local_tid_234249)] =\n                    x_217664;\n                ((__local\n                  double *) red_arr_mem_234272)[sext_i32_i64(local_tid_234249)] =\n                    x_217665;\n            }\n        }\n        skip_waves_234275 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217660 = ((__local\n                                   double *) red_arr_mem_234270)[(int64_t) 0];\n    defunc_2_reduce_res_217661 = ((__local\n                                   double *) red_arr_mem_234272)[(int64_t) 0];\n    if (local_tid_234249 == 0) {\n        ((__global double *) mem_230558)[gtid_217591 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_217592 * s_n_m_203726 +\n                                         gtid_217593] =\n            defunc_2_reduce_res_217660;\n    }\n    if (local_tid_234249 == 0) {\n        ((__global double *) mem_230563)[gtid_217591 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_217592 * s_n_m_203726 +\n                                         gtid_2",
            "17593] =\n            defunc_2_reduce_res_217661;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_218045(__global int *global_failure,\n                                             uint red_arr_mem_234304_backing_offset_0,\n                                             uint red_arr_mem_234302_backing_offset_1,\n                                             uint red_arr_mem_234298_backing_offset_2,\n                                             uint red_arr_mem_234296_backing_offset_3,\n                                             uint red_arr_mem_234294_backing_offset_4,\n                                             uint red_arr_mem_234292_backing_offset_5,\n                                             uint red_arr_mem_234290_backing_offset_6,\n                                             uint color_232137_backing_offset_7,\n                                             uint color_232136_backing_offset_8,\n                                             uint color_232135_backing_offset_9,\n                                             uint color_232134_backing_offset_10,\n                                             int64_t n_p_203574,\n                                             int64_t q_s_203575,\n                                             int64_t jump_s_203581,\n                                             int64_t partition_sizze_203667,\n                                             int64_t defunc_0_f_res_203721,\n                                             int64_t pad_css_len_203722,\n                                             int64_t s_n_m_203726, __global\n                                             unsigned char *ext_mem_229372,\n                                             __global\n                                             unsigned char *ext_mem_229373,\n                                             __global\n                                             unsigned char *ext_mem_229470,\n                                             __global\n                ",
            "                             unsigned char *ext_mem_229471,\n                                             __global unsigned char *mem_229634,\n                                             __global unsigned char *mem_229639,\n                                             __global unsigned char *mem_230584,\n                                             __global unsigned char *mem_230589)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234304_backing_10 =\n                           &shared_mem[red_arr_mem_234304_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234302_backing_9 =\n                           &shared_mem[red_arr_mem_234302_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234298_backing_8 =\n                           &shared_mem[red_arr_mem_234298_backing_offset_2];\n    volatile unsigned char *red_arr_mem_234296_backing_7 =\n                           &shared_mem[red_arr_mem_234296_backing_offset_3];\n    volatile unsigned char *red_arr_mem_234294_backing_6 =\n                           &shared_mem[red_arr_mem_234294_backing_offset_4];\n    volatile unsigned char *red_arr_mem_234292_backing_5 =\n                           &shared_mem[red_arr_mem_234292_backing_offset_5];\n    volatile unsigned char *red_arr_mem_234290_backing_4 =\n                           &shared_mem[red_arr_mem_234290_backing_offset_6];\n    volatile unsigned char *color_232137_backing_3 =\n                           &shared_mem[color_232137_backing_offset_7];\n    volatile unsigned char *color_232136_backing_2 =\n                           &shared_mem[color_232136_backing_offset_8];\n    volatile unsigned char *color_232135_backing_1 =\n                           &shared_mem[color_232135_backing_offset_9];\n    volatile unsigned char *color_232134_backing_0 =\n                           &shared_mem[color_232134_backing_offset_10];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global",
            "_tid_234276;\n    int32_t local_tid_234277;\n    int64_t group_sizze_234280;\n    int32_t wave_sizze_234279;\n    int32_t group_tid_234278;\n    \n    global_tid_234276 = get_global_id(0);\n    local_tid_234277 = get_local_id(0);\n    group_sizze_234280 = get_local_size(0);\n    wave_sizze_234279 = LOCKSTEP_WIDTH;\n    group_tid_234278 = get_group_id(0);\n    \n    int32_t phys_tid_218045 = group_tid_234278;\n    int64_t slice_234282 = q_s_203575;\n    int64_t ltid_pre_234281 = sext_i32_i64(local_tid_234277);\n    int64_t remnant_234283 = sext_i32_i64(local_tid_234277) - ltid_pre_234281;\n    int64_t slice_234284 = s_n_m_203726;\n    int64_t slice_234285 = n_p_203574 * slice_234284;\n    int64_t slice_234286 = partition_sizze_203667 * slice_234285;\n    int64_t gtid_218042 = squot64(sext_i32_i64(group_tid_234278), slice_234285);\n    int64_t remnant_234287 = sext_i32_i64(group_tid_234278) - gtid_218042 *\n            slice_234285;\n    int64_t gtid_218043 = squot64(remnant_234287, slice_234284);\n    int64_t remnant_234288 = remnant_234287 - gtid_218043 * slice_234284;\n    int64_t gtid_218044 = remnant_234288;\n    int64_t remnant_234289 = remnant_234288 - gtid_218044;\n    __local unsigned char *color_232134;\n    \n    color_232134 = (__local unsigned char *) color_232134_backing_0;\n    \n    __local unsigned char *color_232135;\n    \n    color_232135 = (__local unsigned char *) color_232135_backing_1;\n    \n    __local unsigned char *color_232136;\n    \n    color_232136 = (__local unsigned char *) color_232136_backing_2;\n    \n    __local unsigned char *color_232137;\n    \n    color_232137 = (__local unsigned char *) color_232137_backing_3;\n    \n    int64_t x_218052;\n    \n    x_218052 = ((__global int64_t *) ext_mem_229372)[gtid_218042 * n_p_203574 +\n                                                     gtid_218043];\n    \n    int64_t x_218054;\n    \n    x_218054 = ((__global int64_t *) ext_mem_229471)[gtid_218042 *\n                                                     (s_n_m_203726 *\n              ",
            "                                        n_p_203574) +\n                                                     gtid_218043 *\n                                                     s_n_m_203726 +\n                                                     gtid_218044];\n    \n    double x_218055;\n    \n    x_218055 = ((__global double *) ext_mem_229470)[gtid_218042 *\n                                                    (s_n_m_203726 *\n                                                     n_p_203574) + gtid_218043 *\n                                                    s_n_m_203726 + gtid_218044];\n    \n    bool cond_218056 = gtid_218044 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_218057;\n    \n    if (cond_218056) {\n        defunc_0_m_fun_res_218057 = (int64_t) 0;\n    } else {\n        int64_t y_218058 = sub64(s_n_m_203726, (int64_t) 1);\n        bool cond_218059 = gtid_218044 == y_218058;\n        int64_t defunc_0_m_fun_res_f_res_218060;\n        \n        if (cond_218059) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_218061 =\n                    sub64(pad_css_len_203722, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_218060 =\n                defunc_0_m_fun_res_f_res_t_res_218061;\n        } else {\n            int64_t x_218062 = sub64(gtid_218044, (int64_t) 1);\n            int64_t x_218063 = mul64(jump_s_203581, x_218062);\n            int64_t min_arg_218064 = add64((int64_t) 1, x_218063);\n            int64_t min_res_218065 = smin64(defunc_0_f_res_203721,\n                                            min_arg_218064);\n            \n            defunc_0_m_fun_res_f_res_218060 = min_res_218065;\n        }\n        defunc_0_m_fun_res_218057 = defunc_0_m_fun_res_f_res_218060;\n    }\n    \n    int64_t gtid_218068 = sext_i32_i64(sext_i64_i32(ltid_pre_234281));\n    int32_t phys_tid_218069 = local_tid_234277;\n    bool cond_218071 = sle64(x_218052, gtid_218068);\n    int64_t defunc_0_f_res_218072;\n    \n    if (cond_218071) {\n        defunc_0_f_res_218072 = (int64_t) 0;\n    } else {\n   ",
            "     int64_t i_218073 = add64(x_218054, gtid_218068);\n        int64_t defunc_0_add_arg_218074;\n        \n        defunc_0_add_arg_218074 = ((__global\n                                    int64_t *) ext_mem_229373)[gtid_218042 *\n                                                               (defunc_0_f_res_203721 *\n                                                                n_p_203574) +\n                                                               gtid_218043 *\n                                                               defunc_0_f_res_203721 +\n                                                               i_218073];\n        \n        int64_t defunc_1_add_res_218075 = add64((int64_t) 1,\n                                                defunc_0_add_arg_218074);\n        \n        defunc_0_f_res_218072 = defunc_1_add_res_218075;\n    }\n    \n    double defunc_0_f_res_218076;\n    \n    if (cond_218071) {\n        defunc_0_f_res_218076 = 0.0;\n    } else {\n        int64_t i_218077 = add64(x_218054, gtid_218068);\n        double defunc_0_add_arg_218078;\n        \n        defunc_0_add_arg_218078 = ((__global double *) mem_229639)[gtid_218042 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_218043 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_218077];\n        defunc_0_f_res_218076 = defunc_0_add_arg_218078;\n    }\n    \n    int64_t binop_p_218079 = sub64(defunc_0_f_res_218072,\n                                   defunc_0_m_fun_res_218057);\n    double defunc_0_f_res_218080 = sitofp_i64_f64(binop_p_218079);\n    double abs_res_218081 = fabs(defunc_0_f_res_218080);\n    double tmp1_218082 = abs_res_218081 / x_218055;\n    double x_218083 = tmp1_218082 * tmp1_218082;\n    double y",
            "_218084 = tmp1_218082 * x_218083;\n    double tmp2_218085 = 1.0 - y_218084;\n    double x_218086 = tmp2_218085 * tmp2_218085;\n    double tmp3_218087 = tmp2_218085 * x_218086;\n    double tmp4_218088 = defunc_0_f_res_218076 * tmp3_218087;\n    \n    ((__local double *) color_232137)[gtid_218068] = defunc_0_f_res_218080;\n    ((__local double *) color_232136)[gtid_218068] = tmp4_218088;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_218089;\n    double defunc_2_reduce_res_218090;\n    double defunc_2_reduce_res_218091;\n    double defunc_2_reduce_res_218092;\n    double defunc_2_reduce_res_218093;\n    int64_t gtid_218096 = sext_i32_i64(sext_i64_i32(ltid_pre_234281));\n    int32_t phys_tid_218097 = local_tid_234277;\n    __local unsigned char *red_arr_mem_234290;\n    \n    red_arr_mem_234290 = (__local unsigned char *) red_arr_mem_234290_backing_4;\n    \n    __local unsigned char *red_arr_mem_234292;\n    \n    red_arr_mem_234292 = (__local unsigned char *) red_arr_mem_234292_backing_5;\n    \n    __local unsigned char *red_arr_mem_234294;\n    \n    red_arr_mem_234294 = (__local unsigned char *) red_arr_mem_234294_backing_6;\n    \n    __local unsigned char *red_arr_mem_234296;\n    \n    red_arr_mem_234296 = (__local unsigned char *) red_arr_mem_234296_backing_7;\n    \n    __local unsigned char *red_arr_mem_234298;\n    \n    red_arr_mem_234298 = (__local unsigned char *) red_arr_mem_234298_backing_8;\n    \n    double x_218113;\n    \n    x_218113 = ((__local double *) color_232137)[gtid_218096];\n    \n    double x_218114;\n    \n    x_218114 = ((__local double *) color_232136)[gtid_218096];\n    \n    double defunc_1_f_res_218115 = x_218113 * x_218114;\n    double defunc_1_f_res_218116 = x_218113 * defunc_1_f_res_218115;\n    double defunc_1_f_res_218117 = x_218113 * defunc_1_f_res_218116;\n    double defunc_1_f_res_218118 = x_218113 * defunc_1_f_res_218117;\n    \n    ((__local double *) red_arr_mem_234290)[gtid_218096] = x_218114;\n    ((__local double *) red_arr_mem_234292)[gtid_2",
            "18096] =\n        defunc_1_f_res_218115;\n    ((__local double *) red_arr_mem_234294)[gtid_218096] =\n        defunc_1_f_res_218116;\n    ((__local double *) red_arr_mem_234296)[gtid_218096] =\n        defunc_1_f_res_218117;\n    ((__local double *) red_arr_mem_234298)[gtid_218096] =\n        defunc_1_f_res_218118;\n    ((__local double *) color_232135)[gtid_218096] = defunc_1_f_res_218116;\n    ((__local double *) color_232134)[gtid_218096] = defunc_1_f_res_218115;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234300;\n    int32_t skip_waves_234301 = 1;\n    double x_218098;\n    double x_218099;\n    double x_218100;\n    double x_218101;\n    double x_218102;\n    double x_218103;\n    double x_218104;\n    double x_218105;\n    double x_218106;\n    double x_218107;\n    \n    offset_234300 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234277, sext_i64_i32(q_s_203575))) {\n            x_218098 = ((__local\n                         double *) red_arr_mem_234290)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234300)];\n            x_218099 = ((__local\n                         double *) red_arr_mem_234292)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234300)];\n            x_218100 = ((__local\n                         double *) red_arr_mem_234294)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234300)];\n            x_218101 = ((__local\n                         double *) red_arr_mem_234296)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234300)];\n            x_218102 = ((__local\n                         double *) red_arr_mem_234298)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234300)];\n        }\n    }\n    offset_234300 = 1;\n    while (slt32(offset_234300, wave_sizze_234279)) {\n        if (slt32(loc",
            "al_tid_234277 + offset_234300, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234277 - squot32(local_tid_234277, wave_sizze_234279) *\n              wave_sizze_234279) & (2 * offset_234300 - 1)) == 0) {\n            // read array element\n            {\n                x_218103 = ((volatile __local\n                             double *) red_arr_mem_234290)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218104 = ((volatile __local\n                             double *) red_arr_mem_234292)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218105 = ((volatile __local\n                             double *) red_arr_mem_234294)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218106 = ((volatile __local\n                             double *) red_arr_mem_234296)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218107 = ((volatile __local\n                             double *) red_arr_mem_234298)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218108 = x_218098 + x_218103;\n                double defunc_1_op_res_218109 = x_218099 + x_218104;\n                double defunc_1_op_res_218110 = x_218100 + x_218105;\n                double defunc_1_op_res_218111 = x_218101 + x_218106;\n                double defunc_1_op_res_218112 = x_218102 + x_218107;\n                \n                x_218098 = defunc_1_op_res_218108;\n                x_218099 = defunc_1_op_res_218109;\n                x_218100 = defunc_1_op_res_218110;\n                x_218101 = defunc_1_op_res_218111;\n                x_218102 = defunc_1_op_res_2",
            "18112;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234290)[sext_i32_i64(local_tid_234277)] =\n                    x_218098;\n                ((volatile __local\n                  double *) red_arr_mem_234292)[sext_i32_i64(local_tid_234277)] =\n                    x_218099;\n                ((volatile __local\n                  double *) red_arr_mem_234294)[sext_i32_i64(local_tid_234277)] =\n                    x_218100;\n                ((volatile __local\n                  double *) red_arr_mem_234296)[sext_i32_i64(local_tid_234277)] =\n                    x_218101;\n                ((volatile __local\n                  double *) red_arr_mem_234298)[sext_i32_i64(local_tid_234277)] =\n                    x_218102;\n            }\n        }\n        offset_234300 *= 2;\n    }\n    while (slt32(skip_waves_234301, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234279 - 1,\n                                            wave_sizze_234279))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234300 = skip_waves_234301 * wave_sizze_234279;\n        if (slt32(local_tid_234277 + offset_234300, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234277 - squot32(local_tid_234277, wave_sizze_234279) *\n              wave_sizze_234279) == 0 && (squot32(local_tid_234277,\n                                                  wave_sizze_234279) & (2 *\n                                                                        skip_waves_234301 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218103 = ((__local\n                             double *) red_arr_mem_234290)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218104 = ((__local\n                             double *) re",
            "d_arr_mem_234292)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218105 = ((__local\n                             double *) red_arr_mem_234294)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218106 = ((__local\n                             double *) red_arr_mem_234296)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n                x_218107 = ((__local\n                             double *) red_arr_mem_234298)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234300)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218108 = x_218098 + x_218103;\n                double defunc_1_op_res_218109 = x_218099 + x_218104;\n                double defunc_1_op_res_218110 = x_218100 + x_218105;\n                double defunc_1_op_res_218111 = x_218101 + x_218106;\n                double defunc_1_op_res_218112 = x_218102 + x_218107;\n                \n                x_218098 = defunc_1_op_res_218108;\n                x_218099 = defunc_1_op_res_218109;\n                x_218100 = defunc_1_op_res_218110;\n                x_218101 = defunc_1_op_res_218111;\n                x_218102 = defunc_1_op_res_218112;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234290)[sext_i32_i64(local_tid_234277)] =\n                    x_218098;\n                ((__local\n                  double *) red_arr_mem_234292)[sext_i32_i64(local_tid_234277)] =\n                    x_218099;\n                ((__local\n                  double *) red_arr_mem_234294)[sext_i32_i64(local_tid_234277)] =\n                    x_218100;\n                ((__local\n                  double *) red_arr_mem_234296)[sext_i32_i64(local_",
            "tid_234277)] =\n                    x_218101;\n                ((__local\n                  double *) red_arr_mem_234298)[sext_i32_i64(local_tid_234277)] =\n                    x_218102;\n            }\n        }\n        skip_waves_234301 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_218089 = ((__local\n                                   double *) red_arr_mem_234290)[(int64_t) 0];\n    defunc_2_reduce_res_218090 = ((__local\n                                   double *) red_arr_mem_234292)[(int64_t) 0];\n    defunc_2_reduce_res_218091 = ((__local\n                                   double *) red_arr_mem_234294)[(int64_t) 0];\n    defunc_2_reduce_res_218092 = ((__local\n                                   double *) red_arr_mem_234296)[(int64_t) 0];\n    defunc_2_reduce_res_218093 = ((__local\n                                   double *) red_arr_mem_234298)[(int64_t) 0];\n    \n    double x_218119 = defunc_2_reduce_res_218091 * defunc_2_reduce_res_218093;\n    double y_218120 = defunc_2_reduce_res_218092 * defunc_2_reduce_res_218092;\n    double a12_218121 = x_218119 - y_218120;\n    double x_218122 = defunc_2_reduce_res_218091 * defunc_2_reduce_res_218092;\n    double y_218123 = defunc_2_reduce_res_218090 * defunc_2_reduce_res_218093;\n    double b12_218124 = x_218122 - y_218123;\n    double x_218125 = defunc_2_reduce_res_218090 * defunc_2_reduce_res_218092;\n    double y_218126 = defunc_2_reduce_res_218091 * defunc_2_reduce_res_218091;\n    double c12_218127 = x_218125 - y_218126;\n    double x_218128 = defunc_2_reduce_res_218089 * defunc_2_reduce_res_218093;\n    double b2_218129 = x_218128 - y_218126;\n    double x_218130 = defunc_2_reduce_res_218090 * defunc_2_reduce_res_218091;\n    double y_218131 = defunc_2_reduce_res_218089 * defunc_2_reduce_res_218092;\n    double c2_218132 = x_218130 - y_218131;\n    double x_218133 = defunc_2_reduce_res_218089 * a12_218121;\n    double y_218134 = defunc_2_reduce_res_218090 * b12_218124;\n    double x_218135 = x_218133 + y_218134;\n   ",
            " double y_218136 = defunc_2_reduce_res_218091 * c12_218127;\n    double y_218137 = x_218135 + y_218136;\n    double det_218138 = 1.0 / y_218137;\n    double a12_218139 = a12_218121 * det_218138;\n    double b12_218140 = b12_218124 * det_218138;\n    double c12_218141 = c12_218127 * det_218138;\n    double b2_218142 = b2_218129 * det_218138;\n    double c2_218143 = c2_218132 * det_218138;\n    double defunc_2_reduce_res_218144;\n    double defunc_2_reduce_res_218145;\n    int64_t gtid_218146 = sext_i32_i64(sext_i64_i32(ltid_pre_234281));\n    int32_t phys_tid_218147 = local_tid_234277;\n    __local unsigned char *red_arr_mem_234302;\n    \n    red_arr_mem_234302 = (__local unsigned char *) red_arr_mem_234302_backing_9;\n    \n    __local unsigned char *red_arr_mem_234304;\n    \n    red_arr_mem_234304 = (__local\n                          unsigned char *) red_arr_mem_234304_backing_10;\n    \n    double x_218155;\n    \n    x_218155 = ((__local double *) color_232136)[gtid_218146];\n    \n    double x_218156;\n    \n    x_218156 = ((__local double *) color_232134)[gtid_218146];\n    \n    double x_218157;\n    \n    x_218157 = ((__local double *) color_232135)[gtid_218146];\n    \n    bool cond_218158 = sle64(x_218052, gtid_218146);\n    double defunc_0_f_res_218159;\n    \n    if (cond_218158) {\n        defunc_0_f_res_218159 = 0.0;\n    } else {\n        int64_t i_218160 = add64(x_218054, gtid_218146);\n        double defunc_0_add_arg_218161;\n        \n        defunc_0_add_arg_218161 = ((__global double *) mem_229634)[gtid_218042 *\n                                                                   (defunc_0_f_res_203721 *\n                                                                    n_p_203574) +\n                                                                   gtid_218043 *\n                                                                   defunc_0_f_res_203721 +\n                                                                   i_218160];\n        defunc_0_f_res_218159 = defunc_0_add_arg_218161;\n ",
            "   }\n    \n    double x_218162 = a12_218139 * x_218155;\n    double y_218163 = b12_218140 * x_218156;\n    double x_218164 = x_218162 + y_218163;\n    double y_218165 = c12_218141 * x_218157;\n    double x_218166 = x_218164 + y_218165;\n    double defunc_9_fit_fun_res_218167 = defunc_0_f_res_218159 * x_218166;\n    double x_218168 = b12_218140 * x_218155;\n    double y_218169 = b2_218142 * x_218156;\n    double x_218170 = x_218168 + y_218169;\n    double y_218171 = c2_218143 * x_218157;\n    double x_218172 = x_218170 + y_218171;\n    double defunc_9_slope_fun_res_218173 = defunc_0_f_res_218159 * x_218172;\n    \n    ((__local double *) red_arr_mem_234302)[gtid_218146] =\n        defunc_9_fit_fun_res_218167;\n    ((__local double *) red_arr_mem_234304)[gtid_218146] =\n        defunc_9_slope_fun_res_218173;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234306;\n    int32_t skip_waves_234307 = 1;\n    double x_218148;\n    double x_218149;\n    double x_218150;\n    double x_218151;\n    \n    offset_234306 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234277, sext_i64_i32(q_s_203575))) {\n            x_218148 = ((__local\n                         double *) red_arr_mem_234302)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234306)];\n            x_218149 = ((__local\n                         double *) red_arr_mem_234304)[sext_i32_i64(local_tid_234277 +\n                                                       offset_234306)];\n        }\n    }\n    offset_234306 = 1;\n    while (slt32(offset_234306, wave_sizze_234279)) {\n        if (slt32(local_tid_234277 + offset_234306, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234277 - squot32(local_tid_234277, wave_sizze_234279) *\n              wave_sizze_234279) & (2 * offset_234306 - 1)) == 0) {\n            // read array element\n            {\n                x_218150 = ((volatile __local\n                             double *) red_arr_mem_234302)[se",
            "xt_i32_i64(local_tid_234277 +\n                                                           offset_234306)];\n                x_218151 = ((volatile __local\n                             double *) red_arr_mem_234304)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234306)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218152 = x_218148 + x_218150;\n                double defunc_1_op_res_218153 = x_218149 + x_218151;\n                \n                x_218148 = defunc_1_op_res_218152;\n                x_218149 = defunc_1_op_res_218153;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234302)[sext_i32_i64(local_tid_234277)] =\n                    x_218148;\n                ((volatile __local\n                  double *) red_arr_mem_234304)[sext_i32_i64(local_tid_234277)] =\n                    x_218149;\n            }\n        }\n        offset_234306 *= 2;\n    }\n    while (slt32(skip_waves_234307, squot32(sext_i64_i32(q_s_203575) +\n                                            wave_sizze_234279 - 1,\n                                            wave_sizze_234279))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234306 = skip_waves_234307 * wave_sizze_234279;\n        if (slt32(local_tid_234277 + offset_234306, sext_i64_i32(q_s_203575)) &&\n            ((local_tid_234277 - squot32(local_tid_234277, wave_sizze_234279) *\n              wave_sizze_234279) == 0 && (squot32(local_tid_234277,\n                                                  wave_sizze_234279) & (2 *\n                                                                        skip_waves_234307 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218150 = ((__local\n                             double *) red_arr_m",
            "em_234302)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234306)];\n                x_218151 = ((__local\n                             double *) red_arr_mem_234304)[sext_i32_i64(local_tid_234277 +\n                                                           offset_234306)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218152 = x_218148 + x_218150;\n                double defunc_1_op_res_218153 = x_218149 + x_218151;\n                \n                x_218148 = defunc_1_op_res_218152;\n                x_218149 = defunc_1_op_res_218153;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234302)[sext_i32_i64(local_tid_234277)] =\n                    x_218148;\n                ((__local\n                  double *) red_arr_mem_234304)[sext_i32_i64(local_tid_234277)] =\n                    x_218149;\n            }\n        }\n        skip_waves_234307 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_218144 = ((__local\n                                   double *) red_arr_mem_234302)[(int64_t) 0];\n    defunc_2_reduce_res_218145 = ((__local\n                                   double *) red_arr_mem_234304)[(int64_t) 0];\n    if (local_tid_234277 == 0) {\n        ((__global double *) mem_230584)[gtid_218042 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_218043 * s_n_m_203726 +\n                                         gtid_218044] =\n            defunc_2_reduce_res_218144;\n    }\n    if (local_tid_234277 == 0) {\n        ((__global double *) mem_230589)[gtid_218042 * (s_n_m_203726 *\n                                                        n_p_203574) +\n                                         gtid_218043 * s_n_m_203726 +\n                                         gtid_218044] =\n            defunc_2",
            "_reduce_res_218145;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221759(__global int *global_failure,\n                                             uint red_arr_mem_235620_backing_offset_0,\n                                             uint red_arr_mem_235616_backing_offset_1,\n                                             uint color_232143_backing_offset_2,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                             int64_t ctx_param_ext_229596,\n                                             int64_t ctx_param_ext_229597,\n                                             int64_t ctx_param_ext_229599,\n                                             __global\n                                             unsigned char *ext_mem_229519,\n                                             __global\n                                             unsigned char *ext_mem_229520,\n                                             __global\n                                             unsigned char *mem_param_229601,\n                                             __global unsigned char *mem_230659,\n                                             __global unsigned char *mem_230969)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235620_backing_2 =\n                           &shared_mem[red_arr_mem_235620_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235616_backing_1 =\n                           &shared_mem[red_arr_mem_235616_backing_offset_1];\n    volatile unsigned char *color_232143_backing_0 =\n               ",
            "            &shared_mem[color_232143_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235604;\n    int32_t local_tid_235605;\n    int64_t group_sizze_235608;\n    int32_t wave_sizze_235607;\n    int32_t group_tid_235606;\n    \n    global_tid_235604 = get_global_id(0);\n    local_tid_235605 = get_local_id(0);\n    group_sizze_235608 = get_local_size(0);\n    wave_sizze_235607 = LOCKSTEP_WIDTH;\n    group_tid_235606 = get_group_id(0);\n    \n    int32_t phys_tid_221759 = group_tid_235606;\n    int64_t slice_235610 = q_l_203577;\n    int64_t ltid_pre_235609 = sext_i32_i64(local_tid_235605);\n    int64_t remnant_235611 = sext_i32_i64(local_tid_235605) - ltid_pre_235609;\n    int64_t slice_235612 = l_n_m_203733;\n    int64_t slice_235613 = partition_sizze_203667 * slice_235612;\n    int64_t gtid_221757 = squot64(sext_i32_i64(group_tid_235606), slice_235612);\n    int64_t remnant_235614 = sext_i32_i64(group_tid_235606) - gtid_221757 *\n            slice_235612;\n    int64_t gtid_221758 = remnant_235614;\n    int64_t remnant_235615 = remnant_235614 - gtid_221758;\n    __local unsigned char *color_232143;\n    \n    color_232143 = (__local unsigned char *) color_232143_backing_0;\n    \n    int64_t x_221765;\n    \n    x_221765 = ((__global int64_t *) ext_mem_229520)[gtid_221757 *\n                                                     l_n_m_203733 +\n                                                     gtid_221758];\n    \n    double x_221766;\n    \n    x_221766 = ((__global double *) ext_mem_229519)[gtid_221757 * l_n_m_203733 +\n                                                    gtid_221758];\n    \n    int64_t min_arg_221767 = mul64(jump_t_203582, gtid_221758);\n    int64_t min_res_221768 = smin64(i_203760, min_arg_221767);\n    int64_t defunc_0_g_res_221769 = add64((int64_t) 1, min_res_221768);\n    double defunc_2_reduce_res_221770;\n    int64_t gtid_221772 = sext_i32_i64(sext_i64_i32(ltid_pre_235609));\n    int32_t phys_tid_221773 = local_tid_235605;\n    __loca",
            "l unsigned char *red_arr_mem_235616;\n    \n    red_arr_mem_235616 = (__local unsigned char *) red_arr_mem_235616_backing_1;\n    \n    bool cond_221778 = sle64(n_203572, gtid_221772);\n    int64_t defunc_0_f_res_221779;\n    \n    if (cond_221778) {\n        defunc_0_f_res_221779 = (int64_t) 0;\n    } else {\n        int64_t i_221780 = add64(x_221765, gtid_221772);\n        int64_t defunc_1_add_res_221781 = add64((int64_t) 1, i_221780);\n        \n        defunc_0_f_res_221779 = defunc_1_add_res_221781;\n    }\n    \n    double defunc_0_f_res_221782;\n    \n    if (cond_221778) {\n        defunc_0_f_res_221782 = 0.0;\n    } else {\n        int64_t i_221783 = add64(x_221765, gtid_221772);\n        double defunc_0_add_arg_221784;\n        \n        defunc_0_add_arg_221784 = ((__global\n                                    double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                (gtid_221757 *\n                                                                 ctx_param_ext_229597 +\n                                                                 i_221783 *\n                                                                 ctx_param_ext_229599)];\n        defunc_0_f_res_221782 = defunc_0_add_arg_221784;\n    }\n    \n    int64_t binop_p_221785 = sub64(defunc_0_f_res_221779,\n                                   defunc_0_g_res_221769);\n    double defunc_0_f_res_221786 = sitofp_i64_f64(binop_p_221785);\n    double abs_res_221787 = fabs(defunc_0_f_res_221786);\n    double tmp1_221788 = abs_res_221787 / x_221766;\n    double x_221789 = tmp1_221788 * tmp1_221788;\n    double y_221790 = tmp1_221788 * x_221789;\n    double tmp2_221791 = 1.0 - y_221790;\n    double x_221792 = tmp2_221791 * tmp2_221791;\n    double tmp3_221793 = tmp2_221791 * x_221792;\n    double tmp4_221794 = defunc_0_f_res_221782 * tmp3_221793;\n    \n    ((__local double *) red_arr_mem_235616)[gtid_221772] = tmp4_221794;\n    ((__local double *) color_232143)[gtid_221772] = tmp4_221794;\n    barrie",
            "r(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235618;\n    int32_t skip_waves_235619 = 1;\n    double x_221774;\n    double x_221775;\n    \n    offset_235618 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235605, sext_i64_i32(q_l_203577))) {\n            x_221774 = ((__local\n                         double *) red_arr_mem_235616)[sext_i32_i64(local_tid_235605 +\n                                                       offset_235618)];\n        }\n    }\n    offset_235618 = 1;\n    while (slt32(offset_235618, wave_sizze_235607)) {\n        if (slt32(local_tid_235605 + offset_235618, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235605 - squot32(local_tid_235605, wave_sizze_235607) *\n              wave_sizze_235607) & (2 * offset_235618 - 1)) == 0) {\n            // read array element\n            {\n                x_221775 = ((volatile __local\n                             double *) red_arr_mem_235616)[sext_i32_i64(local_tid_235605 +\n                                                           offset_235618)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221776 = x_221774 + x_221775;\n                \n                x_221774 = defunc_1_op_res_221776;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235616)[sext_i32_i64(local_tid_235605)] =\n                    x_221774;\n            }\n        }\n        offset_235618 *= 2;\n    }\n    while (slt32(skip_waves_235619, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235607 - 1,\n                                            wave_sizze_235607))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235618 = skip_waves_235619 * wave_sizze_235607;\n        if (slt32(local_tid_235605 + offset_235618, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235605 - squot32(local_tid_235605, wave_sizze_23",
            "5607) *\n              wave_sizze_235607) == 0 && (squot32(local_tid_235605,\n                                                  wave_sizze_235607) & (2 *\n                                                                        skip_waves_235619 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221775 = ((__local\n                             double *) red_arr_mem_235616)[sext_i32_i64(local_tid_235605 +\n                                                           offset_235618)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221776 = x_221774 + x_221775;\n                \n                x_221774 = defunc_1_op_res_221776;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235616)[sext_i32_i64(local_tid_235605)] =\n                    x_221774;\n            }\n        }\n        skip_waves_235619 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221770 = ((__local\n                                   double *) red_arr_mem_235616)[(int64_t) 0];\n    \n    double a0_221795 = 1.0 / defunc_2_reduce_res_221770;\n    double defunc_2_reduce_res_221796;\n    int64_t gtid_221797 = sext_i32_i64(sext_i64_i32(ltid_pre_235609));\n    int32_t phys_tid_221798 = local_tid_235605;\n    __local unsigned char *red_arr_mem_235620;\n    \n    red_arr_mem_235620 = (__local unsigned char *) red_arr_mem_235620_backing_2;\n    \n    double x_221803;\n    \n    x_221803 = ((__local double *) color_232143)[gtid_221797];\n    \n    bool cond_221804 = sle64(n_203572, gtid_221797);\n    double defunc_0_f_res_221805;\n    \n    if (cond_221804) {\n        defunc_0_f_res_221805 = 0.0;\n    } else {\n        int64_t i_221806 = add64(x_221765, gtid_221797);\n        double defunc_0_add_arg_221807;\n        \n        defunc_0_add_arg_221807 = ((__global double ",
            "*) mem_230659)[gtid_221757 *\n                                                                   n_203572 +\n                                                                   i_221806];\n        defunc_0_f_res_221805 = defunc_0_add_arg_221807;\n    }\n    \n    double x_221808 = a0_221795 * x_221803;\n    double defunc_9_fit_fun_res_221809 = defunc_0_f_res_221805 * x_221808;\n    \n    ((__local double *) red_arr_mem_235620)[gtid_221797] =\n        defunc_9_fit_fun_res_221809;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235622;\n    int32_t skip_waves_235623 = 1;\n    double x_221799;\n    double x_221800;\n    \n    offset_235622 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235605, sext_i64_i32(q_l_203577))) {\n            x_221799 = ((__local\n                         double *) red_arr_mem_235620)[sext_i32_i64(local_tid_235605 +\n                                                       offset_235622)];\n        }\n    }\n    offset_235622 = 1;\n    while (slt32(offset_235622, wave_sizze_235607)) {\n        if (slt32(local_tid_235605 + offset_235622, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235605 - squot32(local_tid_235605, wave_sizze_235607) *\n              wave_sizze_235607) & (2 * offset_235622 - 1)) == 0) {\n            // read array element\n            {\n                x_221800 = ((volatile __local\n                             double *) red_arr_mem_235620)[sext_i32_i64(local_tid_235605 +\n                                                           offset_235622)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221801 = x_221799 + x_221800;\n                \n                x_221799 = defunc_1_op_res_221801;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235620)[sext_i32_i64(local_tid_235605)] =\n                    x_221799;\n            }\n        }\n        of",
            "fset_235622 *= 2;\n    }\n    while (slt32(skip_waves_235623, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235607 - 1,\n                                            wave_sizze_235607))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235622 = skip_waves_235623 * wave_sizze_235607;\n        if (slt32(local_tid_235605 + offset_235622, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235605 - squot32(local_tid_235605, wave_sizze_235607) *\n              wave_sizze_235607) == 0 && (squot32(local_tid_235605,\n                                                  wave_sizze_235607) & (2 *\n                                                                        skip_waves_235623 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221800 = ((__local\n                             double *) red_arr_mem_235620)[sext_i32_i64(local_tid_235605 +\n                                                           offset_235622)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221801 = x_221799 + x_221800;\n                \n                x_221799 = defunc_1_op_res_221801;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235620)[sext_i32_i64(local_tid_235605)] =\n                    x_221799;\n            }\n        }\n        skip_waves_235623 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221796 = ((__local\n                                   double *) red_arr_mem_235620)[(int64_t) 0];\n    if (local_tid_235605 == 0) {\n        ((__global double *) mem_230969)[gtid_221757 * l_n_m_203733 +\n                                         gtid_221758] =\n            defunc_2_reduce_res_221796;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221926(__global int",
            " *global_failure,\n                                             uint red_arr_mem_235646_backing_offset_0,\n                                             uint red_arr_mem_235644_backing_offset_1,\n                                             uint red_arr_mem_235640_backing_offset_2,\n                                             uint red_arr_mem_235638_backing_offset_3,\n                                             uint red_arr_mem_235636_backing_offset_4,\n                                             uint color_232145_backing_offset_5,\n                                             uint color_232144_backing_offset_6,\n                                             int64_t n_203572,\n                                             int64_t q_l_203577,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                             int64_t ctx_param_ext_229596,\n                                             int64_t ctx_param_ext_229597,\n                                             int64_t ctx_param_ext_229599,\n                                             __global\n                                             unsigned char *ext_mem_229519,\n                                             __global\n                                             unsigned char *ext_mem_229520,\n                                             __global\n                                             unsigned char *mem_param_229601,\n                                             __global unsigned char *mem_230659,\n                                             __global unsigned char *mem_230982,\n                                             __global unsigned char *mem_230986)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *re",
            "d_arr_mem_235646_backing_6 =\n                           &shared_mem[red_arr_mem_235646_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235644_backing_5 =\n                           &shared_mem[red_arr_mem_235644_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235640_backing_4 =\n                           &shared_mem[red_arr_mem_235640_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235638_backing_3 =\n                           &shared_mem[red_arr_mem_235638_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235636_backing_2 =\n                           &shared_mem[red_arr_mem_235636_backing_offset_4];\n    volatile unsigned char *color_232145_backing_1 =\n                           &shared_mem[color_232145_backing_offset_5];\n    volatile unsigned char *color_232144_backing_0 =\n                           &shared_mem[color_232144_backing_offset_6];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235624;\n    int32_t local_tid_235625;\n    int64_t group_sizze_235628;\n    int32_t wave_sizze_235627;\n    int32_t group_tid_235626;\n    \n    global_tid_235624 = get_global_id(0);\n    local_tid_235625 = get_local_id(0);\n    group_sizze_235628 = get_local_size(0);\n    wave_sizze_235627 = LOCKSTEP_WIDTH;\n    group_tid_235626 = get_group_id(0);\n    \n    int32_t phys_tid_221926 = group_tid_235626;\n    int64_t slice_235630 = q_l_203577;\n    int64_t ltid_pre_235629 = sext_i32_i64(local_tid_235625);\n    int64_t remnant_235631 = sext_i32_i64(local_tid_235625) - ltid_pre_235629;\n    int64_t slice_235632 = l_n_m_203733;\n    int64_t slice_235633 = partition_sizze_203667 * slice_235632;\n    int64_t gtid_221924 = squot64(sext_i32_i64(group_tid_235626), slice_235632);\n    int64_t remnant_235634 = sext_i32_i64(group_tid_235626) - gtid_221924 *\n            slice_235632;\n    int64_t gtid_221925 = remnant_235634;\n    int64_t remnant_235635 = remnant_235634 - gtid_221925;\n    __local unsigned char *color_232144;\n    \n    color_2",
            "32144 = (__local unsigned char *) color_232144_backing_0;\n    \n    __local unsigned char *color_232145;\n    \n    color_232145 = (__local unsigned char *) color_232145_backing_1;\n    \n    int64_t x_221932;\n    \n    x_221932 = ((__global int64_t *) ext_mem_229520)[gtid_221924 *\n                                                     l_n_m_203733 +\n                                                     gtid_221925];\n    \n    double x_221933;\n    \n    x_221933 = ((__global double *) ext_mem_229519)[gtid_221924 * l_n_m_203733 +\n                                                    gtid_221925];\n    \n    int64_t min_arg_221934 = mul64(jump_t_203582, gtid_221925);\n    int64_t min_res_221935 = smin64(i_203760, min_arg_221934);\n    int64_t defunc_0_g_res_221936 = add64((int64_t) 1, min_res_221935);\n    double defunc_2_reduce_res_221937;\n    double defunc_2_reduce_res_221938;\n    double defunc_2_reduce_res_221939;\n    int64_t gtid_221942 = sext_i32_i64(sext_i64_i32(ltid_pre_235629));\n    int32_t phys_tid_221943 = local_tid_235625;\n    __local unsigned char *red_arr_mem_235636;\n    \n    red_arr_mem_235636 = (__local unsigned char *) red_arr_mem_235636_backing_2;\n    \n    __local unsigned char *red_arr_mem_235638;\n    \n    red_arr_mem_235638 = (__local unsigned char *) red_arr_mem_235638_backing_3;\n    \n    __local unsigned char *red_arr_mem_235640;\n    \n    red_arr_mem_235640 = (__local unsigned char *) red_arr_mem_235640_backing_4;\n    \n    bool cond_221954 = sle64(n_203572, gtid_221942);\n    int64_t defunc_0_f_res_221955;\n    \n    if (cond_221954) {\n        defunc_0_f_res_221955 = (int64_t) 0;\n    } else {\n        int64_t i_221956 = add64(x_221932, gtid_221942);\n        int64_t defunc_1_add_res_221957 = add64((int64_t) 1, i_221956);\n        \n        defunc_0_f_res_221955 = defunc_1_add_res_221957;\n    }\n    \n    double defunc_0_f_res_221958;\n    \n    if (cond_221954) {\n        defunc_0_f_res_221958 = 0.0;\n    } else {\n        int64_t i_221959 = add64(x_221932, gtid_221942);\n       ",
            " double defunc_0_add_arg_221960;\n        \n        defunc_0_add_arg_221960 = ((__global\n                                    double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                (gtid_221924 *\n                                                                 ctx_param_ext_229597 +\n                                                                 i_221959 *\n                                                                 ctx_param_ext_229599)];\n        defunc_0_f_res_221958 = defunc_0_add_arg_221960;\n    }\n    \n    int64_t binop_p_221961 = sub64(defunc_0_f_res_221955,\n                                   defunc_0_g_res_221936);\n    double defunc_0_f_res_221962 = sitofp_i64_f64(binop_p_221961);\n    double abs_res_221963 = fabs(defunc_0_f_res_221962);\n    double tmp1_221964 = abs_res_221963 / x_221933;\n    double x_221965 = tmp1_221964 * tmp1_221964;\n    double y_221966 = tmp1_221964 * x_221965;\n    double tmp2_221967 = 1.0 - y_221966;\n    double x_221968 = tmp2_221967 * tmp2_221967;\n    double tmp3_221969 = tmp2_221967 * x_221968;\n    double tmp4_221970 = defunc_0_f_res_221958 * tmp3_221969;\n    double defunc_1_f_res_221971 = defunc_0_f_res_221962 * tmp4_221970;\n    double defunc_1_f_res_221972 = defunc_0_f_res_221962 *\n           defunc_1_f_res_221971;\n    \n    ((__local double *) red_arr_mem_235636)[gtid_221942] = tmp4_221970;\n    ((__local double *) red_arr_mem_235638)[gtid_221942] =\n        defunc_1_f_res_221971;\n    ((__local double *) red_arr_mem_235640)[gtid_221942] =\n        defunc_1_f_res_221972;\n    ((__local double *) color_232145)[gtid_221942] = defunc_1_f_res_221971;\n    ((__local double *) color_232144)[gtid_221942] = tmp4_221970;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235642;\n    int32_t skip_waves_235643 = 1;\n    double x_221944;\n    double x_221945;\n    double x_221946;\n    double x_221947;\n    double x_221948;\n    double x_221949;\n    \n    offset_235642 = 0;\n    // participati",
            "ng threads read initial accumulator\n    {\n        if (slt32(local_tid_235625, sext_i64_i32(q_l_203577))) {\n            x_221944 = ((__local\n                         double *) red_arr_mem_235636)[sext_i32_i64(local_tid_235625 +\n                                                       offset_235642)];\n            x_221945 = ((__local\n                         double *) red_arr_mem_235638)[sext_i32_i64(local_tid_235625 +\n                                                       offset_235642)];\n            x_221946 = ((__local\n                         double *) red_arr_mem_235640)[sext_i32_i64(local_tid_235625 +\n                                                       offset_235642)];\n        }\n    }\n    offset_235642 = 1;\n    while (slt32(offset_235642, wave_sizze_235627)) {\n        if (slt32(local_tid_235625 + offset_235642, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235625 - squot32(local_tid_235625, wave_sizze_235627) *\n              wave_sizze_235627) & (2 * offset_235642 - 1)) == 0) {\n            // read array element\n            {\n                x_221947 = ((volatile __local\n                             double *) red_arr_mem_235636)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235642)];\n                x_221948 = ((volatile __local\n                             double *) red_arr_mem_235638)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235642)];\n                x_221949 = ((volatile __local\n                             double *) red_arr_mem_235640)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235642)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221950 = x_221944 + x_221947;\n                double defunc_1_op_res_221951 = x_221945 + x_221948;\n                double defunc_1_op_res_221952 = x_221946 + x_221949;\n                \n               ",
            " x_221944 = defunc_1_op_res_221950;\n                x_221945 = defunc_1_op_res_221951;\n                x_221946 = defunc_1_op_res_221952;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235636)[sext_i32_i64(local_tid_235625)] =\n                    x_221944;\n                ((volatile __local\n                  double *) red_arr_mem_235638)[sext_i32_i64(local_tid_235625)] =\n                    x_221945;\n                ((volatile __local\n                  double *) red_arr_mem_235640)[sext_i32_i64(local_tid_235625)] =\n                    x_221946;\n            }\n        }\n        offset_235642 *= 2;\n    }\n    while (slt32(skip_waves_235643, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235627 - 1,\n                                            wave_sizze_235627))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235642 = skip_waves_235643 * wave_sizze_235627;\n        if (slt32(local_tid_235625 + offset_235642, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235625 - squot32(local_tid_235625, wave_sizze_235627) *\n              wave_sizze_235627) == 0 && (squot32(local_tid_235625,\n                                                  wave_sizze_235627) & (2 *\n                                                                        skip_waves_235643 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221947 = ((__local\n                             double *) red_arr_mem_235636)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235642)];\n                x_221948 = ((__local\n                             double *) red_arr_mem_235638)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235642)];\n                x_221949 = ((__local\n",
            "                             double *) red_arr_mem_235640)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235642)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221950 = x_221944 + x_221947;\n                double defunc_1_op_res_221951 = x_221945 + x_221948;\n                double defunc_1_op_res_221952 = x_221946 + x_221949;\n                \n                x_221944 = defunc_1_op_res_221950;\n                x_221945 = defunc_1_op_res_221951;\n                x_221946 = defunc_1_op_res_221952;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235636)[sext_i32_i64(local_tid_235625)] =\n                    x_221944;\n                ((__local\n                  double *) red_arr_mem_235638)[sext_i32_i64(local_tid_235625)] =\n                    x_221945;\n                ((__local\n                  double *) red_arr_mem_235640)[sext_i32_i64(local_tid_235625)] =\n                    x_221946;\n            }\n        }\n        skip_waves_235643 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221937 = ((__local\n                                   double *) red_arr_mem_235636)[(int64_t) 0];\n    defunc_2_reduce_res_221938 = ((__local\n                                   double *) red_arr_mem_235638)[(int64_t) 0];\n    defunc_2_reduce_res_221939 = ((__local\n                                   double *) red_arr_mem_235640)[(int64_t) 0];\n    \n    double x_221973 = defunc_2_reduce_res_221937 * defunc_2_reduce_res_221939;\n    double y_221974 = defunc_2_reduce_res_221938 * defunc_2_reduce_res_221938;\n    double y_221975 = x_221973 - y_221974;\n    double det1_221976 = 1.0 / y_221975;\n    double a11_221977 = defunc_2_reduce_res_221939 * det1_221976;\n    double x_221978 = 0.0 - defunc_2_reduce_res_221938;\n    double b11_221979 = det1_221976 * x_221978;\n    double c11_221980 = d",
            "efunc_2_reduce_res_221937 * det1_221976;\n    double defunc_2_reduce_res_221981;\n    double defunc_2_reduce_res_221982;\n    int64_t gtid_221983 = sext_i32_i64(sext_i64_i32(ltid_pre_235629));\n    int32_t phys_tid_221984 = local_tid_235625;\n    __local unsigned char *red_arr_mem_235644;\n    \n    red_arr_mem_235644 = (__local unsigned char *) red_arr_mem_235644_backing_5;\n    \n    __local unsigned char *red_arr_mem_235646;\n    \n    red_arr_mem_235646 = (__local unsigned char *) red_arr_mem_235646_backing_6;\n    \n    double x_221992;\n    \n    x_221992 = ((__local double *) color_232144)[gtid_221983];\n    \n    double x_221993;\n    \n    x_221993 = ((__local double *) color_232145)[gtid_221983];\n    \n    bool cond_221994 = sle64(n_203572, gtid_221983);\n    double defunc_0_f_res_221995;\n    \n    if (cond_221994) {\n        defunc_0_f_res_221995 = 0.0;\n    } else {\n        int64_t i_221996 = add64(x_221932, gtid_221983);\n        double defunc_0_add_arg_221997;\n        \n        defunc_0_add_arg_221997 = ((__global double *) mem_230659)[gtid_221924 *\n                                                                   n_203572 +\n                                                                   i_221996];\n        defunc_0_f_res_221995 = defunc_0_add_arg_221997;\n    }\n    \n    double x_221998 = a11_221977 * x_221992;\n    double y_221999 = b11_221979 * x_221993;\n    double x_222000 = x_221998 + y_221999;\n    double defunc_9_fit_fun_res_222001 = defunc_0_f_res_221995 * x_222000;\n    double x_222002 = b11_221979 * x_221992;\n    double y_222003 = c11_221980 * x_221993;\n    double x_222004 = x_222002 + y_222003;\n    double defunc_9_slope_fun_res_222005 = defunc_0_f_res_221995 * x_222004;\n    \n    ((__local double *) red_arr_mem_235644)[gtid_221983] =\n        defunc_9_fit_fun_res_222001;\n    ((__local double *) red_arr_mem_235646)[gtid_221983] =\n        defunc_9_slope_fun_res_222005;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235648;\n    int32_t skip_waves_235649 = 1;\n    ",
            "double x_221985;\n    double x_221986;\n    double x_221987;\n    double x_221988;\n    \n    offset_235648 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235625, sext_i64_i32(q_l_203577))) {\n            x_221985 = ((__local\n                         double *) red_arr_mem_235644)[sext_i32_i64(local_tid_235625 +\n                                                       offset_235648)];\n            x_221986 = ((__local\n                         double *) red_arr_mem_235646)[sext_i32_i64(local_tid_235625 +\n                                                       offset_235648)];\n        }\n    }\n    offset_235648 = 1;\n    while (slt32(offset_235648, wave_sizze_235627)) {\n        if (slt32(local_tid_235625 + offset_235648, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235625 - squot32(local_tid_235625, wave_sizze_235627) *\n              wave_sizze_235627) & (2 * offset_235648 - 1)) == 0) {\n            // read array element\n            {\n                x_221987 = ((volatile __local\n                             double *) red_arr_mem_235644)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235648)];\n                x_221988 = ((volatile __local\n                             double *) red_arr_mem_235646)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235648)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221989 = x_221985 + x_221987;\n                double defunc_1_op_res_221990 = x_221986 + x_221988;\n                \n                x_221985 = defunc_1_op_res_221989;\n                x_221986 = defunc_1_op_res_221990;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235644)[sext_i32_i64(local_tid_235625)] =\n                    x_221985;\n                ((volatile __local\n          ",
            "        double *) red_arr_mem_235646)[sext_i32_i64(local_tid_235625)] =\n                    x_221986;\n            }\n        }\n        offset_235648 *= 2;\n    }\n    while (slt32(skip_waves_235649, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235627 - 1,\n                                            wave_sizze_235627))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235648 = skip_waves_235649 * wave_sizze_235627;\n        if (slt32(local_tid_235625 + offset_235648, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235625 - squot32(local_tid_235625, wave_sizze_235627) *\n              wave_sizze_235627) == 0 && (squot32(local_tid_235625,\n                                                  wave_sizze_235627) & (2 *\n                                                                        skip_waves_235649 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221987 = ((__local\n                             double *) red_arr_mem_235644)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235648)];\n                x_221988 = ((__local\n                             double *) red_arr_mem_235646)[sext_i32_i64(local_tid_235625 +\n                                                           offset_235648)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221989 = x_221985 + x_221987;\n                double defunc_1_op_res_221990 = x_221986 + x_221988;\n                \n                x_221985 = defunc_1_op_res_221989;\n                x_221986 = defunc_1_op_res_221990;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235644)[sext_i32_i64(local_tid_235625)] =\n                    x_221985;\n                ((__local\n                  double",
            " *) red_arr_mem_235646)[sext_i32_i64(local_tid_235625)] =\n                    x_221986;\n            }\n        }\n        skip_waves_235649 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221981 = ((__local\n                                   double *) red_arr_mem_235644)[(int64_t) 0];\n    defunc_2_reduce_res_221982 = ((__local\n                                   double *) red_arr_mem_235646)[(int64_t) 0];\n    if (local_tid_235625 == 0) {\n        ((__global double *) mem_230982)[gtid_221924 * l_n_m_203733 +\n                                         gtid_221925] =\n            defunc_2_reduce_res_221981;\n    }\n    if (local_tid_235625 == 0) {\n        ((__global double *) mem_230986)[gtid_221924 * l_n_m_203733 +\n                                         gtid_221925] =\n            defunc_2_reduce_res_221982;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_222183(__global int *global_failure,\n                                             uint red_arr_mem_235676_backing_offset_0,\n                                             uint red_arr_mem_235674_backing_offset_1,\n                                             uint red_arr_mem_235670_backing_offset_2,\n                                             uint red_arr_mem_235668_backing_offset_3,\n                                             uint red_arr_mem_235666_backing_offset_4,\n                                             uint red_arr_mem_235664_backing_offset_5,\n                                             uint red_arr_mem_235662_backing_offset_6,\n                                             uint color_232149_backing_offset_7,\n                                             uint color_232148_backing_offset_8,\n                                             uint color_232147_backing_offset_9,\n                                             uint color_232146_backing_offset_10,\n                                             int64_t n_203572,\n                                             int64_t q_l_203",
            "577,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t l_n_m_203733,\n                                             int64_t i_203760,\n                                             int64_t ctx_param_ext_229596,\n                                             int64_t ctx_param_ext_229597,\n                                             int64_t ctx_param_ext_229599,\n                                             __global\n                                             unsigned char *ext_mem_229519,\n                                             __global\n                                             unsigned char *ext_mem_229520,\n                                             __global\n                                             unsigned char *mem_param_229601,\n                                             __global unsigned char *mem_230659,\n                                             __global unsigned char *mem_231006,\n                                             __global unsigned char *mem_231010)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235676_backing_10 =\n                           &shared_mem[red_arr_mem_235676_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235674_backing_9 =\n                           &shared_mem[red_arr_mem_235674_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235670_backing_8 =\n                           &shared_mem[red_arr_mem_235670_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235668_backing_7 =\n                           &shared_mem[red_arr_mem_235668_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235666_backing_6 =\n                           &shared_mem[red_arr_mem_235666_backing_offset_4];\n    volatile unsigned char *red_arr_mem_235664_backing_5 =\n                           &",
            "shared_mem[red_arr_mem_235664_backing_offset_5];\n    volatile unsigned char *red_arr_mem_235662_backing_4 =\n                           &shared_mem[red_arr_mem_235662_backing_offset_6];\n    volatile unsigned char *color_232149_backing_3 =\n                           &shared_mem[color_232149_backing_offset_7];\n    volatile unsigned char *color_232148_backing_2 =\n                           &shared_mem[color_232148_backing_offset_8];\n    volatile unsigned char *color_232147_backing_1 =\n                           &shared_mem[color_232147_backing_offset_9];\n    volatile unsigned char *color_232146_backing_0 =\n                           &shared_mem[color_232146_backing_offset_10];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235650;\n    int32_t local_tid_235651;\n    int64_t group_sizze_235654;\n    int32_t wave_sizze_235653;\n    int32_t group_tid_235652;\n    \n    global_tid_235650 = get_global_id(0);\n    local_tid_235651 = get_local_id(0);\n    group_sizze_235654 = get_local_size(0);\n    wave_sizze_235653 = LOCKSTEP_WIDTH;\n    group_tid_235652 = get_group_id(0);\n    \n    int32_t phys_tid_222183 = group_tid_235652;\n    int64_t slice_235656 = q_l_203577;\n    int64_t ltid_pre_235655 = sext_i32_i64(local_tid_235651);\n    int64_t remnant_235657 = sext_i32_i64(local_tid_235651) - ltid_pre_235655;\n    int64_t slice_235658 = l_n_m_203733;\n    int64_t slice_235659 = partition_sizze_203667 * slice_235658;\n    int64_t gtid_222181 = squot64(sext_i32_i64(group_tid_235652), slice_235658);\n    int64_t remnant_235660 = sext_i32_i64(group_tid_235652) - gtid_222181 *\n            slice_235658;\n    int64_t gtid_222182 = remnant_235660;\n    int64_t remnant_235661 = remnant_235660 - gtid_222182;\n    __local unsigned char *color_232146;\n    \n    color_232146 = (__local unsigned char *) color_232146_backing_0;\n    \n    __local unsigned char *color_232147;\n    \n    color_232147 = (__local unsigned char *) color_232147_backing_1;\n    \n    __local unsigned char *color_",
            "232148;\n    \n    color_232148 = (__local unsigned char *) color_232148_backing_2;\n    \n    __local unsigned char *color_232149;\n    \n    color_232149 = (__local unsigned char *) color_232149_backing_3;\n    \n    int64_t x_222189;\n    \n    x_222189 = ((__global int64_t *) ext_mem_229520)[gtid_222181 *\n                                                     l_n_m_203733 +\n                                                     gtid_222182];\n    \n    double x_222190;\n    \n    x_222190 = ((__global double *) ext_mem_229519)[gtid_222181 * l_n_m_203733 +\n                                                    gtid_222182];\n    \n    int64_t min_arg_222191 = mul64(jump_t_203582, gtid_222182);\n    int64_t min_res_222192 = smin64(i_203760, min_arg_222191);\n    int64_t defunc_0_g_res_222193 = add64((int64_t) 1, min_res_222192);\n    int64_t gtid_222196 = sext_i32_i64(sext_i64_i32(ltid_pre_235655));\n    int32_t phys_tid_222197 = local_tid_235651;\n    bool cond_222199 = sle64(n_203572, gtid_222196);\n    int64_t defunc_0_f_res_222200;\n    \n    if (cond_222199) {\n        defunc_0_f_res_222200 = (int64_t) 0;\n    } else {\n        int64_t i_222201 = add64(x_222189, gtid_222196);\n        int64_t defunc_1_add_res_222202 = add64((int64_t) 1, i_222201);\n        \n        defunc_0_f_res_222200 = defunc_1_add_res_222202;\n    }\n    \n    double defunc_0_f_res_222203;\n    \n    if (cond_222199) {\n        defunc_0_f_res_222203 = 0.0;\n    } else {\n        int64_t i_222204 = add64(x_222189, gtid_222196);\n        double defunc_0_add_arg_222205;\n        \n        defunc_0_add_arg_222205 = ((__global\n                                    double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                (gtid_222181 *\n                                                                 ctx_param_ext_229597 +\n                                                                 i_222204 *\n                                                                 ctx_param_ext_229599)];\n ",
            "       defunc_0_f_res_222203 = defunc_0_add_arg_222205;\n    }\n    \n    int64_t binop_p_222206 = sub64(defunc_0_f_res_222200,\n                                   defunc_0_g_res_222193);\n    double defunc_0_f_res_222207 = sitofp_i64_f64(binop_p_222206);\n    double abs_res_222208 = fabs(defunc_0_f_res_222207);\n    double tmp1_222209 = abs_res_222208 / x_222190;\n    double x_222210 = tmp1_222209 * tmp1_222209;\n    double y_222211 = tmp1_222209 * x_222210;\n    double tmp2_222212 = 1.0 - y_222211;\n    double x_222213 = tmp2_222212 * tmp2_222212;\n    double tmp3_222214 = tmp2_222212 * x_222213;\n    double tmp4_222215 = defunc_0_f_res_222203 * tmp3_222214;\n    \n    ((__local double *) color_232149)[gtid_222196] = defunc_0_f_res_222207;\n    ((__local double *) color_232148)[gtid_222196] = tmp4_222215;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_222216;\n    double defunc_2_reduce_res_222217;\n    double defunc_2_reduce_res_222218;\n    double defunc_2_reduce_res_222219;\n    double defunc_2_reduce_res_222220;\n    int64_t gtid_222223 = sext_i32_i64(sext_i64_i32(ltid_pre_235655));\n    int32_t phys_tid_222224 = local_tid_235651;\n    __local unsigned char *red_arr_mem_235662;\n    \n    red_arr_mem_235662 = (__local unsigned char *) red_arr_mem_235662_backing_4;\n    \n    __local unsigned char *red_arr_mem_235664;\n    \n    red_arr_mem_235664 = (__local unsigned char *) red_arr_mem_235664_backing_5;\n    \n    __local unsigned char *red_arr_mem_235666;\n    \n    red_arr_mem_235666 = (__local unsigned char *) red_arr_mem_235666_backing_6;\n    \n    __local unsigned char *red_arr_mem_235668;\n    \n    red_arr_mem_235668 = (__local unsigned char *) red_arr_mem_235668_backing_7;\n    \n    __local unsigned char *red_arr_mem_235670;\n    \n    red_arr_mem_235670 = (__local unsigned char *) red_arr_mem_235670_backing_8;\n    \n    double x_222240;\n    \n    x_222240 = ((__local double *) color_232149)[gtid_222223];\n    \n    double x_222241;\n    \n    x_222241 = ((__local double *)",
            " color_232148)[gtid_222223];\n    \n    double defunc_1_f_res_222242 = x_222240 * x_222241;\n    double defunc_1_f_res_222243 = x_222240 * defunc_1_f_res_222242;\n    double defunc_1_f_res_222244 = x_222240 * defunc_1_f_res_222243;\n    double defunc_1_f_res_222245 = x_222240 * defunc_1_f_res_222244;\n    \n    ((__local double *) red_arr_mem_235662)[gtid_222223] = x_222241;\n    ((__local double *) red_arr_mem_235664)[gtid_222223] =\n        defunc_1_f_res_222242;\n    ((__local double *) red_arr_mem_235666)[gtid_222223] =\n        defunc_1_f_res_222243;\n    ((__local double *) red_arr_mem_235668)[gtid_222223] =\n        defunc_1_f_res_222244;\n    ((__local double *) red_arr_mem_235670)[gtid_222223] =\n        defunc_1_f_res_222245;\n    ((__local double *) color_232147)[gtid_222223] = defunc_1_f_res_222243;\n    ((__local double *) color_232146)[gtid_222223] = defunc_1_f_res_222242;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235672;\n    int32_t skip_waves_235673 = 1;\n    double x_222225;\n    double x_222226;\n    double x_222227;\n    double x_222228;\n    double x_222229;\n    double x_222230;\n    double x_222231;\n    double x_222232;\n    double x_222233;\n    double x_222234;\n    \n    offset_235672 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235651, sext_i64_i32(q_l_203577))) {\n            x_222225 = ((__local\n                         double *) red_arr_mem_235662)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235672)];\n            x_222226 = ((__local\n                         double *) red_arr_mem_235664)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235672)];\n            x_222227 = ((__local\n                         double *) red_arr_mem_235666)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235672)];\n            x_222228 = ((__local\n                         double *) red_arr_m",
            "em_235668)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235672)];\n            x_222229 = ((__local\n                         double *) red_arr_mem_235670)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235672)];\n        }\n    }\n    offset_235672 = 1;\n    while (slt32(offset_235672, wave_sizze_235653)) {\n        if (slt32(local_tid_235651 + offset_235672, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235651 - squot32(local_tid_235651, wave_sizze_235653) *\n              wave_sizze_235653) & (2 * offset_235672 - 1)) == 0) {\n            // read array element\n            {\n                x_222230 = ((volatile __local\n                             double *) red_arr_mem_235662)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222231 = ((volatile __local\n                             double *) red_arr_mem_235664)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222232 = ((volatile __local\n                             double *) red_arr_mem_235666)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222233 = ((volatile __local\n                             double *) red_arr_mem_235668)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222234 = ((volatile __local\n                             double *) red_arr_mem_235670)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222235 = x_222225 + x_222230;\n                double defunc_1_op_res_222236 = x_222226 + x_222231;\n                double defunc_1_op_res_222237 = x_2",
            "22227 + x_222232;\n                double defunc_1_op_res_222238 = x_222228 + x_222233;\n                double defunc_1_op_res_222239 = x_222229 + x_222234;\n                \n                x_222225 = defunc_1_op_res_222235;\n                x_222226 = defunc_1_op_res_222236;\n                x_222227 = defunc_1_op_res_222237;\n                x_222228 = defunc_1_op_res_222238;\n                x_222229 = defunc_1_op_res_222239;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235662)[sext_i32_i64(local_tid_235651)] =\n                    x_222225;\n                ((volatile __local\n                  double *) red_arr_mem_235664)[sext_i32_i64(local_tid_235651)] =\n                    x_222226;\n                ((volatile __local\n                  double *) red_arr_mem_235666)[sext_i32_i64(local_tid_235651)] =\n                    x_222227;\n                ((volatile __local\n                  double *) red_arr_mem_235668)[sext_i32_i64(local_tid_235651)] =\n                    x_222228;\n                ((volatile __local\n                  double *) red_arr_mem_235670)[sext_i32_i64(local_tid_235651)] =\n                    x_222229;\n            }\n        }\n        offset_235672 *= 2;\n    }\n    while (slt32(skip_waves_235673, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235653 - 1,\n                                            wave_sizze_235653))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235672 = skip_waves_235673 * wave_sizze_235653;\n        if (slt32(local_tid_235651 + offset_235672, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235651 - squot32(local_tid_235651, wave_sizze_235653) *\n              wave_sizze_235653) == 0 && (squot32(local_tid_235651,\n                                                  wave_sizze_235653) & (2 *\n                                                                        skip_waves_235673 -\n       ",
            "                                                                 1)) ==\n             0)) {\n            // read array element\n            {\n                x_222230 = ((__local\n                             double *) red_arr_mem_235662)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222231 = ((__local\n                             double *) red_arr_mem_235664)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222232 = ((__local\n                             double *) red_arr_mem_235666)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222233 = ((__local\n                             double *) red_arr_mem_235668)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n                x_222234 = ((__local\n                             double *) red_arr_mem_235670)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235672)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222235 = x_222225 + x_222230;\n                double defunc_1_op_res_222236 = x_222226 + x_222231;\n                double defunc_1_op_res_222237 = x_222227 + x_222232;\n                double defunc_1_op_res_222238 = x_222228 + x_222233;\n                double defunc_1_op_res_222239 = x_222229 + x_222234;\n                \n                x_222225 = defunc_1_op_res_222235;\n                x_222226 = defunc_1_op_res_222236;\n                x_222227 = defunc_1_op_res_222237;\n                x_222228 = defunc_1_op_res_222238;\n                x_222229 = defunc_1_op_res_222239;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235662)[sext_i32_i64",
            "(local_tid_235651)] =\n                    x_222225;\n                ((__local\n                  double *) red_arr_mem_235664)[sext_i32_i64(local_tid_235651)] =\n                    x_222226;\n                ((__local\n                  double *) red_arr_mem_235666)[sext_i32_i64(local_tid_235651)] =\n                    x_222227;\n                ((__local\n                  double *) red_arr_mem_235668)[sext_i32_i64(local_tid_235651)] =\n                    x_222228;\n                ((__local\n                  double *) red_arr_mem_235670)[sext_i32_i64(local_tid_235651)] =\n                    x_222229;\n            }\n        }\n        skip_waves_235673 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222216 = ((__local\n                                   double *) red_arr_mem_235662)[(int64_t) 0];\n    defunc_2_reduce_res_222217 = ((__local\n                                   double *) red_arr_mem_235664)[(int64_t) 0];\n    defunc_2_reduce_res_222218 = ((__local\n                                   double *) red_arr_mem_235666)[(int64_t) 0];\n    defunc_2_reduce_res_222219 = ((__local\n                                   double *) red_arr_mem_235668)[(int64_t) 0];\n    defunc_2_reduce_res_222220 = ((__local\n                                   double *) red_arr_mem_235670)[(int64_t) 0];\n    \n    double x_222246 = defunc_2_reduce_res_222218 * defunc_2_reduce_res_222220;\n    double y_222247 = defunc_2_reduce_res_222219 * defunc_2_reduce_res_222219;\n    double a12_222248 = x_222246 - y_222247;\n    double x_222249 = defunc_2_reduce_res_222218 * defunc_2_reduce_res_222219;\n    double y_222250 = defunc_2_reduce_res_222217 * defunc_2_reduce_res_222220;\n    double b12_222251 = x_222249 - y_222250;\n    double x_222252 = defunc_2_reduce_res_222217 * defunc_2_reduce_res_222219;\n    double y_222253 = defunc_2_reduce_res_222218 * defunc_2_reduce_res_222218;\n    double c12_222254 = x_222252 - y_222253;\n    double x_222255 = defunc_2_reduce_res_222216 * defunc_2_reduce_res_22222",
            "0;\n    double b2_222256 = x_222255 - y_222253;\n    double x_222257 = defunc_2_reduce_res_222217 * defunc_2_reduce_res_222218;\n    double y_222258 = defunc_2_reduce_res_222216 * defunc_2_reduce_res_222219;\n    double c2_222259 = x_222257 - y_222258;\n    double x_222260 = defunc_2_reduce_res_222216 * a12_222248;\n    double y_222261 = defunc_2_reduce_res_222217 * b12_222251;\n    double x_222262 = x_222260 + y_222261;\n    double y_222263 = defunc_2_reduce_res_222218 * c12_222254;\n    double y_222264 = x_222262 + y_222263;\n    double det_222265 = 1.0 / y_222264;\n    double a12_222266 = a12_222248 * det_222265;\n    double b12_222267 = b12_222251 * det_222265;\n    double c12_222268 = c12_222254 * det_222265;\n    double b2_222269 = b2_222256 * det_222265;\n    double c2_222270 = c2_222259 * det_222265;\n    double defunc_2_reduce_res_222271;\n    double defunc_2_reduce_res_222272;\n    int64_t gtid_222273 = sext_i32_i64(sext_i64_i32(ltid_pre_235655));\n    int32_t phys_tid_222274 = local_tid_235651;\n    __local unsigned char *red_arr_mem_235674;\n    \n    red_arr_mem_235674 = (__local unsigned char *) red_arr_mem_235674_backing_9;\n    \n    __local unsigned char *red_arr_mem_235676;\n    \n    red_arr_mem_235676 = (__local\n                          unsigned char *) red_arr_mem_235676_backing_10;\n    \n    double x_222282;\n    \n    x_222282 = ((__local double *) color_232148)[gtid_222273];\n    \n    double x_222283;\n    \n    x_222283 = ((__local double *) color_232146)[gtid_222273];\n    \n    double x_222284;\n    \n    x_222284 = ((__local double *) color_232147)[gtid_222273];\n    \n    bool cond_222285 = sle64(n_203572, gtid_222273);\n    double defunc_0_f_res_222286;\n    \n    if (cond_222285) {\n        defunc_0_f_res_222286 = 0.0;\n    } else {\n        int64_t i_222287 = add64(x_222189, gtid_222273);\n        double defunc_0_add_arg_222288;\n        \n        defunc_0_add_arg_222288 = ((__global double *) mem_230659)[gtid_222181 *\n                                                             ",
            "      n_203572 +\n                                                                   i_222287];\n        defunc_0_f_res_222286 = defunc_0_add_arg_222288;\n    }\n    \n    double x_222289 = a12_222266 * x_222282;\n    double y_222290 = b12_222267 * x_222283;\n    double x_222291 = x_222289 + y_222290;\n    double y_222292 = c12_222268 * x_222284;\n    double x_222293 = x_222291 + y_222292;\n    double defunc_9_fit_fun_res_222294 = defunc_0_f_res_222286 * x_222293;\n    double x_222295 = b12_222267 * x_222282;\n    double y_222296 = b2_222269 * x_222283;\n    double x_222297 = x_222295 + y_222296;\n    double y_222298 = c2_222270 * x_222284;\n    double x_222299 = x_222297 + y_222298;\n    double defunc_9_slope_fun_res_222300 = defunc_0_f_res_222286 * x_222299;\n    \n    ((__local double *) red_arr_mem_235674)[gtid_222273] =\n        defunc_9_fit_fun_res_222294;\n    ((__local double *) red_arr_mem_235676)[gtid_222273] =\n        defunc_9_slope_fun_res_222300;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235678;\n    int32_t skip_waves_235679 = 1;\n    double x_222275;\n    double x_222276;\n    double x_222277;\n    double x_222278;\n    \n    offset_235678 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235651, sext_i64_i32(q_l_203577))) {\n            x_222275 = ((__local\n                         double *) red_arr_mem_235674)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235678)];\n            x_222276 = ((__local\n                         double *) red_arr_mem_235676)[sext_i32_i64(local_tid_235651 +\n                                                       offset_235678)];\n        }\n    }\n    offset_235678 = 1;\n    while (slt32(offset_235678, wave_sizze_235653)) {\n        if (slt32(local_tid_235651 + offset_235678, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235651 - squot32(local_tid_235651, wave_sizze_235653) *\n              wave_sizze_235653) & (2 * offset_235678 - 1)) == 0) {\n  ",
            "          // read array element\n            {\n                x_222277 = ((volatile __local\n                             double *) red_arr_mem_235674)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235678)];\n                x_222278 = ((volatile __local\n                             double *) red_arr_mem_235676)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235678)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222279 = x_222275 + x_222277;\n                double defunc_1_op_res_222280 = x_222276 + x_222278;\n                \n                x_222275 = defunc_1_op_res_222279;\n                x_222276 = defunc_1_op_res_222280;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235674)[sext_i32_i64(local_tid_235651)] =\n                    x_222275;\n                ((volatile __local\n                  double *) red_arr_mem_235676)[sext_i32_i64(local_tid_235651)] =\n                    x_222276;\n            }\n        }\n        offset_235678 *= 2;\n    }\n    while (slt32(skip_waves_235679, squot32(sext_i64_i32(q_l_203577) +\n                                            wave_sizze_235653 - 1,\n                                            wave_sizze_235653))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235678 = skip_waves_235679 * wave_sizze_235653;\n        if (slt32(local_tid_235651 + offset_235678, sext_i64_i32(q_l_203577)) &&\n            ((local_tid_235651 - squot32(local_tid_235651, wave_sizze_235653) *\n              wave_sizze_235653) == 0 && (squot32(local_tid_235651,\n                                                  wave_sizze_235653) & (2 *\n                                                                        skip_waves_235679 -\n                                                                        1)) ==",
            "\n             0)) {\n            // read array element\n            {\n                x_222277 = ((__local\n                             double *) red_arr_mem_235674)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235678)];\n                x_222278 = ((__local\n                             double *) red_arr_mem_235676)[sext_i32_i64(local_tid_235651 +\n                                                           offset_235678)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222279 = x_222275 + x_222277;\n                double defunc_1_op_res_222280 = x_222276 + x_222278;\n                \n                x_222275 = defunc_1_op_res_222279;\n                x_222276 = defunc_1_op_res_222280;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235674)[sext_i32_i64(local_tid_235651)] =\n                    x_222275;\n                ((__local\n                  double *) red_arr_mem_235676)[sext_i32_i64(local_tid_235651)] =\n                    x_222276;\n            }\n        }\n        skip_waves_235679 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222271 = ((__local\n                                   double *) red_arr_mem_235674)[(int64_t) 0];\n    defunc_2_reduce_res_222272 = ((__local\n                                   double *) red_arr_mem_235676)[(int64_t) 0];\n    if (local_tid_235651 == 0) {\n        ((__global double *) mem_231006)[gtid_222181 * l_n_m_203733 +\n                                         gtid_222182] =\n            defunc_2_reduce_res_222271;\n    }\n    if (local_tid_235651 == 0) {\n        ((__global double *) mem_231010)[gtid_222181 * l_n_m_203733 +\n                                         gtid_222182] =\n            defunc_2_reduce_res_222272;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226007(__global int *global_failure",
            ",\n                                             uint red_arr_mem_236536_backing_offset_0,\n                                             uint red_arr_mem_236532_backing_offset_1,\n                                             uint color_232164_backing_offset_2,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                                             int64_t i_203760, __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_229568,\n                                             __global\n                                             unsigned char *ext_mem_229569,\n                                             __global unsigned char *mem_231524,\n                                             __global unsigned char *mem_231528,\n                                             __global unsigned char *mem_231538)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236536_backing_2 =\n                           &shared_mem[red_arr_mem_236536_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236532_backing_1 =\n                           &shared_mem[red_arr_mem_236532_backing_offset_1];\n    volatile unsigned char *color_232164_backing_0 =\n                           &shared_mem[color_232164_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236520;\n    int32_t local_tid_236521;\n    int64_t group",
            "_sizze_236524;\n    int32_t wave_sizze_236523;\n    int32_t group_tid_236522;\n    \n    global_tid_236520 = get_global_id(0);\n    local_tid_236521 = get_local_id(0);\n    group_sizze_236524 = get_local_size(0);\n    wave_sizze_236523 = LOCKSTEP_WIDTH;\n    group_tid_236522 = get_group_id(0);\n    \n    int32_t phys_tid_226007 = group_tid_236522;\n    int64_t slice_236526 = q_t_203576;\n    int64_t ltid_pre_236525 = sext_i32_i64(local_tid_236521);\n    int64_t remnant_236527 = sext_i32_i64(local_tid_236521) - ltid_pre_236525;\n    int64_t slice_236528 = t_n_m_203740;\n    int64_t slice_236529 = partition_sizze_203667 * slice_236528;\n    int64_t gtid_226005 = squot64(sext_i32_i64(group_tid_236522), slice_236528);\n    int64_t remnant_236530 = sext_i32_i64(group_tid_236522) - gtid_226005 *\n            slice_236528;\n    int64_t gtid_226006 = remnant_236530;\n    int64_t remnant_236531 = remnant_236530 - gtid_226006;\n    __local unsigned char *color_232164;\n    \n    color_232164 = (__local unsigned char *) color_232164_backing_0;\n    \n    int64_t x_226010;\n    \n    x_226010 = ((__global int64_t *) ext_mem_229304)[gtid_226005];\n    \n    int64_t x_226016;\n    \n    x_226016 = ((__global int64_t *) ext_mem_229569)[gtid_226005 *\n                                                     t_n_m_203740 +\n                                                     gtid_226006];\n    \n    double x_226017;\n    \n    x_226017 = ((__global double *) ext_mem_229568)[gtid_226005 * t_n_m_203740 +\n                                                    gtid_226006];\n    \n    int64_t min_arg_226018 = mul64(jump_t_203582, gtid_226006);\n    int64_t min_res_226019 = smin64(i_203760, min_arg_226018);\n    int64_t defunc_0_g_res_226020 = add64((int64_t) 1, min_res_226019);\n    double defunc_2_reduce_res_226021;\n    int64_t gtid_226023 = sext_i32_i64(sext_i64_i32(ltid_pre_236525));\n    int32_t phys_tid_226024 = local_tid_236521;\n    __local unsigned char *red_arr_mem_236532;\n    \n    red_arr_mem_236532 = (__local unsigned char *",
            ") red_arr_mem_236532_backing_1;\n    \n    bool cond_226029 = sle64(x_226010, gtid_226023);\n    int64_t defunc_0_f_res_226030;\n    \n    if (cond_226029) {\n        defunc_0_f_res_226030 = (int64_t) 0;\n    } else {\n        int64_t i_226031 = add64(x_226016, gtid_226023);\n        int64_t defunc_0_add_arg_226032;\n        \n        defunc_0_add_arg_226032 = ((__global\n                                    int64_t *) ext_mem_229305)[gtid_226005 *\n                                                               n_203572 +\n                                                               i_226031];\n        \n        int64_t defunc_1_add_res_226033 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226032);\n        \n        defunc_0_f_res_226030 = defunc_1_add_res_226033;\n    }\n    \n    double defunc_0_f_res_226034;\n    \n    if (cond_226029) {\n        defunc_0_f_res_226034 = 0.0;\n    } else {\n        int64_t i_226035 = add64(x_226016, gtid_226023);\n        double defunc_0_add_arg_226036;\n        \n        defunc_0_add_arg_226036 = ((__global double *) mem_231524)[gtid_226005 *\n                                                                   n_203572 +\n                                                                   i_226035];\n        defunc_0_f_res_226034 = defunc_0_add_arg_226036;\n    }\n    \n    int64_t binop_p_226037 = sub64(defunc_0_f_res_226030,\n                                   defunc_0_g_res_226020);\n    double defunc_0_f_res_226038 = sitofp_i64_f64(binop_p_226037);\n    double abs_res_226039 = fabs(defunc_0_f_res_226038);\n    double tmp1_226040 = abs_res_226039 / x_226017;\n    double x_226041 = tmp1_226040 * tmp1_226040;\n    double y_226042 = tmp1_226040 * x_226041;\n    double tmp2_226043 = 1.0 - y_226042;\n    double x_226044 = tmp2_226043 * tmp2_226043;\n    double tmp3_226045 = tmp2_226043 * x_226044;\n    double tmp4_226046 = defunc_0_f_res_226034 * tmp3_226045;\n    \n    ((__local double *) red_arr_mem_236532)[gtid_226023] = tmp4_226046;\n  ",
            "  ((__local double *) color_232164)[gtid_226023] = tmp4_226046;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236534;\n    int32_t skip_waves_236535 = 1;\n    double x_226025;\n    double x_226026;\n    \n    offset_236534 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236521, sext_i64_i32(q_t_203576))) {\n            x_226025 = ((__local\n                         double *) red_arr_mem_236532)[sext_i32_i64(local_tid_236521 +\n                                                       offset_236534)];\n        }\n    }\n    offset_236534 = 1;\n    while (slt32(offset_236534, wave_sizze_236523)) {\n        if (slt32(local_tid_236521 + offset_236534, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236521 - squot32(local_tid_236521, wave_sizze_236523) *\n              wave_sizze_236523) & (2 * offset_236534 - 1)) == 0) {\n            // read array element\n            {\n                x_226026 = ((volatile __local\n                             double *) red_arr_mem_236532)[sext_i32_i64(local_tid_236521 +\n                                                           offset_236534)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226027 = x_226025 + x_226026;\n                \n                x_226025 = defunc_1_op_res_226027;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236532)[sext_i32_i64(local_tid_236521)] =\n                    x_226025;\n            }\n        }\n        offset_236534 *= 2;\n    }\n    while (slt32(skip_waves_236535, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236523 - 1,\n                                            wave_sizze_236523))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236534 = skip_waves_236535 * wave_sizze_236523;\n        if (slt32(local_tid_236521 + offset_236534, sext_i64_i32(q_t_203576)) &",
            "&\n            ((local_tid_236521 - squot32(local_tid_236521, wave_sizze_236523) *\n              wave_sizze_236523) == 0 && (squot32(local_tid_236521,\n                                                  wave_sizze_236523) & (2 *\n                                                                        skip_waves_236535 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226026 = ((__local\n                             double *) red_arr_mem_236532)[sext_i32_i64(local_tid_236521 +\n                                                           offset_236534)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226027 = x_226025 + x_226026;\n                \n                x_226025 = defunc_1_op_res_226027;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236532)[sext_i32_i64(local_tid_236521)] =\n                    x_226025;\n            }\n        }\n        skip_waves_236535 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226021 = ((__local\n                                   double *) red_arr_mem_236532)[(int64_t) 0];\n    \n    double a0_226047 = 1.0 / defunc_2_reduce_res_226021;\n    double defunc_2_reduce_res_226048;\n    int64_t gtid_226049 = sext_i32_i64(sext_i64_i32(ltid_pre_236525));\n    int32_t phys_tid_226050 = local_tid_236521;\n    __local unsigned char *red_arr_mem_236536;\n    \n    red_arr_mem_236536 = (__local unsigned char *) red_arr_mem_236536_backing_2;\n    \n    double x_226055;\n    \n    x_226055 = ((__local double *) color_232164)[gtid_226049];\n    \n    bool cond_226056 = sle64(x_226010, gtid_226049);\n    double defunc_0_f_res_226057;\n    \n    if (cond_226056) {\n        defunc_0_f_res_226057 = 0.0;\n    } else {\n        int64_t i_226058 = add64(x_226016, gtid_226049);\n        double defunc_0_add",
            "_arg_226059;\n        \n        defunc_0_add_arg_226059 = ((__global double *) mem_231528)[gtid_226005 *\n                                                                   n_203572 +\n                                                                   i_226058];\n        defunc_0_f_res_226057 = defunc_0_add_arg_226059;\n    }\n    \n    double x_226060 = a0_226047 * x_226055;\n    double defunc_9_fit_fun_res_226061 = defunc_0_f_res_226057 * x_226060;\n    \n    ((__local double *) red_arr_mem_236536)[gtid_226049] =\n        defunc_9_fit_fun_res_226061;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236538;\n    int32_t skip_waves_236539 = 1;\n    double x_226051;\n    double x_226052;\n    \n    offset_236538 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236521, sext_i64_i32(q_t_203576))) {\n            x_226051 = ((__local\n                         double *) red_arr_mem_236536)[sext_i32_i64(local_tid_236521 +\n                                                       offset_236538)];\n        }\n    }\n    offset_236538 = 1;\n    while (slt32(offset_236538, wave_sizze_236523)) {\n        if (slt32(local_tid_236521 + offset_236538, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236521 - squot32(local_tid_236521, wave_sizze_236523) *\n              wave_sizze_236523) & (2 * offset_236538 - 1)) == 0) {\n            // read array element\n            {\n                x_226052 = ((volatile __local\n                             double *) red_arr_mem_236536)[sext_i32_i64(local_tid_236521 +\n                                                           offset_236538)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226053 = x_226051 + x_226052;\n                \n                x_226051 = defunc_1_op_res_226053;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236536)[sext_i32_i64(local_tid_2",
            "36521)] =\n                    x_226051;\n            }\n        }\n        offset_236538 *= 2;\n    }\n    while (slt32(skip_waves_236539, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236523 - 1,\n                                            wave_sizze_236523))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236538 = skip_waves_236539 * wave_sizze_236523;\n        if (slt32(local_tid_236521 + offset_236538, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236521 - squot32(local_tid_236521, wave_sizze_236523) *\n              wave_sizze_236523) == 0 && (squot32(local_tid_236521,\n                                                  wave_sizze_236523) & (2 *\n                                                                        skip_waves_236539 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226052 = ((__local\n                             double *) red_arr_mem_236536)[sext_i32_i64(local_tid_236521 +\n                                                           offset_236538)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226053 = x_226051 + x_226052;\n                \n                x_226051 = defunc_1_op_res_226053;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236536)[sext_i32_i64(local_tid_236521)] =\n                    x_226051;\n            }\n        }\n        skip_waves_236539 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226048 = ((__local\n                                   double *) red_arr_mem_236536)[(int64_t) 0];\n    if (local_tid_236521 == 0) {\n        ((__global double *) mem_231538)[gtid_226005 * t_n_m_203740 +\n                                         gtid_226006] =\n            defunc_2_reduce_res_226048;\n    }\n    \n  error_",
            "4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226320(__global int *global_failure,\n                                             uint red_arr_mem_236582_backing_offset_0,\n                                             uint red_arr_mem_236580_backing_offset_1,\n                                             uint red_arr_mem_236576_backing_offset_2,\n                                             uint red_arr_mem_236574_backing_offset_3,\n                                             uint red_arr_mem_236572_backing_offset_4,\n                                             uint color_232166_backing_offset_5,\n                                             uint color_232165_backing_offset_6,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                                             int64_t i_203760, __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_229568,\n                                             __global\n                                             unsigned char *ext_mem_229569,\n                                             __global unsigned char *mem_231548,\n                                             __global unsigned char *mem_231552,\n                                             __global unsigned char *mem_231565,\n                                             __global unsigned char *mem_231569)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsi",
            "gned char *red_arr_mem_236582_backing_6 =\n                           &shared_mem[red_arr_mem_236582_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236580_backing_5 =\n                           &shared_mem[red_arr_mem_236580_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236576_backing_4 =\n                           &shared_mem[red_arr_mem_236576_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236574_backing_3 =\n                           &shared_mem[red_arr_mem_236574_backing_offset_3];\n    volatile unsigned char *red_arr_mem_236572_backing_2 =\n                           &shared_mem[red_arr_mem_236572_backing_offset_4];\n    volatile unsigned char *color_232166_backing_1 =\n                           &shared_mem[color_232166_backing_offset_5];\n    volatile unsigned char *color_232165_backing_0 =\n                           &shared_mem[color_232165_backing_offset_6];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236560;\n    int32_t local_tid_236561;\n    int64_t group_sizze_236564;\n    int32_t wave_sizze_236563;\n    int32_t group_tid_236562;\n    \n    global_tid_236560 = get_global_id(0);\n    local_tid_236561 = get_local_id(0);\n    group_sizze_236564 = get_local_size(0);\n    wave_sizze_236563 = LOCKSTEP_WIDTH;\n    group_tid_236562 = get_group_id(0);\n    \n    int32_t phys_tid_226320 = group_tid_236562;\n    int64_t slice_236566 = q_t_203576;\n    int64_t ltid_pre_236565 = sext_i32_i64(local_tid_236561);\n    int64_t remnant_236567 = sext_i32_i64(local_tid_236561) - ltid_pre_236565;\n    int64_t slice_236568 = t_n_m_203740;\n    int64_t slice_236569 = partition_sizze_203667 * slice_236568;\n    int64_t gtid_226318 = squot64(sext_i32_i64(group_tid_236562), slice_236568);\n    int64_t remnant_236570 = sext_i32_i64(group_tid_236562) - gtid_226318 *\n            slice_236568;\n    int64_t gtid_226319 = remnant_236570;\n    int64_t remnant_236571 = remnant_236570 - gtid_226319;\n    __local unsigned char *color_232165;\n   ",
            " \n    color_232165 = (__local unsigned char *) color_232165_backing_0;\n    \n    __local unsigned char *color_232166;\n    \n    color_232166 = (__local unsigned char *) color_232166_backing_1;\n    \n    int64_t x_226323;\n    \n    x_226323 = ((__global int64_t *) ext_mem_229304)[gtid_226318];\n    \n    int64_t x_226329;\n    \n    x_226329 = ((__global int64_t *) ext_mem_229569)[gtid_226318 *\n                                                     t_n_m_203740 +\n                                                     gtid_226319];\n    \n    double x_226330;\n    \n    x_226330 = ((__global double *) ext_mem_229568)[gtid_226318 * t_n_m_203740 +\n                                                    gtid_226319];\n    \n    int64_t min_arg_226331 = mul64(jump_t_203582, gtid_226319);\n    int64_t min_res_226332 = smin64(i_203760, min_arg_226331);\n    int64_t defunc_0_g_res_226333 = add64((int64_t) 1, min_res_226332);\n    double defunc_2_reduce_res_226334;\n    double defunc_2_reduce_res_226335;\n    double defunc_2_reduce_res_226336;\n    int64_t gtid_226339 = sext_i32_i64(sext_i64_i32(ltid_pre_236565));\n    int32_t phys_tid_226340 = local_tid_236561;\n    __local unsigned char *red_arr_mem_236572;\n    \n    red_arr_mem_236572 = (__local unsigned char *) red_arr_mem_236572_backing_2;\n    \n    __local unsigned char *red_arr_mem_236574;\n    \n    red_arr_mem_236574 = (__local unsigned char *) red_arr_mem_236574_backing_3;\n    \n    __local unsigned char *red_arr_mem_236576;\n    \n    red_arr_mem_236576 = (__local unsigned char *) red_arr_mem_236576_backing_4;\n    \n    bool cond_226351 = sle64(x_226323, gtid_226339);\n    int64_t defunc_0_f_res_226352;\n    \n    if (cond_226351) {\n        defunc_0_f_res_226352 = (int64_t) 0;\n    } else {\n        int64_t i_226353 = add64(x_226329, gtid_226339);\n        int64_t defunc_0_add_arg_226354;\n        \n        defunc_0_add_arg_226354 = ((__global\n                                    int64_t *) ext_mem_229305)[gtid_226318 *\n                                         ",
            "                      n_203572 +\n                                                               i_226353];\n        \n        int64_t defunc_1_add_res_226355 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226354);\n        \n        defunc_0_f_res_226352 = defunc_1_add_res_226355;\n    }\n    \n    double defunc_0_f_res_226356;\n    \n    if (cond_226351) {\n        defunc_0_f_res_226356 = 0.0;\n    } else {\n        int64_t i_226357 = add64(x_226329, gtid_226339);\n        double defunc_0_add_arg_226358;\n        \n        defunc_0_add_arg_226358 = ((__global double *) mem_231548)[gtid_226318 *\n                                                                   n_203572 +\n                                                                   i_226357];\n        defunc_0_f_res_226356 = defunc_0_add_arg_226358;\n    }\n    \n    int64_t binop_p_226359 = sub64(defunc_0_f_res_226352,\n                                   defunc_0_g_res_226333);\n    double defunc_0_f_res_226360 = sitofp_i64_f64(binop_p_226359);\n    double abs_res_226361 = fabs(defunc_0_f_res_226360);\n    double tmp1_226362 = abs_res_226361 / x_226330;\n    double x_226363 = tmp1_226362 * tmp1_226362;\n    double y_226364 = tmp1_226362 * x_226363;\n    double tmp2_226365 = 1.0 - y_226364;\n    double x_226366 = tmp2_226365 * tmp2_226365;\n    double tmp3_226367 = tmp2_226365 * x_226366;\n    double tmp4_226368 = defunc_0_f_res_226356 * tmp3_226367;\n    double defunc_1_f_res_226369 = defunc_0_f_res_226360 * tmp4_226368;\n    double defunc_1_f_res_226370 = defunc_0_f_res_226360 *\n           defunc_1_f_res_226369;\n    \n    ((__local double *) red_arr_mem_236572)[gtid_226339] = tmp4_226368;\n    ((__local double *) red_arr_mem_236574)[gtid_226339] =\n        defunc_1_f_res_226369;\n    ((__local double *) red_arr_mem_236576)[gtid_226339] =\n        defunc_1_f_res_226370;\n    ((__local double *) color_232166)[gtid_226339] = defunc_1_f_res_226369;\n    ((__local double *) color_232165)[gtid_226339] = tmp4_2263",
            "68;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236578;\n    int32_t skip_waves_236579 = 1;\n    double x_226341;\n    double x_226342;\n    double x_226343;\n    double x_226344;\n    double x_226345;\n    double x_226346;\n    \n    offset_236578 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236561, sext_i64_i32(q_t_203576))) {\n            x_226341 = ((__local\n                         double *) red_arr_mem_236572)[sext_i32_i64(local_tid_236561 +\n                                                       offset_236578)];\n            x_226342 = ((__local\n                         double *) red_arr_mem_236574)[sext_i32_i64(local_tid_236561 +\n                                                       offset_236578)];\n            x_226343 = ((__local\n                         double *) red_arr_mem_236576)[sext_i32_i64(local_tid_236561 +\n                                                       offset_236578)];\n        }\n    }\n    offset_236578 = 1;\n    while (slt32(offset_236578, wave_sizze_236563)) {\n        if (slt32(local_tid_236561 + offset_236578, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236561 - squot32(local_tid_236561, wave_sizze_236563) *\n              wave_sizze_236563) & (2 * offset_236578 - 1)) == 0) {\n            // read array element\n            {\n                x_226344 = ((volatile __local\n                             double *) red_arr_mem_236572)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236578)];\n                x_226345 = ((volatile __local\n                             double *) red_arr_mem_236574)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236578)];\n                x_226346 = ((volatile __local\n                             double *) red_arr_mem_236576)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236578)];\n            }\n            // ap",
            "ply reduction operation\n            {\n                double defunc_1_op_res_226347 = x_226341 + x_226344;\n                double defunc_1_op_res_226348 = x_226342 + x_226345;\n                double defunc_1_op_res_226349 = x_226343 + x_226346;\n                \n                x_226341 = defunc_1_op_res_226347;\n                x_226342 = defunc_1_op_res_226348;\n                x_226343 = defunc_1_op_res_226349;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236572)[sext_i32_i64(local_tid_236561)] =\n                    x_226341;\n                ((volatile __local\n                  double *) red_arr_mem_236574)[sext_i32_i64(local_tid_236561)] =\n                    x_226342;\n                ((volatile __local\n                  double *) red_arr_mem_236576)[sext_i32_i64(local_tid_236561)] =\n                    x_226343;\n            }\n        }\n        offset_236578 *= 2;\n    }\n    while (slt32(skip_waves_236579, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236563 - 1,\n                                            wave_sizze_236563))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236578 = skip_waves_236579 * wave_sizze_236563;\n        if (slt32(local_tid_236561 + offset_236578, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236561 - squot32(local_tid_236561, wave_sizze_236563) *\n              wave_sizze_236563) == 0 && (squot32(local_tid_236561,\n                                                  wave_sizze_236563) & (2 *\n                                                                        skip_waves_236579 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226344 = ((__local\n                             double *) red_arr_mem_236572)[sext_i32_i64(local_tid_236561 +\n                                        ",
            "                   offset_236578)];\n                x_226345 = ((__local\n                             double *) red_arr_mem_236574)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236578)];\n                x_226346 = ((__local\n                             double *) red_arr_mem_236576)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236578)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226347 = x_226341 + x_226344;\n                double defunc_1_op_res_226348 = x_226342 + x_226345;\n                double defunc_1_op_res_226349 = x_226343 + x_226346;\n                \n                x_226341 = defunc_1_op_res_226347;\n                x_226342 = defunc_1_op_res_226348;\n                x_226343 = defunc_1_op_res_226349;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236572)[sext_i32_i64(local_tid_236561)] =\n                    x_226341;\n                ((__local\n                  double *) red_arr_mem_236574)[sext_i32_i64(local_tid_236561)] =\n                    x_226342;\n                ((__local\n                  double *) red_arr_mem_236576)[sext_i32_i64(local_tid_236561)] =\n                    x_226343;\n            }\n        }\n        skip_waves_236579 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226334 = ((__local\n                                   double *) red_arr_mem_236572)[(int64_t) 0];\n    defunc_2_reduce_res_226335 = ((__local\n                                   double *) red_arr_mem_236574)[(int64_t) 0];\n    defunc_2_reduce_res_226336 = ((__local\n                                   double *) red_arr_mem_236576)[(int64_t) 0];\n    \n    double x_226371 = defunc_2_reduce_res_226334 * defunc_2_reduce_res_226336;\n    double y_226372 = defunc_2_reduce_res_226335 * defunc_2_reduce_res_226335;\n  ",
            "  double y_226373 = x_226371 - y_226372;\n    double det1_226374 = 1.0 / y_226373;\n    double a11_226375 = defunc_2_reduce_res_226336 * det1_226374;\n    double x_226376 = 0.0 - defunc_2_reduce_res_226335;\n    double b11_226377 = det1_226374 * x_226376;\n    double c11_226378 = defunc_2_reduce_res_226334 * det1_226374;\n    double defunc_2_reduce_res_226379;\n    double defunc_2_reduce_res_226380;\n    int64_t gtid_226381 = sext_i32_i64(sext_i64_i32(ltid_pre_236565));\n    int32_t phys_tid_226382 = local_tid_236561;\n    __local unsigned char *red_arr_mem_236580;\n    \n    red_arr_mem_236580 = (__local unsigned char *) red_arr_mem_236580_backing_5;\n    \n    __local unsigned char *red_arr_mem_236582;\n    \n    red_arr_mem_236582 = (__local unsigned char *) red_arr_mem_236582_backing_6;\n    \n    double x_226390;\n    \n    x_226390 = ((__local double *) color_232165)[gtid_226381];\n    \n    double x_226391;\n    \n    x_226391 = ((__local double *) color_232166)[gtid_226381];\n    \n    bool cond_226392 = sle64(x_226323, gtid_226381);\n    double defunc_0_f_res_226393;\n    \n    if (cond_226392) {\n        defunc_0_f_res_226393 = 0.0;\n    } else {\n        int64_t i_226394 = add64(x_226329, gtid_226381);\n        double defunc_0_add_arg_226395;\n        \n        defunc_0_add_arg_226395 = ((__global double *) mem_231552)[gtid_226318 *\n                                                                   n_203572 +\n                                                                   i_226394];\n        defunc_0_f_res_226393 = defunc_0_add_arg_226395;\n    }\n    \n    double x_226396 = a11_226375 * x_226390;\n    double y_226397 = b11_226377 * x_226391;\n    double x_226398 = x_226396 + y_226397;\n    double defunc_9_fit_fun_res_226399 = defunc_0_f_res_226393 * x_226398;\n    double x_226400 = b11_226377 * x_226390;\n    double y_226401 = c11_226378 * x_226391;\n    double x_226402 = x_226400 + y_226401;\n    double defunc_9_slope_fun_res_226403 = defunc_0_f_res_226393 * x_226402;\n    \n    ((__local double *",
            ") red_arr_mem_236580)[gtid_226381] =\n        defunc_9_fit_fun_res_226399;\n    ((__local double *) red_arr_mem_236582)[gtid_226381] =\n        defunc_9_slope_fun_res_226403;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236584;\n    int32_t skip_waves_236585 = 1;\n    double x_226383;\n    double x_226384;\n    double x_226385;\n    double x_226386;\n    \n    offset_236584 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236561, sext_i64_i32(q_t_203576))) {\n            x_226383 = ((__local\n                         double *) red_arr_mem_236580)[sext_i32_i64(local_tid_236561 +\n                                                       offset_236584)];\n            x_226384 = ((__local\n                         double *) red_arr_mem_236582)[sext_i32_i64(local_tid_236561 +\n                                                       offset_236584)];\n        }\n    }\n    offset_236584 = 1;\n    while (slt32(offset_236584, wave_sizze_236563)) {\n        if (slt32(local_tid_236561 + offset_236584, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236561 - squot32(local_tid_236561, wave_sizze_236563) *\n              wave_sizze_236563) & (2 * offset_236584 - 1)) == 0) {\n            // read array element\n            {\n                x_226385 = ((volatile __local\n                             double *) red_arr_mem_236580)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236584)];\n                x_226386 = ((volatile __local\n                             double *) red_arr_mem_236582)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236584)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226387 = x_226383 + x_226385;\n                double defunc_1_op_res_226388 = x_226384 + x_226386;\n                \n                x_226383 = defunc_1_op_res_226387;\n                x_226384 = defunc_1",
            "_op_res_226388;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236580)[sext_i32_i64(local_tid_236561)] =\n                    x_226383;\n                ((volatile __local\n                  double *) red_arr_mem_236582)[sext_i32_i64(local_tid_236561)] =\n                    x_226384;\n            }\n        }\n        offset_236584 *= 2;\n    }\n    while (slt32(skip_waves_236585, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236563 - 1,\n                                            wave_sizze_236563))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236584 = skip_waves_236585 * wave_sizze_236563;\n        if (slt32(local_tid_236561 + offset_236584, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236561 - squot32(local_tid_236561, wave_sizze_236563) *\n              wave_sizze_236563) == 0 && (squot32(local_tid_236561,\n                                                  wave_sizze_236563) & (2 *\n                                                                        skip_waves_236585 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226385 = ((__local\n                             double *) red_arr_mem_236580)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236584)];\n                x_226386 = ((__local\n                             double *) red_arr_mem_236582)[sext_i32_i64(local_tid_236561 +\n                                                           offset_236584)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226387 = x_226383 + x_226385;\n                double defunc_1_op_res_226388 = x_226384 + x_226386;\n                \n                x_226383 = defunc_1_op_res_226387;\n                x_226384 = defu",
            "nc_1_op_res_226388;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236580)[sext_i32_i64(local_tid_236561)] =\n                    x_226383;\n                ((__local\n                  double *) red_arr_mem_236582)[sext_i32_i64(local_tid_236561)] =\n                    x_226384;\n            }\n        }\n        skip_waves_236585 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226379 = ((__local\n                                   double *) red_arr_mem_236580)[(int64_t) 0];\n    defunc_2_reduce_res_226380 = ((__local\n                                   double *) red_arr_mem_236582)[(int64_t) 0];\n    if (local_tid_236561 == 0) {\n        ((__global double *) mem_231565)[gtid_226318 * t_n_m_203740 +\n                                         gtid_226319] =\n            defunc_2_reduce_res_226379;\n    }\n    if (local_tid_236561 == 0) {\n        ((__global double *) mem_231569)[gtid_226318 * t_n_m_203740 +\n                                         gtid_226319] =\n            defunc_2_reduce_res_226380;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226724(__global int *global_failure,\n                                             uint red_arr_mem_236632_backing_offset_0,\n                                             uint red_arr_mem_236630_backing_offset_1,\n                                             uint red_arr_mem_236626_backing_offset_2,\n                                             uint red_arr_mem_236624_backing_offset_3,\n                                             uint red_arr_mem_236622_backing_offset_4,\n                                             uint red_arr_mem_236620_backing_offset_5,\n                                             uint red_arr_mem_236618_backing_offset_6,\n                                             uint color_232170_backing_offset_7,\n                                             uint color_232169_backing_offset_8,\n         ",
            "                                    uint color_232168_backing_offset_9,\n                                             uint color_232167_backing_offset_10,\n                                             int64_t n_203572,\n                                             int64_t q_t_203576,\n                                             int64_t jump_t_203582,\n                                             int64_t partition_sizze_203667,\n                                             int64_t t_n_m_203740,\n                                             int64_t i_203760, __global\n                                             unsigned char *ext_mem_229304,\n                                             __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_229568,\n                                             __global\n                                             unsigned char *ext_mem_229569,\n                                             __global unsigned char *mem_231579,\n                                             __global unsigned char *mem_231583,\n                                             __global unsigned char *mem_231603,\n                                             __global unsigned char *mem_231607)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236632_backing_10 =\n                           &shared_mem[red_arr_mem_236632_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236630_backing_9 =\n                           &shared_mem[red_arr_mem_236630_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236626_backing_8 =\n                           &shared_mem[red_arr_mem_236626_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236624_backing_7 =\n                           &shared_mem[red_arr_mem_236624_backing_offset_3];\n    vol",
            "atile unsigned char *red_arr_mem_236622_backing_6 =\n                           &shared_mem[red_arr_mem_236622_backing_offset_4];\n    volatile unsigned char *red_arr_mem_236620_backing_5 =\n                           &shared_mem[red_arr_mem_236620_backing_offset_5];\n    volatile unsigned char *red_arr_mem_236618_backing_4 =\n                           &shared_mem[red_arr_mem_236618_backing_offset_6];\n    volatile unsigned char *color_232170_backing_3 =\n                           &shared_mem[color_232170_backing_offset_7];\n    volatile unsigned char *color_232169_backing_2 =\n                           &shared_mem[color_232169_backing_offset_8];\n    volatile unsigned char *color_232168_backing_1 =\n                           &shared_mem[color_232168_backing_offset_9];\n    volatile unsigned char *color_232167_backing_0 =\n                           &shared_mem[color_232167_backing_offset_10];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236606;\n    int32_t local_tid_236607;\n    int64_t group_sizze_236610;\n    int32_t wave_sizze_236609;\n    int32_t group_tid_236608;\n    \n    global_tid_236606 = get_global_id(0);\n    local_tid_236607 = get_local_id(0);\n    group_sizze_236610 = get_local_size(0);\n    wave_sizze_236609 = LOCKSTEP_WIDTH;\n    group_tid_236608 = get_group_id(0);\n    \n    int32_t phys_tid_226724 = group_tid_236608;\n    int64_t slice_236612 = q_t_203576;\n    int64_t ltid_pre_236611 = sext_i32_i64(local_tid_236607);\n    int64_t remnant_236613 = sext_i32_i64(local_tid_236607) - ltid_pre_236611;\n    int64_t slice_236614 = t_n_m_203740;\n    int64_t slice_236615 = partition_sizze_203667 * slice_236614;\n    int64_t gtid_226722 = squot64(sext_i32_i64(group_tid_236608), slice_236614);\n    int64_t remnant_236616 = sext_i32_i64(group_tid_236608) - gtid_226722 *\n            slice_236614;\n    int64_t gtid_226723 = remnant_236616;\n    int64_t remnant_236617 = remnant_236616 - gtid_226723;\n    __local unsigned char *color_232167;\n    \n    color_2",
            "32167 = (__local unsigned char *) color_232167_backing_0;\n    \n    __local unsigned char *color_232168;\n    \n    color_232168 = (__local unsigned char *) color_232168_backing_1;\n    \n    __local unsigned char *color_232169;\n    \n    color_232169 = (__local unsigned char *) color_232169_backing_2;\n    \n    __local unsigned char *color_232170;\n    \n    color_232170 = (__local unsigned char *) color_232170_backing_3;\n    \n    int64_t x_226727;\n    \n    x_226727 = ((__global int64_t *) ext_mem_229304)[gtid_226722];\n    \n    int64_t x_226733;\n    \n    x_226733 = ((__global int64_t *) ext_mem_229569)[gtid_226722 *\n                                                     t_n_m_203740 +\n                                                     gtid_226723];\n    \n    double x_226734;\n    \n    x_226734 = ((__global double *) ext_mem_229568)[gtid_226722 * t_n_m_203740 +\n                                                    gtid_226723];\n    \n    int64_t min_arg_226735 = mul64(jump_t_203582, gtid_226723);\n    int64_t min_res_226736 = smin64(i_203760, min_arg_226735);\n    int64_t defunc_0_g_res_226737 = add64((int64_t) 1, min_res_226736);\n    int64_t gtid_226740 = sext_i32_i64(sext_i64_i32(ltid_pre_236611));\n    int32_t phys_tid_226741 = local_tid_236607;\n    bool cond_226743 = sle64(x_226727, gtid_226740);\n    int64_t defunc_0_f_res_226744;\n    \n    if (cond_226743) {\n        defunc_0_f_res_226744 = (int64_t) 0;\n    } else {\n        int64_t i_226745 = add64(x_226733, gtid_226740);\n        int64_t defunc_0_add_arg_226746;\n        \n        defunc_0_add_arg_226746 = ((__global\n                                    int64_t *) ext_mem_229305)[gtid_226722 *\n                                                               n_203572 +\n                                                               i_226745];\n        \n        int64_t defunc_1_add_res_226747 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226746);\n        \n        defunc_0_f_res_226744 = defunc_1_add",
            "_res_226747;\n    }\n    \n    double defunc_0_f_res_226748;\n    \n    if (cond_226743) {\n        defunc_0_f_res_226748 = 0.0;\n    } else {\n        int64_t i_226749 = add64(x_226733, gtid_226740);\n        double defunc_0_add_arg_226750;\n        \n        defunc_0_add_arg_226750 = ((__global double *) mem_231579)[gtid_226722 *\n                                                                   n_203572 +\n                                                                   i_226749];\n        defunc_0_f_res_226748 = defunc_0_add_arg_226750;\n    }\n    \n    int64_t binop_p_226751 = sub64(defunc_0_f_res_226744,\n                                   defunc_0_g_res_226737);\n    double defunc_0_f_res_226752 = sitofp_i64_f64(binop_p_226751);\n    double abs_res_226753 = fabs(defunc_0_f_res_226752);\n    double tmp1_226754 = abs_res_226753 / x_226734;\n    double x_226755 = tmp1_226754 * tmp1_226754;\n    double y_226756 = tmp1_226754 * x_226755;\n    double tmp2_226757 = 1.0 - y_226756;\n    double x_226758 = tmp2_226757 * tmp2_226757;\n    double tmp3_226759 = tmp2_226757 * x_226758;\n    double tmp4_226760 = defunc_0_f_res_226748 * tmp3_226759;\n    \n    ((__local double *) color_232170)[gtid_226740] = defunc_0_f_res_226752;\n    ((__local double *) color_232169)[gtid_226740] = tmp4_226760;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_226761;\n    double defunc_2_reduce_res_226762;\n    double defunc_2_reduce_res_226763;\n    double defunc_2_reduce_res_226764;\n    double defunc_2_reduce_res_226765;\n    int64_t gtid_226768 = sext_i32_i64(sext_i64_i32(ltid_pre_236611));\n    int32_t phys_tid_226769 = local_tid_236607;\n    __local unsigned char *red_arr_mem_236618;\n    \n    red_arr_mem_236618 = (__local unsigned char *) red_arr_mem_236618_backing_4;\n    \n    __local unsigned char *red_arr_mem_236620;\n    \n    red_arr_mem_236620 = (__local unsigned char *) red_arr_mem_236620_backing_5;\n    \n    __local unsigned char *red_arr_mem_236622;\n    \n    red_arr_mem_236622 = (__local un",
            "signed char *) red_arr_mem_236622_backing_6;\n    \n    __local unsigned char *red_arr_mem_236624;\n    \n    red_arr_mem_236624 = (__local unsigned char *) red_arr_mem_236624_backing_7;\n    \n    __local unsigned char *red_arr_mem_236626;\n    \n    red_arr_mem_236626 = (__local unsigned char *) red_arr_mem_236626_backing_8;\n    \n    double x_226785;\n    \n    x_226785 = ((__local double *) color_232170)[gtid_226768];\n    \n    double x_226786;\n    \n    x_226786 = ((__local double *) color_232169)[gtid_226768];\n    \n    double defunc_1_f_res_226787 = x_226785 * x_226786;\n    double defunc_1_f_res_226788 = x_226785 * defunc_1_f_res_226787;\n    double defunc_1_f_res_226789 = x_226785 * defunc_1_f_res_226788;\n    double defunc_1_f_res_226790 = x_226785 * defunc_1_f_res_226789;\n    \n    ((__local double *) red_arr_mem_236618)[gtid_226768] = x_226786;\n    ((__local double *) red_arr_mem_236620)[gtid_226768] =\n        defunc_1_f_res_226787;\n    ((__local double *) red_arr_mem_236622)[gtid_226768] =\n        defunc_1_f_res_226788;\n    ((__local double *) red_arr_mem_236624)[gtid_226768] =\n        defunc_1_f_res_226789;\n    ((__local double *) red_arr_mem_236626)[gtid_226768] =\n        defunc_1_f_res_226790;\n    ((__local double *) color_232168)[gtid_226768] = defunc_1_f_res_226788;\n    ((__local double *) color_232167)[gtid_226768] = defunc_1_f_res_226787;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236628;\n    int32_t skip_waves_236629 = 1;\n    double x_226770;\n    double x_226771;\n    double x_226772;\n    double x_226773;\n    double x_226774;\n    double x_226775;\n    double x_226776;\n    double x_226777;\n    double x_226778;\n    double x_226779;\n    \n    offset_236628 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236607, sext_i64_i32(q_t_203576))) {\n            x_226770 = ((__local\n                         double *) red_arr_mem_236618)[sext_i32_i64(local_tid_236607 +\n                                                     ",
            "  offset_236628)];\n            x_226771 = ((__local\n                         double *) red_arr_mem_236620)[sext_i32_i64(local_tid_236607 +\n                                                       offset_236628)];\n            x_226772 = ((__local\n                         double *) red_arr_mem_236622)[sext_i32_i64(local_tid_236607 +\n                                                       offset_236628)];\n            x_226773 = ((__local\n                         double *) red_arr_mem_236624)[sext_i32_i64(local_tid_236607 +\n                                                       offset_236628)];\n            x_226774 = ((__local\n                         double *) red_arr_mem_236626)[sext_i32_i64(local_tid_236607 +\n                                                       offset_236628)];\n        }\n    }\n    offset_236628 = 1;\n    while (slt32(offset_236628, wave_sizze_236609)) {\n        if (slt32(local_tid_236607 + offset_236628, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236607 - squot32(local_tid_236607, wave_sizze_236609) *\n              wave_sizze_236609) & (2 * offset_236628 - 1)) == 0) {\n            // read array element\n            {\n                x_226775 = ((volatile __local\n                             double *) red_arr_mem_236618)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226776 = ((volatile __local\n                             double *) red_arr_mem_236620)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226777 = ((volatile __local\n                             double *) red_arr_mem_236622)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226778 = ((volatile __local\n                             double *) red_arr_mem_236624)[sext_i32_i64(local_tid_236607 +\n                                                           offset_2",
            "36628)];\n                x_226779 = ((volatile __local\n                             double *) red_arr_mem_236626)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226780 = x_226770 + x_226775;\n                double defunc_1_op_res_226781 = x_226771 + x_226776;\n                double defunc_1_op_res_226782 = x_226772 + x_226777;\n                double defunc_1_op_res_226783 = x_226773 + x_226778;\n                double defunc_1_op_res_226784 = x_226774 + x_226779;\n                \n                x_226770 = defunc_1_op_res_226780;\n                x_226771 = defunc_1_op_res_226781;\n                x_226772 = defunc_1_op_res_226782;\n                x_226773 = defunc_1_op_res_226783;\n                x_226774 = defunc_1_op_res_226784;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236618)[sext_i32_i64(local_tid_236607)] =\n                    x_226770;\n                ((volatile __local\n                  double *) red_arr_mem_236620)[sext_i32_i64(local_tid_236607)] =\n                    x_226771;\n                ((volatile __local\n                  double *) red_arr_mem_236622)[sext_i32_i64(local_tid_236607)] =\n                    x_226772;\n                ((volatile __local\n                  double *) red_arr_mem_236624)[sext_i32_i64(local_tid_236607)] =\n                    x_226773;\n                ((volatile __local\n                  double *) red_arr_mem_236626)[sext_i32_i64(local_tid_236607)] =\n                    x_226774;\n            }\n        }\n        offset_236628 *= 2;\n    }\n    while (slt32(skip_waves_236629, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236609 - 1,\n                                            wave_sizze_236609))) {\n        barrier(CLK_LOCAL",
            "_MEM_FENCE);\n        offset_236628 = skip_waves_236629 * wave_sizze_236609;\n        if (slt32(local_tid_236607 + offset_236628, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236607 - squot32(local_tid_236607, wave_sizze_236609) *\n              wave_sizze_236609) == 0 && (squot32(local_tid_236607,\n                                                  wave_sizze_236609) & (2 *\n                                                                        skip_waves_236629 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226775 = ((__local\n                             double *) red_arr_mem_236618)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226776 = ((__local\n                             double *) red_arr_mem_236620)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226777 = ((__local\n                             double *) red_arr_mem_236622)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226778 = ((__local\n                             double *) red_arr_mem_236624)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n                x_226779 = ((__local\n                             double *) red_arr_mem_236626)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236628)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226780 = x_226770 + x_226775;\n                double defunc_1_op_res_226781 = x_226771 + x_226776;\n                double defunc_1_op_res_226782 = x_226772 + x_226777;\n                double defunc_1_op_res_226783 = x_226773 + x_226778;\n                ",
            "double defunc_1_op_res_226784 = x_226774 + x_226779;\n                \n                x_226770 = defunc_1_op_res_226780;\n                x_226771 = defunc_1_op_res_226781;\n                x_226772 = defunc_1_op_res_226782;\n                x_226773 = defunc_1_op_res_226783;\n                x_226774 = defunc_1_op_res_226784;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236618)[sext_i32_i64(local_tid_236607)] =\n                    x_226770;\n                ((__local\n                  double *) red_arr_mem_236620)[sext_i32_i64(local_tid_236607)] =\n                    x_226771;\n                ((__local\n                  double *) red_arr_mem_236622)[sext_i32_i64(local_tid_236607)] =\n                    x_226772;\n                ((__local\n                  double *) red_arr_mem_236624)[sext_i32_i64(local_tid_236607)] =\n                    x_226773;\n                ((__local\n                  double *) red_arr_mem_236626)[sext_i32_i64(local_tid_236607)] =\n                    x_226774;\n            }\n        }\n        skip_waves_236629 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226761 = ((__local\n                                   double *) red_arr_mem_236618)[(int64_t) 0];\n    defunc_2_reduce_res_226762 = ((__local\n                                   double *) red_arr_mem_236620)[(int64_t) 0];\n    defunc_2_reduce_res_226763 = ((__local\n                                   double *) red_arr_mem_236622)[(int64_t) 0];\n    defunc_2_reduce_res_226764 = ((__local\n                                   double *) red_arr_mem_236624)[(int64_t) 0];\n    defunc_2_reduce_res_226765 = ((__local\n                                   double *) red_arr_mem_236626)[(int64_t) 0];\n    \n    double x_226791 = defunc_2_reduce_res_226763 * defunc_2_reduce_res_226765;\n    double y_226792 = defunc_2_reduce_res_226764 * defunc_2_reduce_res_226764;\n    double a12_226793 = x_226791 - y_226792;\n  ",
            "  double x_226794 = defunc_2_reduce_res_226763 * defunc_2_reduce_res_226764;\n    double y_226795 = defunc_2_reduce_res_226762 * defunc_2_reduce_res_226765;\n    double b12_226796 = x_226794 - y_226795;\n    double x_226797 = defunc_2_reduce_res_226762 * defunc_2_reduce_res_226764;\n    double y_226798 = defunc_2_reduce_res_226763 * defunc_2_reduce_res_226763;\n    double c12_226799 = x_226797 - y_226798;\n    double x_226800 = defunc_2_reduce_res_226761 * defunc_2_reduce_res_226765;\n    double b2_226801 = x_226800 - y_226798;\n    double x_226802 = defunc_2_reduce_res_226762 * defunc_2_reduce_res_226763;\n    double y_226803 = defunc_2_reduce_res_226761 * defunc_2_reduce_res_226764;\n    double c2_226804 = x_226802 - y_226803;\n    double x_226805 = defunc_2_reduce_res_226761 * a12_226793;\n    double y_226806 = defunc_2_reduce_res_226762 * b12_226796;\n    double x_226807 = x_226805 + y_226806;\n    double y_226808 = defunc_2_reduce_res_226763 * c12_226799;\n    double y_226809 = x_226807 + y_226808;\n    double det_226810 = 1.0 / y_226809;\n    double a12_226811 = a12_226793 * det_226810;\n    double b12_226812 = b12_226796 * det_226810;\n    double c12_226813 = c12_226799 * det_226810;\n    double b2_226814 = b2_226801 * det_226810;\n    double c2_226815 = c2_226804 * det_226810;\n    double defunc_2_reduce_res_226816;\n    double defunc_2_reduce_res_226817;\n    int64_t gtid_226818 = sext_i32_i64(sext_i64_i32(ltid_pre_236611));\n    int32_t phys_tid_226819 = local_tid_236607;\n    __local unsigned char *red_arr_mem_236630;\n    \n    red_arr_mem_236630 = (__local unsigned char *) red_arr_mem_236630_backing_9;\n    \n    __local unsigned char *red_arr_mem_236632;\n    \n    red_arr_mem_236632 = (__local\n                          unsigned char *) red_arr_mem_236632_backing_10;\n    \n    double x_226827;\n    \n    x_226827 = ((__local double *) color_232169)[gtid_226818];\n    \n    double x_226828;\n    \n    x_226828 = ((__local double *) color_232167)[gtid_226818];\n    \n    double x_226829;\n    \n ",
            "   x_226829 = ((__local double *) color_232168)[gtid_226818];\n    \n    bool cond_226830 = sle64(x_226727, gtid_226818);\n    double defunc_0_f_res_226831;\n    \n    if (cond_226830) {\n        defunc_0_f_res_226831 = 0.0;\n    } else {\n        int64_t i_226832 = add64(x_226733, gtid_226818);\n        double defunc_0_add_arg_226833;\n        \n        defunc_0_add_arg_226833 = ((__global double *) mem_231583)[gtid_226722 *\n                                                                   n_203572 +\n                                                                   i_226832];\n        defunc_0_f_res_226831 = defunc_0_add_arg_226833;\n    }\n    \n    double x_226834 = a12_226811 * x_226827;\n    double y_226835 = b12_226812 * x_226828;\n    double x_226836 = x_226834 + y_226835;\n    double y_226837 = c12_226813 * x_226829;\n    double x_226838 = x_226836 + y_226837;\n    double defunc_9_fit_fun_res_226839 = defunc_0_f_res_226831 * x_226838;\n    double x_226840 = b12_226812 * x_226827;\n    double y_226841 = b2_226814 * x_226828;\n    double x_226842 = x_226840 + y_226841;\n    double y_226843 = c2_226815 * x_226829;\n    double x_226844 = x_226842 + y_226843;\n    double defunc_9_slope_fun_res_226845 = defunc_0_f_res_226831 * x_226844;\n    \n    ((__local double *) red_arr_mem_236630)[gtid_226818] =\n        defunc_9_fit_fun_res_226839;\n    ((__local double *) red_arr_mem_236632)[gtid_226818] =\n        defunc_9_slope_fun_res_226845;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236634;\n    int32_t skip_waves_236635 = 1;\n    double x_226820;\n    double x_226821;\n    double x_226822;\n    double x_226823;\n    \n    offset_236634 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236607, sext_i64_i32(q_t_203576))) {\n            x_226820 = ((__local\n                         double *) red_arr_mem_236630)[sext_i32_i64(local_tid_236607 +\n                                                       offset_236634)];\n            x_226821 = ((__local\n   ",
            "                      double *) red_arr_mem_236632)[sext_i32_i64(local_tid_236607 +\n                                                       offset_236634)];\n        }\n    }\n    offset_236634 = 1;\n    while (slt32(offset_236634, wave_sizze_236609)) {\n        if (slt32(local_tid_236607 + offset_236634, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236607 - squot32(local_tid_236607, wave_sizze_236609) *\n              wave_sizze_236609) & (2 * offset_236634 - 1)) == 0) {\n            // read array element\n            {\n                x_226822 = ((volatile __local\n                             double *) red_arr_mem_236630)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236634)];\n                x_226823 = ((volatile __local\n                             double *) red_arr_mem_236632)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236634)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226824 = x_226820 + x_226822;\n                double defunc_1_op_res_226825 = x_226821 + x_226823;\n                \n                x_226820 = defunc_1_op_res_226824;\n                x_226821 = defunc_1_op_res_226825;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236630)[sext_i32_i64(local_tid_236607)] =\n                    x_226820;\n                ((volatile __local\n                  double *) red_arr_mem_236632)[sext_i32_i64(local_tid_236607)] =\n                    x_226821;\n            }\n        }\n        offset_236634 *= 2;\n    }\n    while (slt32(skip_waves_236635, squot32(sext_i64_i32(q_t_203576) +\n                                            wave_sizze_236609 - 1,\n                                            wave_sizze_236609))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236634 = skip_waves_236635 * wave_sizze_236",
            "609;\n        if (slt32(local_tid_236607 + offset_236634, sext_i64_i32(q_t_203576)) &&\n            ((local_tid_236607 - squot32(local_tid_236607, wave_sizze_236609) *\n              wave_sizze_236609) == 0 && (squot32(local_tid_236607,\n                                                  wave_sizze_236609) & (2 *\n                                                                        skip_waves_236635 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226822 = ((__local\n                             double *) red_arr_mem_236630)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236634)];\n                x_226823 = ((__local\n                             double *) red_arr_mem_236632)[sext_i32_i64(local_tid_236607 +\n                                                           offset_236634)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226824 = x_226820 + x_226822;\n                double defunc_1_op_res_226825 = x_226821 + x_226823;\n                \n                x_226820 = defunc_1_op_res_226824;\n                x_226821 = defunc_1_op_res_226825;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236630)[sext_i32_i64(local_tid_236607)] =\n                    x_226820;\n                ((__local\n                  double *) red_arr_mem_236632)[sext_i32_i64(local_tid_236607)] =\n                    x_226821;\n            }\n        }\n        skip_waves_236635 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226816 = ((__local\n                                   double *) red_arr_mem_236630)[(int64_t) 0];\n    defunc_2_reduce_res_226817 = ((__local\n                                   double *) red_arr_mem_236632)[(int64_t) 0];\n    if (local_tid_236607 == 0) {\n",
            "        ((__global double *) mem_231603)[gtid_226722 * t_n_m_203740 +\n                                         gtid_226723] =\n            defunc_2_reduce_res_226816;\n    }\n    if (local_tid_236607 == 0) {\n        ((__global double *) mem_231607)[gtid_226722 * t_n_m_203740 +\n                                         gtid_226723] =\n            defunc_2_reduce_res_226817;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227074(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             uint color_232172_backing_offset_0,\n                                             uint color_232171_backing_offset_1,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t ext_231630, __global\n                                             unsigned char *mem_229269, __global\n                                             unsigned char *ext_mem_229305,\n                                             __global\n                                             unsigned char *ext_mem_231625,\n                                             __global\n                                             unsigned char *ext_mem_231626,\n                                             __global unsigned char *mem_231653,\n                                             __global unsigned char *mem_231657)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232172_backing_1 =\n                           &shared_mem[color_232172_backing_offset_0];\n    volatile unsigned char *color_232171_backing_0 =\n                           &shared_mem[color_232171_backing_offset_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_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_227074 = group_tid_236648;\n    int64_t slice_236652 = n_203572;\n    int64_t ltid_pre_236651 = sext_i32_i64(local_tid_236647);\n    int64_t remnant_236653 = sext_i32_i64(local_tid_236647) - ltid_pre_236651;\n    int64_t slice_236654 = partition_sizze_203667;\n    int64_t gtid_227073 = sext_i32_i64(group_tid_236648);\n    int64_t remnant_236655 = sext_i32_i64(group_tid_236648) - gtid_227073;\n    __local unsigned char *color_232171;\n    \n    color_232171 = (__local unsigned char *) color_232171_backing_0;\n    \n    __local unsigned char *color_232172;\n    \n    color_232172 = (__local unsigned char *) color_232172_backing_1;\n    \n    int64_t gtid_227084 = sext_i32_i64(sext_i64_i32(ltid_pre_236651));\n    int32_t phys_tid_227085 = local_tid_236647;\n    double x_227086;\n    \n    x_227086 = ((__global double *) mem_229269)[gtid_227073 * n_203572 +\n                                                gtid_227084];\n    \n    double x_227087;\n    \n    x_227087 = ((__global double *) ext_mem_231626)[gtid_227073 * n_203572 +\n                                                    gtid_227084];\n    \n    double x_227088;\n    \n    x_227088 = ((__global double *) ext_mem_231625)[gtid_227073 * ext_231630 +\n                                                    gtid_227084];\n    \n    double x_227089 = x_227086 - x_227087;\n    double defunc_2_f_res_227090 = x_227089 - x_227088;\n    bool isnan_res_227091;\n    \n    isnan_res_227091 = futrts_isnan64(de",
            "func_2_f_res_227090);\n    \n    double defunc_0_f_res_227092;\n    \n    if (isnan_res_227091) {\n        defunc_0_f_res_227092 = defunc_2_f_res_227090;\n    } else {\n        double abs_res_227093 = fabs(defunc_2_f_res_227090);\n        \n        defunc_0_f_res_227092 = abs_res_227093;\n    }\n    ((__local double *) color_232172)[gtid_227084] = defunc_0_f_res_227092;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_227095 = sext_i32_i64(sext_i64_i32(ltid_pre_236651));\n    int32_t phys_tid_227096 = local_tid_236647;\n    int64_t x_227097;\n    \n    x_227097 = ((__global int64_t *) ext_mem_229305)[gtid_227073 * n_203572 +\n                                                     gtid_227095];\n    \n    bool cond_227098 = sle64((int64_t) 0, x_227097);\n    double defunc_0_f_res_227099;\n    \n    if (cond_227098) {\n        bool y_227100 = slt64(x_227097, n_203572);\n        bool bounds_check_227101 = cond_227098 && y_227100;\n        bool index_certs_227102;\n        \n        if (!bounds_check_227101) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 72) == -1) {\n                    global_failure_args[0] = (int64_t) x_227097;\n                    global_failure_args[1] = (int64_t) n_203572;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        double defunc_0_f_res_t_res_227103;\n        \n        defunc_0_f_res_t_res_227103 = ((__local\n                                        double *) color_232172)[x_227097];\n        defunc_0_f_res_227099 = defunc_0_f_res_t_res_227103;\n    } else {\n        defunc_0_f_res_227099 = INFINITY;\n    }\n    ((__local double *) color_232171)[gtid_227095] = defunc_0_f_res_227099;\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236656;\n    \n    tmp_236656 = ((__local\n                   double *) color_232171)[sext_i32_i64(local_tid_236647)];\n  ",
            "  ((__global double *) mem_231653)[gtid_227073 * n_203572 +\n                                     sext_i32_i64(local_tid_236647)] =\n        tmp_236656;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236657;\n    \n    tmp_236657 = ((__local\n                   double *) color_232172)[sext_i32_i64(local_tid_236647)];\n    ((__global double *) mem_231657)[gtid_227073 * n_203572 +\n                                     sext_i32_i64(local_tid_236647)] =\n        tmp_236657;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227449(__global int *global_failure,\n                                             uint color_232187_backing_offset_0,\n                                             uint color_232186_backing_offset_1,\n                                             uint color_232185_backing_offset_2,\n                                             uint color_232184_backing_offset_3,\n                                             uint color_232183_backing_offset_4,\n                                             uint color_232182_backing_offset_5,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t i_203760,\n                                             int32_t iters_206755, __global\n                                             unsigned char *ext_mem_231669,\n                                             __global unsigned char *mem_231829,\n                                             __global\n                                             unsigned char *color_232180,\n                                             __global\n                                             unsigned char *color_232181)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232187_backing_5 =\n                           &shared_mem[color_232187_backing_offs",
            "et_0];\n    volatile unsigned char *color_232186_backing_4 =\n                           &shared_mem[color_232186_backing_offset_1];\n    volatile unsigned char *color_232185_backing_3 =\n                           &shared_mem[color_232185_backing_offset_2];\n    volatile unsigned char *color_232184_backing_2 =\n                           &shared_mem[color_232184_backing_offset_3];\n    volatile unsigned char *color_232183_backing_1 =\n                           &shared_mem[color_232183_backing_offset_4];\n    volatile unsigned char *color_232182_backing_0 =\n                           &shared_mem[color_232182_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236713;\n    int32_t local_tid_236714;\n    int64_t group_sizze_236717;\n    int32_t wave_sizze_236716;\n    int32_t group_tid_236715;\n    \n    global_tid_236713 = get_global_id(0);\n    local_tid_236714 = get_local_id(0);\n    group_sizze_236717 = get_local_size(0);\n    wave_sizze_236716 = LOCKSTEP_WIDTH;\n    group_tid_236715 = get_group_id(0);\n    \n    int32_t phys_tid_227449 = group_tid_236715;\n    int64_t slice_236719 = n_203572;\n    int64_t ltid_pre_236718 = sext_i32_i64(local_tid_236714);\n    int64_t remnant_236720 = sext_i32_i64(local_tid_236714) - ltid_pre_236718;\n    int64_t slice_236721 = partition_sizze_203667;\n    int64_t gtid_227448 = sext_i32_i64(group_tid_236715);\n    int64_t remnant_236722 = sext_i32_i64(group_tid_236715) - gtid_227448;\n    __local unsigned char *color_232182;\n    \n    color_232182 = (__local unsigned char *) color_232182_backing_0;\n    \n    __local unsigned char *color_232183;\n    \n    color_232183 = (__local unsigned char *) color_232183_backing_1;\n    \n    __local unsigned char *color_232184;\n    \n    color_232184 = (__local unsigned char *) color_232184_backing_2;\n    \n    __local unsigned char *color_232185;\n    \n    color_232185 = (__local unsigned char *) color_232185_backing_3;\n    \n    __local unsigned char *color_232186;\n    \n    color_2",
            "32186 = (__local unsigned char *) color_232186_backing_4;\n    \n    __local unsigned char *color_232187;\n    \n    color_232187 = (__local unsigned char *) color_232187_backing_5;\n    \n    double tmp_236723;\n    \n    tmp_236723 = ((__global double *) ext_mem_231669)[gtid_227448 * n_203572 +\n                                                      sext_i32_i64(local_tid_236714)];\n    ((__global double *) color_232180)[phys_tid_227449 * n_203572 +\n                                       sext_i32_i64(local_tid_236714)] =\n        tmp_236723;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    __global unsigned char *ext_mem_231821;\n    __global unsigned char *ext_mem_unused_232071;\n    __global unsigned char *mem_param_231792;\n    __global unsigned char *mem_param_out_232072;\n    \n    mem_param_231792 = color_232180;\n    mem_param_out_232072 = color_232181;\n    for (int32_t i_227453 = 0; i_227453 < iters_206755; i_227453++) {\n        int32_t defunc_2_radix_sort_step_arg_227455 = mul32(2, i_227453);\n        int32_t defunc_0_get_bit_arg_227456 = add32(1,\n                                                    defunc_2_radix_sort_step_arg_227455);\n        bool cond_f_res_227457 = defunc_0_get_bit_arg_227456 == 63;\n        bool cond_f_res_227458 = defunc_2_radix_sort_step_arg_227455 == 63;\n        int64_t unsign_arg_227459 = zext_i32_i64(defunc_0_get_bit_arg_227456);\n        int64_t unsign_arg_227460 =\n                zext_i32_i64(defunc_2_radix_sort_step_arg_227455);\n        int64_t gtid_227466 = sext_i32_i64(sext_i64_i32(ltid_pre_236718));\n        int32_t phys_tid_227467 = local_tid_236714;\n        double x_227480;\n        \n        x_227480 = ((__global double *) mem_param_231792)[phys_tid_227449 *\n                                                          n_203572 +\n                                                          gtid_227466];\n        \n        int64_t i64_arg_227481;\n        \n        i64_arg_227481 = futrts_to_bits64(x_227480);\n        \n        int64_t unsign_arg_227482 = ashr64(i",
            "64_arg_227481, unsign_arg_227459);\n        int64_t unsign_arg_227483 = (int64_t) 1 & unsign_arg_227482;\n        int32_t to_i32_res_227484 = zext_i64_i32(unsign_arg_227483);\n        int64_t unsign_arg_227485 = ashr64(i64_arg_227481, (int64_t) 63);\n        int64_t unsign_arg_227486 = (int64_t) 1 & unsign_arg_227485;\n        int32_t to_i32_res_227487 = zext_i64_i32(unsign_arg_227486);\n        bool cond_227488 = to_i32_res_227487 == 1;\n        bool x_227489 = !cond_227488;\n        bool y_227490 = cond_f_res_227457 && x_227489;\n        bool cond_227491 = cond_227488 || y_227490;\n        int32_t defunc_1_get_bit_res_227492;\n        \n        if (cond_227491) {\n            int32_t defunc_1_get_bit_res_t_res_227493 = 1 ^ to_i32_res_227484;\n            \n            defunc_1_get_bit_res_227492 = defunc_1_get_bit_res_t_res_227493;\n        } else {\n            defunc_1_get_bit_res_227492 = to_i32_res_227484;\n        }\n        \n        int32_t x_227494 = mul32(2, defunc_1_get_bit_res_227492);\n        int64_t unsign_arg_227495 = ashr64(i64_arg_227481, unsign_arg_227460);\n        int64_t unsign_arg_227496 = (int64_t) 1 & unsign_arg_227495;\n        int32_t to_i32_res_227497 = zext_i64_i32(unsign_arg_227496);\n        bool y_227498 = cond_f_res_227458 && x_227489;\n        bool cond_227499 = cond_227488 || y_227498;\n        int32_t defunc_1_get_bit_res_227500;\n        \n        if (cond_227499) {\n            int32_t defunc_1_get_bit_res_t_res_227501 = 1 ^ to_i32_res_227497;\n            \n            defunc_1_get_bit_res_227500 = defunc_1_get_bit_res_t_res_227501;\n        } else {\n            defunc_1_get_bit_res_227500 = to_i32_res_227497;\n        }\n        \n        int32_t defunc_0_f_res_227502 = add32(x_227494,\n                                              defunc_1_get_bit_res_227500);\n        bool cond_227503 = defunc_0_f_res_227502 == 0;\n        int64_t defunc_0_f_res_227504 = btoi_bool_i64(cond_227503);\n        int64_t defunc_0_f_res_227505;\n        int64_t defunc_0_f_res_227506;\n  ",
            "      int64_t defunc_0_f_res_227507;\n        \n        if (cond_227503) {\n            defunc_0_f_res_227505 = (int64_t) 0;\n            defunc_0_f_res_227506 = (int64_t) 0;\n            defunc_0_f_res_227507 = (int64_t) 0;\n        } else {\n            bool cond_227508 = defunc_0_f_res_227502 == 1;\n            int64_t defunc_0_f_res_f_res_227509 = btoi_bool_i64(cond_227508);\n            int64_t defunc_0_f_res_f_res_227510;\n            int64_t defunc_0_f_res_f_res_227511;\n            \n            if (cond_227508) {\n                defunc_0_f_res_f_res_227510 = (int64_t) 0;\n                defunc_0_f_res_f_res_227511 = (int64_t) 0;\n            } else {\n                bool cond_227512 = defunc_0_f_res_227502 == 2;\n                int64_t defunc_0_f_res_f_res_f_res_227513 =\n                        btoi_bool_i64(cond_227512);\n                bool cond_neg_227514 = !cond_227512;\n                int64_t defunc_0_f_res_f_res_f_res_227515 =\n                        btoi_bool_i64(cond_neg_227514);\n                \n                defunc_0_f_res_f_res_227510 = defunc_0_f_res_f_res_f_res_227513;\n                defunc_0_f_res_f_res_227511 = defunc_0_f_res_f_res_f_res_227515;\n            }\n            defunc_0_f_res_227505 = defunc_0_f_res_f_res_227509;\n            defunc_0_f_res_227506 = defunc_0_f_res_f_res_227510;\n            defunc_0_f_res_227507 = defunc_0_f_res_f_res_227511;\n        }\n        ((__local int64_t *) color_232187)[gtid_227466] = defunc_0_f_res_227504;\n        ((__local int64_t *) color_232186)[gtid_227466] = defunc_0_f_res_227505;\n        ((__local int64_t *) color_232185)[gtid_227466] = defunc_0_f_res_227506;\n        ((__local int64_t *) color_232184)[gtid_227466] = defunc_0_f_res_227507;\n        ((__local int32_t *) color_232183)[gtid_227466] = defunc_0_f_res_227502;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t dims_flat_236727 = n_203572;\n        int64_t x_227468;\n        int64_t x_227469;\n        int64_t x_227470;\n        int64_t x_227471;\n  ",
            "      int64_t x_227472;\n        int64_t x_227473;\n        int64_t x_227474;\n        int64_t x_227475;\n        int64_t x_236732;\n        int64_t x_236733;\n        int64_t x_236734;\n        int64_t x_236735;\n        int64_t x_236736;\n        int64_t x_236737;\n        int64_t x_236738;\n        int64_t x_236739;\n        bool ltid_in_bounds_236744 = slt64(sext_i32_i64(local_tid_236714),\n                                           n_203572);\n        int32_t skip_threads_236745;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_236744) {\n                x_227472 = ((volatile __local\n                             int64_t *) color_232187)[sext_i32_i64(local_tid_236714)];\n                x_227473 = ((volatile __local\n                             int64_t *) color_232186)[sext_i32_i64(local_tid_236714)];\n                x_227474 = ((volatile __local\n                             int64_t *) color_232185)[sext_i32_i64(local_tid_236714)];\n                x_227475 = ((volatile __local\n                             int64_t *) color_232184)[sext_i32_i64(local_tid_236714)];\n                if ((local_tid_236714 - squot32(local_tid_236714, 32) * 32) ==\n                    0) {\n                    x_227468 = x_227472;\n                    x_227469 = x_227473;\n                    x_227470 = x_227474;\n                    x_227471 = x_227475;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236745 = 1;\n            while (slt32(skip_threads_236745, 32)) {\n                bool thread_active_236746 = sle32(skip_threads_236745,\n                                                  local_tid_236714 -\n                                                  squot32(local_tid_236714,\n                                                          32) * 32) &&\n                     ltid_in_bounds_236744;\n                \n                if (thread_active_236746) {\n                    // read operan",
            "ds\n                    {\n                        x_227468 = ((volatile __local\n                                     int64_t *) color_232187)[sext_i32_i64(local_tid_236714) -\n                                                              sext_i32_i64(skip_threads_236745)];\n                        x_227469 = ((volatile __local\n                                     int64_t *) color_232186)[sext_i32_i64(local_tid_236714) -\n                                                              sext_i32_i64(skip_threads_236745)];\n                        x_227470 = ((volatile __local\n                                     int64_t *) color_232185)[sext_i32_i64(local_tid_236714) -\n                                                              sext_i32_i64(skip_threads_236745)];\n                        x_227471 = ((volatile __local\n                                     int64_t *) color_232184)[sext_i32_i64(local_tid_236714) -\n                                                              sext_i32_i64(skip_threads_236745)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236747 =\n                         slt64(srem64(sext_i32_i64(local_tid_236714), n_203572),\n                               sext_i32_i64(local_tid_236714) -\n                               sext_i32_i64(local_tid_236714 -\n                               skip_threads_236745));\n                    \n                    if (thread_active_236746 && inactive_236747) {\n                        x_227468 = x_227472;\n                        x_227469 = x_227473;\n                        x_227470 = x_227474;\n                        x_227471 = x_227475;\n                    }\n                    if (thread_active_236746) {\n                        if (!inactive_236747) {\n                            int64_t defunc_1_op_res_227476 = add64(x_227468,\n                                                                   x_227472);\n                            int64_t defunc_1_o",
            "p_res_227477 = add64(x_227469,\n                                                                   x_227473);\n                            int64_t defunc_1_op_res_227478 = add64(x_227470,\n                                                                   x_227474);\n                            int64_t defunc_1_op_res_227479 = add64(x_227471,\n                                                                   x_227475);\n                            \n                            x_227468 = defunc_1_op_res_227476;\n                            x_227469 = defunc_1_op_res_227477;\n                            x_227470 = defunc_1_op_res_227478;\n                            x_227471 = defunc_1_op_res_227479;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236716, skip_threads_236745)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236746) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232187)[sext_i32_i64(local_tid_236714)] =\n                            x_227468;\n                        x_227472 = x_227468;\n                        ((volatile __local\n                          int64_t *) color_232186)[sext_i32_i64(local_tid_236714)] =\n                            x_227469;\n                        x_227473 = x_227469;\n                        ((volatile __local\n                          int64_t *) color_232185)[sext_i32_i64(local_tid_236714)] =\n                            x_227470;\n                        x_227474 = x_227470;\n                        ((volatile __local\n                          int64_t *) color_232184)[sext_i32_i64(local_tid_236714)] =\n                            x_227471;\n                        x_227475 = x_227471;\n                    }\n                }\n                if (sle32(wave_sizze_236716, skip_threads_236745)) {\n                    barrier(CLK_LOCAL_MEM_",
            "FENCE);\n                }\n                skip_threads_236745 *= 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_236714 - squot32(local_tid_236714, 32) * 32) == 31 &&\n                ltid_in_bounds_236744) {\n                ((volatile __local\n                  int64_t *) color_232187)[sext_i32_i64(squot32(local_tid_236714,\n                                                                32))] =\n                    x_227468;\n                ((volatile __local\n                  int64_t *) color_232186)[sext_i32_i64(squot32(local_tid_236714,\n                                                                32))] =\n                    x_227469;\n                ((volatile __local\n                  int64_t *) color_232185)[sext_i32_i64(squot32(local_tid_236714,\n                                                                32))] =\n                    x_227470;\n                ((volatile __local\n                  int64_t *) color_232184)[sext_i32_i64(squot32(local_tid_236714,\n                                                                32))] =\n                    x_227471;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n        {\n            int32_t skip_threads_236748;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_236714, 32) == 0 &&\n                    ltid_in_bounds_236744) {\n                    x_236736 = ((volatile __local\n                                 int64_t *) color_232187)[sext_i32_i64(local_tid_236714)];\n                    x_236737 = ((volatile __local\n                                 int64_t *) color_232186)[sext_i32_i64(local_tid_236714)];\n                    x_236738 = ((volatile __local\n                                 int64_t *) color_232185)[sext_i32_i64(local_tid_2367",
            "14)];\n                    x_236739 = ((volatile __local\n                                 int64_t *) color_232184)[sext_i32_i64(local_tid_236714)];\n                    if ((local_tid_236714 - squot32(local_tid_236714, 32) *\n                         32) == 0) {\n                        x_236732 = x_236736;\n                        x_236733 = x_236737;\n                        x_236734 = x_236738;\n                        x_236735 = x_236739;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236748 = 1;\n                while (slt32(skip_threads_236748, 32)) {\n                    bool thread_active_236749 = sle32(skip_threads_236748,\n                                                      local_tid_236714 -\n                                                      squot32(local_tid_236714,\n                                                              32) * 32) &&\n                         (squot32(local_tid_236714, 32) == 0 &&\n                          ltid_in_bounds_236744);\n                    \n                    if (thread_active_236749) {\n                        // read operands\n                        {\n                            x_236732 = ((volatile __local\n                                         int64_t *) color_232187)[sext_i32_i64(local_tid_236714) -\n                                                                  sext_i32_i64(skip_threads_236748)];\n                            x_236733 = ((volatile __local\n                                         int64_t *) color_232186)[sext_i32_i64(local_tid_236714) -\n                                                                  sext_i32_i64(skip_threads_236748)];\n                            x_236734 = ((volatile __local\n                                         int64_t *) color_232185)[sext_i32_i64(local_tid_236714) -\n                                                                  sext_i32_i64(skip_threads_236748)];\n    ",
            "                        x_236735 = ((volatile __local\n                                         int64_t *) color_232184)[sext_i32_i64(local_tid_236714) -\n                                                                  sext_i32_i64(skip_threads_236748)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236750 =\n                             slt64(srem64(sext_i32_i64(local_tid_236714 * 32 +\n                                          32 - 1), n_203572),\n                                   sext_i32_i64(local_tid_236714 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_236714 -\n                                                      skip_threads_236748) *\n                                   32 + 32 - 1));\n                        \n                        if (thread_active_236749 && inactive_236750) {\n                            x_236732 = x_236736;\n                            x_236733 = x_236737;\n                            x_236734 = x_236738;\n                            x_236735 = x_236739;\n                        }\n                        if (thread_active_236749) {\n                            if (!inactive_236750) {\n                                int64_t defunc_1_op_res_236740 = add64(x_236732,\n                                                                       x_236736);\n                                int64_t defunc_1_op_res_236741 = add64(x_236733,\n                                                                       x_236737);\n                                int64_t defunc_1_op_res_236742 = add64(x_236734,\n                                                                       x_236738);\n                                int64_t defunc_1_op_res_236743 = add64(x_236735,\n                                                                       x_236739);\n                                \n                                x_236732 = defunc_1_op_res_236",
            "740;\n                                x_236733 = defunc_1_op_res_236741;\n                                x_236734 = defunc_1_op_res_236742;\n                                x_236735 = defunc_1_op_res_236743;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236716, skip_threads_236748)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236749) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) color_232187)[sext_i32_i64(local_tid_236714)] =\n                                x_236732;\n                            x_236736 = x_236732;\n                            ((volatile __local\n                              int64_t *) color_232186)[sext_i32_i64(local_tid_236714)] =\n                                x_236733;\n                            x_236737 = x_236733;\n                            ((volatile __local\n                              int64_t *) color_232185)[sext_i32_i64(local_tid_236714)] =\n                                x_236734;\n                            x_236738 = x_236734;\n                            ((volatile __local\n                              int64_t *) color_232184)[sext_i32_i64(local_tid_236714)] =\n                                x_236735;\n                            x_236739 = x_236735;\n                        }\n                    }\n                    if (sle32(wave_sizze_236716, skip_threads_236748)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236748 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_236751 = squot32(local_tid_236714, 32) == 0 ||\n             !ltid_in_bounds_236744;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n   ",
            "         {\n                if (!no_carry_in_236751) {\n                    x_227472 = x_227468;\n                    x_227473 = x_227469;\n                    x_227474 = x_227470;\n                    x_227475 = x_227471;\n                    x_227468 = ((__local\n                                 int64_t *) color_232187)[sext_i32_i64(squot32(local_tid_236714,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227469 = ((__local\n                                 int64_t *) color_232186)[sext_i32_i64(squot32(local_tid_236714,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227470 = ((__local\n                                 int64_t *) color_232185)[sext_i32_i64(squot32(local_tid_236714,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227471 = ((__local\n                                 int64_t *) color_232184)[sext_i32_i64(squot32(local_tid_236714,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236752 =\n                     slt64(srem64(sext_i32_i64(local_tid_236714), n_203572),\n                           sext_i32_i64(local_tid_236714) -\n                           sext_i32_i64(squot32(local_tid_236714, 32) * 32 -\n                           1));\n                \n                if (!no_carry_in_236751) {\n                    if (inactive_236752) {\n                        x_227468 = x_227472;\n                        x_227469 = x_227473;\n                        x_227470 = x_2274",
            "74;\n                        x_227471 = x_227475;\n                    }\n                }\n                if (!no_carry_in_236751) {\n                    if (!inactive_236752) {\n                        int64_t defunc_1_op_res_227476 = add64(x_227468,\n                                                               x_227472);\n                        int64_t defunc_1_op_res_227477 = add64(x_227469,\n                                                               x_227473);\n                        int64_t defunc_1_op_res_227478 = add64(x_227470,\n                                                               x_227474);\n                        int64_t defunc_1_op_res_227479 = add64(x_227471,\n                                                               x_227475);\n                        \n                        x_227468 = defunc_1_op_res_227476;\n                        x_227469 = defunc_1_op_res_227477;\n                        x_227470 = defunc_1_op_res_227478;\n                        x_227471 = defunc_1_op_res_227479;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_236751) {\n                    ((__local\n                      int64_t *) color_232187)[sext_i32_i64(local_tid_236714)] =\n                        x_227468;\n                    ((__local\n                      int64_t *) color_232186)[sext_i32_i64(local_tid_236714)] =\n                        x_227469;\n                    ((__local\n                      int64_t *) color_232185)[sext_i32_i64(local_tid_236714)] =\n                        x_227470;\n                    ((__local\n                      int64_t *) color_232184)[sext_i32_i64(local_tid_236714)] =\n                        x_227471;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_236714, 32) == 0 && ltid_in_bounds_236744) {\n                ((__local\n     ",
            "             int64_t *) color_232187)[sext_i32_i64(local_tid_236714)] =\n                    x_227472;\n                ((__local\n                  int64_t *) color_232186)[sext_i32_i64(local_tid_236714)] =\n                    x_227473;\n                ((__local\n                  int64_t *) color_232185)[sext_i32_i64(local_tid_236714)] =\n                    x_227474;\n                ((__local\n                  int64_t *) color_232184)[sext_i32_i64(local_tid_236714)] =\n                    x_227475;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t last_res_227516;\n        \n        last_res_227516 = ((__local int64_t *) color_232187)[i_203760];\n        \n        int64_t last_res_227517;\n        \n        last_res_227517 = ((__local int64_t *) color_232186)[i_203760];\n        \n        int64_t last_res_227518;\n        \n        last_res_227518 = ((__local int64_t *) color_232185)[i_203760];\n        \n        double tmp_236753;\n        \n        tmp_236753 = ((__global double *) mem_param_231792)[phys_tid_227449 *\n                                                            n_203572 +\n                                                            sext_i32_i64(local_tid_236714)];\n        ((__local double *) color_232182)[sext_i32_i64(local_tid_236714)] =\n            tmp_236753;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t write_i_227521 = sext_i32_i64(sext_i64_i32(ltid_pre_236718));\n        int32_t phys_tid_227522 = local_tid_236714;\n        int32_t x_227523;\n        \n        x_227523 = ((__local int32_t *) color_232183)[write_i_227521];\n        \n        double write_value_227528;\n        \n        write_value_227528 = ((__global\n                               double *) mem_param_231792)[phys_tid_227449 *\n                                                           n_203572 +\n                                                           write_i_227521];\n        \n        bool match_lit_227529 = 0 == x_227523;\n        int64_t defunc_1_f",
            "_res_227530;\n        \n        if (match_lit_227529) {\n            int64_t x_227524;\n            \n            x_227524 = ((__local int64_t *) color_232187)[write_i_227521];\n            \n            int64_t case_res_227531 = sub64(x_227524, (int64_t) 1);\n            \n            defunc_1_f_res_227530 = case_res_227531;\n        } else {\n            bool match_lit_227532 = 1 == x_227523;\n            int64_t x_227533;\n            \n            if (match_lit_227532) {\n                int64_t x_227525;\n                \n                x_227525 = ((__local int64_t *) color_232186)[write_i_227521];\n                \n                int64_t x_227534 = add64(last_res_227516, x_227525);\n                int64_t case_res_227535 = sub64(x_227534, (int64_t) 1);\n                \n                x_227533 = case_res_227535;\n            } else {\n                bool match_lit_227536 = 2 == x_227523;\n                int64_t x_227537;\n                \n                if (match_lit_227536) {\n                    int64_t x_227526;\n                    \n                    x_227526 = ((__local\n                                 int64_t *) color_232185)[write_i_227521];\n                    \n                    int64_t x_227538 = add64(last_res_227516, last_res_227517);\n                    int64_t x_227539 = add64(x_227526, x_227538);\n                    int64_t case_res_227540 = sub64(x_227539, (int64_t) 1);\n                    \n                    x_227537 = case_res_227540;\n                } else {\n                    int64_t x_227527;\n                    \n                    x_227527 = ((__local\n                                 int64_t *) color_232184)[write_i_227521];\n                    \n                    int64_t x_227541 = add64(last_res_227516, last_res_227517);\n                    int64_t x_227542 = add64(last_res_227518, x_227541);\n                    int64_t x_227543 = add64(x_227527, x_227542);\n                    int64_t defunc_1_f_res_res_227544 = sub64(x_227543,\n                   ",
            "                                           (int64_t) 1);\n                    \n                    x_227537 = defunc_1_f_res_res_227544;\n                }\n                x_227533 = x_227537;\n            }\n            defunc_1_f_res_227530 = x_227533;\n        }\n        if (sle64((int64_t) 0, defunc_1_f_res_227530) &&\n            slt64(defunc_1_f_res_227530, n_203572)) {\n            ((__local double *) color_232182)[defunc_1_f_res_227530] =\n                write_value_227528;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        double tmp_236754;\n        \n        tmp_236754 = ((__local\n                       double *) color_232182)[sext_i32_i64(local_tid_236714)];\n        ((__global double *) mem_param_out_232072)[phys_tid_227449 * n_203572 +\n                                                   sext_i32_i64(local_tid_236714)] =\n            tmp_236754;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        __global unsigned char *mem_param_tmp_236724;\n        \n        mem_param_tmp_236724 = mem_param_out_232072;\n        \n        __global unsigned char *mem_param_out_tmp_236725;\n        \n        mem_param_out_tmp_236725 = mem_param_231792;\n        mem_param_231792 = mem_param_tmp_236724;\n        mem_param_out_232072 = mem_param_out_tmp_236725;\n    }\n    ext_mem_231821 = mem_param_231792;\n    ext_mem_unused_232071 = mem_param_out_232072;\n    if (local_tid_236714 == 0) {\n        for (int64_t i_236755 = 0; i_236755 < n_203572; i_236755++) {\n            double tmp_236756;\n            \n            tmp_236756 = ((__global double *) ext_mem_231821)[phys_tid_227449 *\n                                                              n_203572 +\n                                                              i_236755];\n            ((__global double *) mem_231829)[gtid_227448 * n_203572 +\n                                             i_236755] = tmp_236756;\n        }\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227905(__global int *global_failure,\n  ",
            "                                           uint color_232193_backing_offset_0,\n                                             uint color_232192_backing_offset_1,\n                                             uint color_232191_backing_offset_2,\n                                             uint color_232190_backing_offset_3,\n                                             uint color_232189_backing_offset_4,\n                                             uint color_232188_backing_offset_5,\n                                             int64_t n_203572,\n                                             int64_t partition_sizze_203667,\n                                             int64_t i_203760,\n                                             unsigned char cond_f_res_227891_bits,\n                                             unsigned char cond_f_res_227892_bits,\n                                             int64_t unsign_arg_227893,\n                                             int64_t unsign_arg_227894, __global\n                                             unsigned char *mem_param_231841,\n                                             __global unsigned char *mem_231872)\n{\n    bool cond_f_res_227891 = cond_f_res_227891_bits;\n    bool cond_f_res_227892 = cond_f_res_227892_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *color_232193_backing_5 =\n                           &shared_mem[color_232193_backing_offset_0];\n    volatile unsigned char *color_232192_backing_4 =\n                           &shared_mem[color_232192_backing_offset_1];\n    volatile unsigned char *color_232191_backing_3 =\n                           &shared_mem[color_232191_backing_offset_2];\n    volatile unsigned char *color_232190_backing_2 =\n                           &shared_mem[color_232190_backing_offset_3];\n    volatile unsigned char *color_232189_backing_1 =\n                           &shared_mem[color_232189_backing_offset_4];\n    volatile unsi",
            "gned char *color_232188_backing_0 =\n                           &shared_mem[color_232188_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236759;\n    int32_t local_tid_236760;\n    int64_t group_sizze_236763;\n    int32_t wave_sizze_236762;\n    int32_t group_tid_236761;\n    \n    global_tid_236759 = get_global_id(0);\n    local_tid_236760 = get_local_id(0);\n    group_sizze_236763 = get_local_size(0);\n    wave_sizze_236762 = LOCKSTEP_WIDTH;\n    group_tid_236761 = get_group_id(0);\n    \n    int32_t phys_tid_227905 = group_tid_236761;\n    int64_t slice_236765 = n_203572;\n    int64_t ltid_pre_236764 = sext_i32_i64(local_tid_236760);\n    int64_t remnant_236766 = sext_i32_i64(local_tid_236760) - ltid_pre_236764;\n    int64_t slice_236767 = partition_sizze_203667;\n    int64_t gtid_227904 = sext_i32_i64(group_tid_236761);\n    int64_t remnant_236768 = sext_i32_i64(group_tid_236761) - gtid_227904;\n    __local unsigned char *color_232188;\n    \n    color_232188 = (__local unsigned char *) color_232188_backing_0;\n    \n    __local unsigned char *color_232189;\n    \n    color_232189 = (__local unsigned char *) color_232189_backing_1;\n    \n    __local unsigned char *color_232190;\n    \n    color_232190 = (__local unsigned char *) color_232190_backing_2;\n    \n    __local unsigned char *color_232191;\n    \n    color_232191 = (__local unsigned char *) color_232191_backing_3;\n    \n    __local unsigned char *color_232192;\n    \n    color_232192 = (__local unsigned char *) color_232192_backing_4;\n    \n    __local unsigned char *color_232193;\n    \n    color_232193 = (__local unsigned char *) color_232193_backing_5;\n    \n    double tmp_236769;\n    \n    tmp_236769 = ((__global double *) mem_param_231841)[gtid_227904 * n_203572 +\n                                                        sext_i32_i64(local_tid_236760)];\n    ((__local double *) color_232193)[sext_i32_i64(local_tid_236760)] =\n        tmp_236769;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int6",
            "4_t gtid_227915 = sext_i32_i64(sext_i64_i32(ltid_pre_236764));\n    int32_t phys_tid_227916 = local_tid_236760;\n    double x_227929;\n    \n    x_227929 = ((__global double *) mem_param_231841)[gtid_227904 * n_203572 +\n                                                      gtid_227915];\n    \n    int64_t i64_arg_227930;\n    \n    i64_arg_227930 = futrts_to_bits64(x_227929);\n    \n    int64_t unsign_arg_227931 = ashr64(i64_arg_227930, unsign_arg_227893);\n    int64_t unsign_arg_227932 = (int64_t) 1 & unsign_arg_227931;\n    int32_t to_i32_res_227933 = zext_i64_i32(unsign_arg_227932);\n    int64_t unsign_arg_227934 = ashr64(i64_arg_227930, (int64_t) 63);\n    int64_t unsign_arg_227935 = (int64_t) 1 & unsign_arg_227934;\n    int32_t to_i32_res_227936 = zext_i64_i32(unsign_arg_227935);\n    bool cond_227937 = to_i32_res_227936 == 1;\n    bool x_227938 = !cond_227937;\n    bool y_227939 = cond_f_res_227891 && x_227938;\n    bool cond_227940 = cond_227937 || y_227939;\n    int32_t defunc_1_get_bit_res_227941;\n    \n    if (cond_227940) {\n        int32_t defunc_1_get_bit_res_t_res_227942 = 1 ^ to_i32_res_227933;\n        \n        defunc_1_get_bit_res_227941 = defunc_1_get_bit_res_t_res_227942;\n    } else {\n        defunc_1_get_bit_res_227941 = to_i32_res_227933;\n    }\n    \n    int32_t x_227943 = mul32(2, defunc_1_get_bit_res_227941);\n    int64_t unsign_arg_227944 = ashr64(i64_arg_227930, unsign_arg_227894);\n    int64_t unsign_arg_227945 = (int64_t) 1 & unsign_arg_227944;\n    int32_t to_i32_res_227946 = zext_i64_i32(unsign_arg_227945);\n    bool y_227947 = cond_f_res_227892 && x_227938;\n    bool cond_227948 = cond_227937 || y_227947;\n    int32_t defunc_1_get_bit_res_227949;\n    \n    if (cond_227948) {\n        int32_t defunc_1_get_bit_res_t_res_227950 = 1 ^ to_i32_res_227946;\n        \n        defunc_1_get_bit_res_227949 = defunc_1_get_bit_res_t_res_227950;\n    } else {\n        defunc_1_get_bit_res_227949 = to_i32_res_227946;\n    }\n    \n    int32_t defunc_0_f_res_227951 = add32(x_227943,\n       ",
            "                                   defunc_1_get_bit_res_227949);\n    bool cond_227952 = defunc_0_f_res_227951 == 0;\n    int64_t defunc_0_f_res_227953 = btoi_bool_i64(cond_227952);\n    int64_t defunc_0_f_res_227954;\n    int64_t defunc_0_f_res_227955;\n    int64_t defunc_0_f_res_227956;\n    \n    if (cond_227952) {\n        defunc_0_f_res_227954 = (int64_t) 0;\n        defunc_0_f_res_227955 = (int64_t) 0;\n        defunc_0_f_res_227956 = (int64_t) 0;\n    } else {\n        bool cond_227957 = defunc_0_f_res_227951 == 1;\n        int64_t defunc_0_f_res_f_res_227958 = btoi_bool_i64(cond_227957);\n        int64_t defunc_0_f_res_f_res_227959;\n        int64_t defunc_0_f_res_f_res_227960;\n        \n        if (cond_227957) {\n            defunc_0_f_res_f_res_227959 = (int64_t) 0;\n            defunc_0_f_res_f_res_227960 = (int64_t) 0;\n        } else {\n            bool cond_227961 = defunc_0_f_res_227951 == 2;\n            int64_t defunc_0_f_res_f_res_f_res_227962 =\n                    btoi_bool_i64(cond_227961);\n            bool cond_neg_227963 = !cond_227961;\n            int64_t defunc_0_f_res_f_res_f_res_227964 =\n                    btoi_bool_i64(cond_neg_227963);\n            \n            defunc_0_f_res_f_res_227959 = defunc_0_f_res_f_res_f_res_227962;\n            defunc_0_f_res_f_res_227960 = defunc_0_f_res_f_res_f_res_227964;\n        }\n        defunc_0_f_res_227954 = defunc_0_f_res_f_res_227958;\n        defunc_0_f_res_227955 = defunc_0_f_res_f_res_227959;\n        defunc_0_f_res_227956 = defunc_0_f_res_f_res_227960;\n    }\n    ((__local int64_t *) color_232192)[gtid_227915] = defunc_0_f_res_227953;\n    ((__local int64_t *) color_232191)[gtid_227915] = defunc_0_f_res_227954;\n    ((__local int64_t *) color_232190)[gtid_227915] = defunc_0_f_res_227955;\n    ((__local int64_t *) color_232189)[gtid_227915] = defunc_0_f_res_227956;\n    ((__local int32_t *) color_232188)[gtid_227915] = defunc_0_f_res_227951;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_236770 = n_203572;\n    in",
            "t64_t x_227917;\n    int64_t x_227918;\n    int64_t x_227919;\n    int64_t x_227920;\n    int64_t x_227921;\n    int64_t x_227922;\n    int64_t x_227923;\n    int64_t x_227924;\n    int64_t x_236775;\n    int64_t x_236776;\n    int64_t x_236777;\n    int64_t x_236778;\n    int64_t x_236779;\n    int64_t x_236780;\n    int64_t x_236781;\n    int64_t x_236782;\n    bool ltid_in_bounds_236787 = slt64(sext_i32_i64(local_tid_236760),\n                                       n_203572);\n    int32_t skip_threads_236788;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_236787) {\n            x_227921 = ((volatile __local\n                         int64_t *) color_232192)[sext_i32_i64(local_tid_236760)];\n            x_227922 = ((volatile __local\n                         int64_t *) color_232191)[sext_i32_i64(local_tid_236760)];\n            x_227923 = ((volatile __local\n                         int64_t *) color_232190)[sext_i32_i64(local_tid_236760)];\n            x_227924 = ((volatile __local\n                         int64_t *) color_232189)[sext_i32_i64(local_tid_236760)];\n            if ((local_tid_236760 - squot32(local_tid_236760, 32) * 32) == 0) {\n                x_227917 = x_227921;\n                x_227918 = x_227922;\n                x_227919 = x_227923;\n                x_227920 = x_227924;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_236788 = 1;\n        while (slt32(skip_threads_236788, 32)) {\n            bool thread_active_236789 = sle32(skip_threads_236788,\n                                              local_tid_236760 -\n                                              squot32(local_tid_236760, 32) *\n                                              32) && ltid_in_bounds_236787;\n            \n            if (thread_active_236789) {\n                // read operands\n                {\n                    x_227917 = ((volatile __local\n                                 int64_t *) color_232192)[sext_i32_i64(local_t",
            "id_236760) -\n                                                          sext_i32_i64(skip_threads_236788)];\n                    x_227918 = ((volatile __local\n                                 int64_t *) color_232191)[sext_i32_i64(local_tid_236760) -\n                                                          sext_i32_i64(skip_threads_236788)];\n                    x_227919 = ((volatile __local\n                                 int64_t *) color_232190)[sext_i32_i64(local_tid_236760) -\n                                                          sext_i32_i64(skip_threads_236788)];\n                    x_227920 = ((volatile __local\n                                 int64_t *) color_232189)[sext_i32_i64(local_tid_236760) -\n                                                          sext_i32_i64(skip_threads_236788)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236790 =\n                     slt64(srem64(sext_i32_i64(local_tid_236760), n_203572),\n                           sext_i32_i64(local_tid_236760) -\n                           sext_i32_i64(local_tid_236760 -\n                           skip_threads_236788));\n                \n                if (thread_active_236789 && inactive_236790) {\n                    x_227917 = x_227921;\n                    x_227918 = x_227922;\n                    x_227919 = x_227923;\n                    x_227920 = x_227924;\n                }\n                if (thread_active_236789) {\n                    if (!inactive_236790) {\n                        int64_t defunc_1_op_res_227925 = add64(x_227917,\n                                                               x_227921);\n                        int64_t defunc_1_op_res_227926 = add64(x_227918,\n                                                               x_227922);\n                        int64_t defunc_1_op_res_227927 = add64(x_227919,\n                                                               x_227923);\n                        int64_t d",
            "efunc_1_op_res_227928 = add64(x_227920,\n                                                               x_227924);\n                        \n                        x_227917 = defunc_1_op_res_227925;\n                        x_227918 = defunc_1_op_res_227926;\n                        x_227919 = defunc_1_op_res_227927;\n                        x_227920 = defunc_1_op_res_227928;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_236762, skip_threads_236788)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_236789) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232192)[sext_i32_i64(local_tid_236760)] =\n                        x_227917;\n                    x_227921 = x_227917;\n                    ((volatile __local\n                      int64_t *) color_232191)[sext_i32_i64(local_tid_236760)] =\n                        x_227918;\n                    x_227922 = x_227918;\n                    ((volatile __local\n                      int64_t *) color_232190)[sext_i32_i64(local_tid_236760)] =\n                        x_227919;\n                    x_227923 = x_227919;\n                    ((volatile __local\n                      int64_t *) color_232189)[sext_i32_i64(local_tid_236760)] =\n                        x_227920;\n                    x_227924 = x_227920;\n                }\n            }\n            if (sle32(wave_sizze_236762, skip_threads_236788)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_236788 *= 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_236760 - squot32(local_tid_236760, 32) * 32) == 31 &&\n            ltid_in_bounds_236787) {\n            ((volatile __local\n              int64_t *) color_232192)[sext_i32_i64(squot32(local_tid_236760,\n                                      ",
            "                      32))] = x_227917;\n            ((volatile __local\n              int64_t *) color_232191)[sext_i32_i64(squot32(local_tid_236760,\n                                                            32))] = x_227918;\n            ((volatile __local\n              int64_t *) color_232190)[sext_i32_i64(squot32(local_tid_236760,\n                                                            32))] = x_227919;\n            ((volatile __local\n              int64_t *) color_232189)[sext_i32_i64(squot32(local_tid_236760,\n                                                            32))] = x_227920;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_236791;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_236760, 32) == 0 && ltid_in_bounds_236787) {\n                x_236779 = ((volatile __local\n                             int64_t *) color_232192)[sext_i32_i64(local_tid_236760)];\n                x_236780 = ((volatile __local\n                             int64_t *) color_232191)[sext_i32_i64(local_tid_236760)];\n                x_236781 = ((volatile __local\n                             int64_t *) color_232190)[sext_i32_i64(local_tid_236760)];\n                x_236782 = ((volatile __local\n                             int64_t *) color_232189)[sext_i32_i64(local_tid_236760)];\n                if ((local_tid_236760 - squot32(local_tid_236760, 32) * 32) ==\n                    0) {\n                    x_236775 = x_236779;\n                    x_236776 = x_236780;\n                    x_236777 = x_236781;\n                    x_236778 = x_236782;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236791 = 1;\n            while (slt32(skip_threads_236791, 32)) {\n                bool thread_active_236792 = sle32(skip_threads_236791,\n             ",
            "                                     local_tid_236760 -\n                                                  squot32(local_tid_236760,\n                                                          32) * 32) &&\n                     (squot32(local_tid_236760, 32) == 0 &&\n                      ltid_in_bounds_236787);\n                \n                if (thread_active_236792) {\n                    // read operands\n                    {\n                        x_236775 = ((volatile __local\n                                     int64_t *) color_232192)[sext_i32_i64(local_tid_236760) -\n                                                              sext_i32_i64(skip_threads_236791)];\n                        x_236776 = ((volatile __local\n                                     int64_t *) color_232191)[sext_i32_i64(local_tid_236760) -\n                                                              sext_i32_i64(skip_threads_236791)];\n                        x_236777 = ((volatile __local\n                                     int64_t *) color_232190)[sext_i32_i64(local_tid_236760) -\n                                                              sext_i32_i64(skip_threads_236791)];\n                        x_236778 = ((volatile __local\n                                     int64_t *) color_232189)[sext_i32_i64(local_tid_236760) -\n                                                              sext_i32_i64(skip_threads_236791)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236793 =\n                         slt64(srem64(sext_i32_i64(local_tid_236760 * 32 + 32 -\n                                      1), n_203572),\n                               sext_i32_i64(local_tid_236760 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_236760 -\n                                             skip_threads_236791) * 32 + 32 -\n                               1));\n                    \n                    if (thread_acti",
            "ve_236792 && inactive_236793) {\n                        x_236775 = x_236779;\n                        x_236776 = x_236780;\n                        x_236777 = x_236781;\n                        x_236778 = x_236782;\n                    }\n                    if (thread_active_236792) {\n                        if (!inactive_236793) {\n                            int64_t defunc_1_op_res_236783 = add64(x_236775,\n                                                                   x_236779);\n                            int64_t defunc_1_op_res_236784 = add64(x_236776,\n                                                                   x_236780);\n                            int64_t defunc_1_op_res_236785 = add64(x_236777,\n                                                                   x_236781);\n                            int64_t defunc_1_op_res_236786 = add64(x_236778,\n                                                                   x_236782);\n                            \n                            x_236775 = defunc_1_op_res_236783;\n                            x_236776 = defunc_1_op_res_236784;\n                            x_236777 = defunc_1_op_res_236785;\n                            x_236778 = defunc_1_op_res_236786;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236762, skip_threads_236791)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236792) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232192)[sext_i32_i64(local_tid_236760)] =\n                            x_236775;\n                        x_236779 = x_236775;\n                        ((volatile __local\n                          int64_t *) color_232191)[sext_i32_i64(local_tid_236760)] =\n                            x_236776;\n                        x_236780 = x_236776;\n                        ((volatile __local",
            "\n                          int64_t *) color_232190)[sext_i32_i64(local_tid_236760)] =\n                            x_236777;\n                        x_236781 = x_236777;\n                        ((volatile __local\n                          int64_t *) color_232189)[sext_i32_i64(local_tid_236760)] =\n                            x_236778;\n                        x_236782 = x_236778;\n                    }\n                }\n                if (sle32(wave_sizze_236762, skip_threads_236791)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236791 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_236794 = squot32(local_tid_236760, 32) == 0 ||\n         !ltid_in_bounds_236787;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_236794) {\n                x_227921 = x_227917;\n                x_227922 = x_227918;\n                x_227923 = x_227919;\n                x_227924 = x_227920;\n                x_227917 = ((__local\n                             int64_t *) color_232192)[sext_i32_i64(squot32(local_tid_236760,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227918 = ((__local\n                             int64_t *) color_232191)[sext_i32_i64(squot32(local_tid_236760,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227919 = ((__local\n                             int64_t *) color_232190)[sext_i32_i64(squot32(local_tid_236760,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227920 = ((__local\n                             int64_t *) color_232189)[sext_i32_i64(squot",
            "32(local_tid_236760,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_236795 = slt64(srem64(sext_i32_i64(local_tid_236760),\n                                                n_203572),\n                                         sext_i32_i64(local_tid_236760) -\n                                         sext_i32_i64(squot32(local_tid_236760,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_236794) {\n                if (inactive_236795) {\n                    x_227917 = x_227921;\n                    x_227918 = x_227922;\n                    x_227919 = x_227923;\n                    x_227920 = x_227924;\n                }\n            }\n            if (!no_carry_in_236794) {\n                if (!inactive_236795) {\n                    int64_t defunc_1_op_res_227925 = add64(x_227917, x_227921);\n                    int64_t defunc_1_op_res_227926 = add64(x_227918, x_227922);\n                    int64_t defunc_1_op_res_227927 = add64(x_227919, x_227923);\n                    int64_t defunc_1_op_res_227928 = add64(x_227920, x_227924);\n                    \n                    x_227917 = defunc_1_op_res_227925;\n                    x_227918 = defunc_1_op_res_227926;\n                    x_227919 = defunc_1_op_res_227927;\n                    x_227920 = defunc_1_op_res_227928;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_236794) {\n                ((__local\n                  int64_t *) color_232192)[sext_i32_i64(local_tid_236760)] =\n                    x_227917;\n                ((__local\n                  int64_t *) color_232191)[sext_i32_i64(local_tid_236760)] =\n                    x_227918;\n                ((__local\n                  int64_t *) color_232190)[sext_i32_i64",
            "(local_tid_236760)] =\n                    x_227919;\n                ((__local\n                  int64_t *) color_232189)[sext_i32_i64(local_tid_236760)] =\n                    x_227920;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_236760, 32) == 0 && ltid_in_bounds_236787) {\n            ((__local int64_t *) color_232192)[sext_i32_i64(local_tid_236760)] =\n                x_227921;\n            ((__local int64_t *) color_232191)[sext_i32_i64(local_tid_236760)] =\n                x_227922;\n            ((__local int64_t *) color_232190)[sext_i32_i64(local_tid_236760)] =\n                x_227923;\n            ((__local int64_t *) color_232189)[sext_i32_i64(local_tid_236760)] =\n                x_227924;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_227965;\n    \n    last_res_227965 = ((__local int64_t *) color_232192)[i_203760];\n    \n    int64_t last_res_227966;\n    \n    last_res_227966 = ((__local int64_t *) color_232191)[i_203760];\n    \n    int64_t last_res_227967;\n    \n    last_res_227967 = ((__local int64_t *) color_232190)[i_203760];\n    \n    int64_t write_i_227969 = sext_i32_i64(sext_i64_i32(ltid_pre_236764));\n    int32_t phys_tid_227970 = local_tid_236760;\n    int32_t x_227971;\n    \n    x_227971 = ((__local int32_t *) color_232188)[write_i_227969];\n    \n    double write_value_227976;\n    \n    write_value_227976 = ((__global double *) mem_param_231841)[gtid_227904 *\n                                                                n_203572 +\n                                                                write_i_227969];\n    \n    bool match_lit_227977 = 0 == x_227971;\n    int64_t defunc_1_f_res_227978;\n    \n    if (match_lit_227977) {\n        int64_t x_227972;\n        \n        x_227972 = ((__local int64_t *) color_232192)[write_i_227969];\n        \n        int64_t case_res_227979 = sub64(x_227972, (int64_t) 1);\n        \n        defunc_1_f_res_22",
            "7978 = case_res_227979;\n    } else {\n        bool match_lit_227980 = 1 == x_227971;\n        int64_t x_227981;\n        \n        if (match_lit_227980) {\n            int64_t x_227973;\n            \n            x_227973 = ((__local int64_t *) color_232191)[write_i_227969];\n            \n            int64_t x_227982 = add64(last_res_227965, x_227973);\n            int64_t case_res_227983 = sub64(x_227982, (int64_t) 1);\n            \n            x_227981 = case_res_227983;\n        } else {\n            bool match_lit_227984 = 2 == x_227971;\n            int64_t x_227985;\n            \n            if (match_lit_227984) {\n                int64_t x_227974;\n                \n                x_227974 = ((__local int64_t *) color_232190)[write_i_227969];\n                \n                int64_t x_227986 = add64(last_res_227965, last_res_227966);\n                int64_t x_227987 = add64(x_227974, x_227986);\n                int64_t case_res_227988 = sub64(x_227987, (int64_t) 1);\n                \n                x_227985 = case_res_227988;\n            } else {\n                int64_t x_227975;\n                \n                x_227975 = ((__local int64_t *) color_232189)[write_i_227969];\n                \n                int64_t x_227989 = add64(last_res_227965, last_res_227966);\n                int64_t x_227990 = add64(last_res_227967, x_227989);\n                int64_t x_227991 = add64(x_227975, x_227990);\n                int64_t defunc_1_f_res_res_227992 = sub64(x_227991,\n                                                          (int64_t) 1);\n                \n                x_227985 = defunc_1_f_res_res_227992;\n            }\n            x_227981 = x_227985;\n        }\n        defunc_1_f_res_227978 = x_227981;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_227978) &&\n        slt64(defunc_1_f_res_227978, n_203572)) {\n        ((__local double *) color_232193)[defunc_1_f_res_227978] =\n            write_value_227976;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236796;\n    \n ",
            "   tmp_236796 = ((__local\n                   double *) color_232193)[sext_i32_i64(local_tid_236760)];\n    ((__global double *) mem_231872)[gtid_227904 * n_203572 +\n                                     sext_i32_i64(local_tid_236760)] =\n        tmp_236796;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegred_large_212093(__global int *global_failure,\n                                        uint sync_arr_mem_233305_backing_offset_0,\n                                        uint red_arr_mem_233303_backing_offset_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212086,\n                                        int64_t groups_per_segment_233289,\n                                        int64_t elements_per_thread_233290,\n                                        int64_t virt_num_groups_233291,\n                                        int64_t threads_per_segment_233293,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229795,\n                                        __global unsigned char *mem_229805,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233294,\n                                        __global\n                                        unsigned char *mainzicounter_me",
            "m_233296)\n{\n    #define segred_group_sizze_212085 (mainzisegred_group_sizze_211266)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233305_backing_1 =\n                           &shared_mem[sync_arr_mem_233305_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233303_backing_0 =\n                           &shared_mem[red_arr_mem_233303_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233298;\n    int32_t local_tid_233299;\n    int64_t group_sizze_233302;\n    int32_t wave_sizze_233301;\n    int32_t group_tid_233300;\n    \n    global_tid_233298 = get_global_id(0);\n    local_tid_233299 = get_local_id(0);\n    group_sizze_233302 = get_local_size(0);\n    wave_sizze_233301 = LOCKSTEP_WIDTH;\n    group_tid_233300 = get_group_id(0);\n    \n    int32_t phys_tid_212093 = global_tid_233298;\n    __local unsigned char *red_arr_mem_233303;\n    \n    red_arr_mem_233303 = (__local unsigned char *) red_arr_mem_233303_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233305;\n    \n    sync_arr_mem_233305 = (__local\n                           unsigned char *) sync_arr_mem_233305_backing_1;\n    \n    int32_t phys_group_id_233307;\n    \n    phys_group_id_233307 = get_group_id(0);\n    for (int32_t i_233308 = 0; i_233308 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233291) - phys_group_id_233307,\n                   sext_i64_i32(num_groups_212086)); i_233308++) {\n        int32_t virt_group_id_233309 = phys_group_id_233307 + i_233308 *\n                sext_i64_i32(num_groups_212086);\n        int32_t flat_segment_id_233310 = squot32(virt_group_id_233309,\n                                                 sext_i64_i32(groups_per_segment_233289));\n        int64_t global_tid_233311 = srem64(sext_i32_i64(virt_group_id_233309) *\n                                           segred_group_sizze_212085 +\n                                           sext_i32_i64(loc",
            "al_tid_233299),\n                                           segred_group_sizze_212085 *\n                                           groups_per_segment_233289);\n        int64_t slice_233312 = s_n_m_203726;\n        int64_t slice_233313 = n_p_203574 * slice_233312;\n        int64_t slice_233314 = partition_sizze_203667 * slice_233313;\n        int64_t gtid_212089 = squot64(sext_i32_i64(flat_segment_id_233310),\n                                      slice_233313);\n        int64_t remnant_233315 = sext_i32_i64(flat_segment_id_233310) -\n                gtid_212089 * slice_233313;\n        int64_t gtid_212090 = squot64(remnant_233315, slice_233312);\n        int64_t remnant_233316 = remnant_233315 - gtid_212090 * slice_233312;\n        int64_t gtid_212091 = remnant_233316;\n        int64_t remnant_233317 = remnant_233316 - gtid_212091;\n        int64_t gtid_212092;\n        double x_acc_233318;\n        int64_t chunk_sizze_233319 = smin64(elements_per_thread_233290,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233311,\n                                                      threads_per_segment_233293));\n        double x_212094;\n        double x_212095;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233318 = 0.0;\n        }\n        for (int64_t i_233323 = 0; i_233323 < chunk_sizze_233319; i_233323++) {\n            gtid_212092 = global_tid_233311 + threads_per_segment_233293 *\n                i_233323;\n            // apply map function\n            {\n                int64_t x_212105;\n                \n                x_212105 = ((__global int64_t *) ext_mem_229372)[gtid_212089 *\n                                                                 n_p_203574 +\n                                                                 gtid_212090];\n                \n                int64_t x_212109;\n                \n                x_212109 = ((__global int64_t *) ext_mem_229471)[gtid_21",
            "2089 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212090 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212091];\n                \n                double x_212110;\n                \n                x_212110 = ((__global double *) ext_mem_229470)[gtid_212089 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212090 *\n                                                                s_n_m_203726 +\n                                                                gtid_212091];\n                \n                int64_t defunc_0_m_fun_res_212111;\n                \n                defunc_0_m_fun_res_212111 = ((__global\n                                              int64_t *) mem_229795)[gtid_212089 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212090 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212091];\n                \n                bool cond_212113 = sle64(x_212105, gtid_212092);\n                int64_t defunc_0_f_res_212114;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212114 = (int64_t) 0;\n                } else {\n                    int64_t i_212115 = add64(gtid_212092, x_212109);\n                    int64_t defunc_0_add_arg_212116;\n                    \n       ",
            "             defunc_0_add_arg_212116 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212089 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212090 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212115];\n                    \n                    int64_t defunc_1_add_res_212117 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212116);\n                    \n                    defunc_0_f_res_212114 = defunc_1_add_res_212117;\n                }\n                \n                double defunc_0_f_res_212118;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212118 = 0.0;\n                } else {\n                    int64_t i_212119 = add64(gtid_212092, x_212109);\n                    double defunc_0_add_arg_212120;\n                    \n                    defunc_0_add_arg_212120 = ((__global\n                                                double *) mem_229639)[gtid_212089 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212090 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212119];\n                    defunc_0_f_res_212118 = defunc_0_add_arg_212120;\n                }\n                \n                int64_t binop_p_212121 = sub64(defunc_0_f_res_212114,\n                        ",
            "                       defunc_0_m_fun_res_212111);\n                double defunc_0_f_res_212122 = sitofp_i64_f64(binop_p_212121);\n                double abs_res_212123 = fabs(defunc_0_f_res_212122);\n                double tmp1_212124 = abs_res_212123 / x_212110;\n                double x_212125 = tmp1_212124 * tmp1_212124;\n                double y_212126 = tmp1_212124 * x_212125;\n                double tmp2_212127 = 1.0 - y_212126;\n                double x_212128 = tmp2_212127 * tmp2_212127;\n                double tmp3_212129 = tmp2_212127 * x_212128;\n                double w_j_212130 = defunc_0_f_res_212118 * tmp3_212129;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212094 = x_acc_233318;\n                }\n                // load new values\n                {\n                    x_212095 = w_j_212130;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212096 = x_212094 + x_212095;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233318 = defunc_1_op_res_212096;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212094 = x_acc_233318;\n            ((__local\n              double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299)] =\n                x_212094;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233324;\n        int32_t skip_waves_233325 = 1;\n        double x_233320;\n        double x_233321;\n        \n        offset_233324 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233299,\n                      sext_i64_i32(segred_group_sizze_212085))) {\n                x_233320 = ((__local\n                             double *) red_arr_",
            "mem_233303)[sext_i32_i64(local_tid_233299 +\n                                                           offset_233324)];\n            }\n        }\n        offset_233324 = 1;\n        while (slt32(offset_233324, wave_sizze_233301)) {\n            if (slt32(local_tid_233299 + offset_233324,\n                      sext_i64_i32(segred_group_sizze_212085)) &&\n                ((local_tid_233299 - squot32(local_tid_233299,\n                                             wave_sizze_233301) *\n                  wave_sizze_233301) & (2 * offset_233324 - 1)) == 0) {\n                // read array element\n                {\n                    x_233321 = ((volatile __local\n                                 double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299 +\n                                                               offset_233324)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233322 = x_233320 + x_233321;\n                    \n                    x_233320 = defunc_1_op_res_233322;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299)] =\n                        x_233320;\n                }\n            }\n            offset_233324 *= 2;\n        }\n        while (slt32(skip_waves_233325,\n                     squot32(sext_i64_i32(segred_group_sizze_212085) +\n                             wave_sizze_233301 - 1, wave_sizze_233301))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233324 = skip_waves_233325 * wave_sizze_233301;\n            if (slt32(local_tid_233299 + offset_233324,\n                      sext_i64_i32(segred_group_sizze_212085)) &&\n                ((local_tid_233299 - squot32(local_tid_233299,\n                                             wave_sizze_233301) *\n                  wave_sizze_233301) == 0 && (squot32(local_tid_233299,\n     ",
            "                                                 wave_sizze_233301) & (2 *\n                                                                            skip_waves_233325 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233321 = ((__local\n                                 double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299 +\n                                                               offset_233324)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233322 = x_233320 + x_233321;\n                    \n                    x_233320 = defunc_1_op_res_233322;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299)] =\n                        x_233320;\n                }\n            }\n            skip_waves_233325 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233299) == (int64_t) 0) {\n                x_acc_233318 = x_233320;\n            }\n        }\n        if (groups_per_segment_233289 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233299 == 0) {\n                    ((__global double *) mem_229805)[gtid_212089 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_212090 *\n                                                     s_n_m_203726 +\n                                                     gtid_212091] =\n                        x_acc_233318;\n                }\n            }\n        } else {\n   ",
            "         int32_t old_counter_233326;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233299 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233294)[sext_i32_i64(virt_group_id_233309)] =\n                        x_acc_233318;\n                    mem_fence_global();\n                    old_counter_233326 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233296)[sext_i32_i64(srem32(flat_segment_id_233310,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233305)[(int64_t) 0] =\n                        old_counter_233326 == groups_per_segment_233289 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233327;\n            \n            is_last_group_233327 = ((__local\n                                     bool *) sync_arr_mem_233305)[(int64_t) 0];\n            if (is_last_group_233327) {\n                if (local_tid_233299 == 0) {\n                    old_counter_233326 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233296)[sext_i32_i64(srem32(flat_segment_id_233310,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233289));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233328 =\n                        ",
            "    sdiv_up64(groups_per_segment_233289,\n                                      segred_group_sizze_212085);\n                    \n                    x_212094 = 0.0;\n                    for (int64_t i_233329 = 0; i_233329 <\n                         read_per_thread_233328; i_233329++) {\n                        int64_t group_res_id_233330 =\n                                sext_i32_i64(local_tid_233299) *\n                                read_per_thread_233328 + i_233329;\n                        int64_t index_of_group_res_233331 =\n                                sext_i32_i64(flat_segment_id_233310) *\n                                groups_per_segment_233289 + group_res_id_233330;\n                        \n                        if (slt64(group_res_id_233330,\n                                  groups_per_segment_233289)) {\n                            x_212095 = ((__global\n                                         double *) segred_tmp_mem_233294)[index_of_group_res_233331];\n                            \n                            double defunc_1_op_res_212096 = x_212094 + x_212095;\n                            \n                            x_212094 = defunc_1_op_res_212096;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299)] =\n                    x_212094;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233332;\n                    int32_t skip_waves_233333 = 1;\n                    double x_233320;\n                    double x_233321;\n                    \n                    offset_233332 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233299,\n                                  sext_i64_i32(segred_group_sizze_212085))) {\n                            x_233320 = ((__local\n    ",
            "                                     double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299 +\n                                                                       offset_233332)];\n                        }\n                    }\n                    offset_233332 = 1;\n                    while (slt32(offset_233332, wave_sizze_233301)) {\n                        if (slt32(local_tid_233299 + offset_233332,\n                                  sext_i64_i32(segred_group_sizze_212085)) &&\n                            ((local_tid_233299 - squot32(local_tid_233299,\n                                                         wave_sizze_233301) *\n                              wave_sizze_233301) & (2 * offset_233332 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233321 = ((volatile __local\n                                             double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299 +\n                                                                           offset_233332)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233322 = x_233320 +\n                                       x_233321;\n                                \n                                x_233320 = defunc_1_op_res_233322;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299)] =\n                                    x_233320;\n                            }\n                        }\n                        offset_233332 *= 2;\n                    }\n                    while (slt32(skip_waves_233333,\n                                 squot32(sext_i64_i32(segred_group_sizze_2120",
            "85) +\n                                         wave_sizze_233301 - 1,\n                                         wave_sizze_233301))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233332 = skip_waves_233333 * wave_sizze_233301;\n                        if (slt32(local_tid_233299 + offset_233332,\n                                  sext_i64_i32(segred_group_sizze_212085)) &&\n                            ((local_tid_233299 - squot32(local_tid_233299,\n                                                         wave_sizze_233301) *\n                              wave_sizze_233301) == 0 &&\n                             (squot32(local_tid_233299, wave_sizze_233301) &\n                              (2 * skip_waves_233333 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233321 = ((__local\n                                             double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299 +\n                                                                           offset_233332)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233322 = x_233320 +\n                                       x_233321;\n                                \n                                x_233320 = defunc_1_op_res_233322;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233303)[sext_i32_i64(local_tid_233299)] =\n                                    x_233320;\n                            }\n                        }\n                        skip_waves_233333 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233299",
            " == 0) {\n                            ((__global double *) mem_229805)[gtid_212089 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212090 *\n                                                             s_n_m_203726 +\n                                                             gtid_212091] =\n                                x_233320;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_212085\n}\n__kernel void mainzisegred_large_212167(__global int *global_failure,\n                                        uint sync_arr_mem_233393_backing_offset_0,\n                                        uint red_arr_mem_233391_backing_offset_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212160,\n                                        int64_t groups_per_segment_233377,\n                                        int64_t elements_per_thread_233378,\n                                        int64_t virt_num_groups_233379,\n                                        int64_t threads_per_segment_233381,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *",
            "mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229811,\n                                        __global unsigned char *mem_229816,\n                                        __global unsigned char *mem_229822,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233382,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233384)\n{\n    #define segred_group_sizze_212159 (mainzisegred_group_sizze_211164)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233393_backing_1 =\n                           &shared_mem[sync_arr_mem_233393_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233391_backing_0 =\n                           &shared_mem[red_arr_mem_233391_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233386;\n    int32_t local_tid_233387;\n    int64_t group_sizze_233390;\n    int32_t wave_sizze_233389;\n    int32_t group_tid_233388;\n    \n    global_tid_233386 = get_global_id(0);\n    local_tid_233387 = get_local_id(0);\n    group_sizze_233390 = get_local_size(0);\n    wave_sizze_233389 = LOCKSTEP_WIDTH;\n    group_tid_233388 = get_group_id(0);\n    \n    int32_t phys_tid_212167 = global_tid_233386;\n    __local unsigned char *red_arr_mem_233391;\n    \n    red_arr_mem_233391 = (__local unsigned char *) red_arr_mem_233391_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233393;\n    \n    sync_arr_mem_233393 = (__local\n                           unsigned char *) sync_arr_mem_233393_backing_1;\n    \n    int32_t phys_group_id_233395;\n    \n    phys_group_id_233395 = get_group_id(0);\n    for (int32_t i_233396 = 0; i_233396 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233379) - phys_group_id_233395",
            ",\n                   sext_i64_i32(num_groups_212160)); i_233396++) {\n        int32_t virt_group_id_233397 = phys_group_id_233395 + i_233396 *\n                sext_i64_i32(num_groups_212160);\n        int32_t flat_segment_id_233398 = squot32(virt_group_id_233397,\n                                                 sext_i64_i32(groups_per_segment_233377));\n        int64_t global_tid_233399 = srem64(sext_i32_i64(virt_group_id_233397) *\n                                           segred_group_sizze_212159 +\n                                           sext_i32_i64(local_tid_233387),\n                                           segred_group_sizze_212159 *\n                                           groups_per_segment_233377);\n        int64_t slice_233400 = s_n_m_203726;\n        int64_t slice_233401 = n_p_203574 * slice_233400;\n        int64_t slice_233402 = partition_sizze_203667 * slice_233401;\n        int64_t gtid_212163 = squot64(sext_i32_i64(flat_segment_id_233398),\n                                      slice_233401);\n        int64_t remnant_233403 = sext_i32_i64(flat_segment_id_233398) -\n                gtid_212163 * slice_233401;\n        int64_t gtid_212164 = squot64(remnant_233403, slice_233400);\n        int64_t remnant_233404 = remnant_233403 - gtid_212164 * slice_233400;\n        int64_t gtid_212165 = remnant_233404;\n        int64_t remnant_233405 = remnant_233404 - gtid_212165;\n        int64_t gtid_212166;\n        double x_acc_233406;\n        int64_t chunk_sizze_233407 = smin64(elements_per_thread_233378,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233399,\n                                                      threads_per_segment_233381));\n        double x_212168;\n        double x_212169;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233406 = 0.0;\n        }\n        for (int64_t i_233411 = 0; i_233411 < chunk_sizze_233407; i_233411++) {\n            g",
            "tid_212166 = global_tid_233399 + threads_per_segment_233381 *\n                i_233411;\n            // apply map function\n            {\n                int64_t x_212182;\n                \n                x_212182 = ((__global int64_t *) ext_mem_229372)[gtid_212163 *\n                                                                 n_p_203574 +\n                                                                 gtid_212164];\n                \n                int64_t x_212187;\n                \n                x_212187 = ((__global int64_t *) ext_mem_229471)[gtid_212163 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212164 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212165];\n                \n                double x_212188;\n                \n                x_212188 = ((__global double *) ext_mem_229470)[gtid_212163 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212164 *\n                                                                s_n_m_203726 +\n                                                                gtid_212165];\n                \n                double a0_212189;\n                \n                a0_212189 = ((__global double *) mem_229811)[gtid_212163 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212164 *\n                                                             s_n_m_203726 +\n                                             ",
            "                gtid_212165];\n                \n                int64_t defunc_0_m_fun_res_212190;\n                \n                defunc_0_m_fun_res_212190 = ((__global\n                                              int64_t *) mem_229816)[gtid_212163 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212164 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212165];\n                \n                bool cond_212192 = sle64(x_212182, gtid_212166);\n                int64_t defunc_0_f_res_212193;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212193 = (int64_t) 0;\n                } else {\n                    int64_t i_212194 = add64(gtid_212166, x_212187);\n                    int64_t defunc_0_add_arg_212195;\n                    \n                    defunc_0_add_arg_212195 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212163 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212164 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212194];\n                    \n                    int64_t defunc_1_add_res_212196 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212195);\n                    \n                    defunc_0_f_res_212193 = defunc_1_add_res_212196;\n                }\n                \n       ",
            "         double defunc_0_f_res_212197;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212197 = 0.0;\n                } else {\n                    int64_t i_212198 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg_212199;\n                    \n                    defunc_0_add_arg_212199 = ((__global\n                                                double *) mem_229639)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212198];\n                    defunc_0_f_res_212197 = defunc_0_add_arg_212199;\n                }\n                \n                int64_t binop_p_212200 = sub64(defunc_0_f_res_212193,\n                                               defunc_0_m_fun_res_212190);\n                double defunc_0_f_res_212201 = sitofp_i64_f64(binop_p_212200);\n                double abs_res_212202 = fabs(defunc_0_f_res_212201);\n                double tmp1_212203 = abs_res_212202 / x_212188;\n                double x_212204 = tmp1_212203 * tmp1_212203;\n                double y_212205 = tmp1_212203 * x_212204;\n                double tmp2_212206 = 1.0 - y_212205;\n                double x_212207 = tmp2_212206 * tmp2_212206;\n                double tmp3_212208 = tmp2_212206 * x_212207;\n                double tmp4_212209 = defunc_0_f_res_212197 * tmp3_212208;\n                double defunc_0_f_res_212210;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212210 = 0.0;\n                } else {\n                    int64_t i_212211 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg",
            "_212212;\n                    \n                    defunc_0_add_arg_212212 = ((__global\n                                                double *) mem_229634)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212211];\n                    defunc_0_f_res_212210 = defunc_0_add_arg_212212;\n                }\n                \n                double x_212213 = a0_212189 * tmp4_212209;\n                double defunc_9_fit_fun_res_212214 = defunc_0_f_res_212210 *\n                       x_212213;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212168 = x_acc_233406;\n                }\n                // load new values\n                {\n                    x_212169 = defunc_9_fit_fun_res_212214;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212170 = x_212168 + x_212169;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233406 = defunc_1_op_res_212170;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212168 = x_acc_233406;\n            ((__local\n              double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387)] =\n                x_212168;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233412;\n        int32_t skip_waves_233413 = 1;\n        double x_233408;\n        double x_233409;\n        \n        offset_",
            "233412 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233387,\n                      sext_i64_i32(segred_group_sizze_212159))) {\n                x_233408 = ((__local\n                             double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387 +\n                                                           offset_233412)];\n            }\n        }\n        offset_233412 = 1;\n        while (slt32(offset_233412, wave_sizze_233389)) {\n            if (slt32(local_tid_233387 + offset_233412,\n                      sext_i64_i32(segred_group_sizze_212159)) &&\n                ((local_tid_233387 - squot32(local_tid_233387,\n                                             wave_sizze_233389) *\n                  wave_sizze_233389) & (2 * offset_233412 - 1)) == 0) {\n                // read array element\n                {\n                    x_233409 = ((volatile __local\n                                 double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387 +\n                                                               offset_233412)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233410 = x_233408 + x_233409;\n                    \n                    x_233408 = defunc_1_op_res_233410;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387)] =\n                        x_233408;\n                }\n            }\n            offset_233412 *= 2;\n        }\n        while (slt32(skip_waves_233413,\n                     squot32(sext_i64_i32(segred_group_sizze_212159) +\n                             wave_sizze_233389 - 1, wave_sizze_233389))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233412 = skip_waves_233413 * wave_sizze_233389;\n            if (slt32(local_tid_233387 + offset_233412,\n  ",
            "                    sext_i64_i32(segred_group_sizze_212159)) &&\n                ((local_tid_233387 - squot32(local_tid_233387,\n                                             wave_sizze_233389) *\n                  wave_sizze_233389) == 0 && (squot32(local_tid_233387,\n                                                      wave_sizze_233389) & (2 *\n                                                                            skip_waves_233413 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233409 = ((__local\n                                 double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387 +\n                                                               offset_233412)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233410 = x_233408 + x_233409;\n                    \n                    x_233408 = defunc_1_op_res_233410;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387)] =\n                        x_233408;\n                }\n            }\n            skip_waves_233413 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233387) == (int64_t) 0) {\n                x_acc_233406 = x_233408;\n            }\n        }\n        if (groups_per_segment_233377 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233387 == 0) {\n                    ((__global double *) mem_229822)[gtid_212163 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                       ",
            "                              gtid_212164 *\n                                                     s_n_m_203726 +\n                                                     gtid_212165] =\n                        x_acc_233406;\n                }\n            }\n        } else {\n            int32_t old_counter_233414;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233387 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233382)[sext_i32_i64(virt_group_id_233397)] =\n                        x_acc_233406;\n                    mem_fence_global();\n                    old_counter_233414 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233384)[sext_i32_i64(srem32(flat_segment_id_233398,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233393)[(int64_t) 0] =\n                        old_counter_233414 == groups_per_segment_233377 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233415;\n            \n            is_last_group_233415 = ((__local\n                                     bool *) sync_arr_mem_233393)[(int64_t) 0];\n            if (is_last_group_233415) {\n                if (local_tid_233387 == 0) {\n                    old_counter_233414 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233384)[sext_i32_i64(srem32(flat_segment_id_233398,\n                                                                                                      10240))],\n                                         ",
            "     (int) ((int64_t) 0 -\n                                                     groups_per_segment_233377));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233416 =\n                            sdiv_up64(groups_per_segment_233377,\n                                      segred_group_sizze_212159);\n                    \n                    x_212168 = 0.0;\n                    for (int64_t i_233417 = 0; i_233417 <\n                         read_per_thread_233416; i_233417++) {\n                        int64_t group_res_id_233418 =\n                                sext_i32_i64(local_tid_233387) *\n                                read_per_thread_233416 + i_233417;\n                        int64_t index_of_group_res_233419 =\n                                sext_i32_i64(flat_segment_id_233398) *\n                                groups_per_segment_233377 + group_res_id_233418;\n                        \n                        if (slt64(group_res_id_233418,\n                                  groups_per_segment_233377)) {\n                            x_212169 = ((__global\n                                         double *) segred_tmp_mem_233382)[index_of_group_res_233419];\n                            \n                            double defunc_1_op_res_212170 = x_212168 + x_212169;\n                            \n                            x_212168 = defunc_1_op_res_212170;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387)] =\n                    x_212168;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233420;\n                    int32_t skip_waves_233421 = 1;\n                    double x_233408;\n                    double x_233409;\n                    \n                    offset_233420 = 0;\n     ",
            "               // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233387,\n                                  sext_i64_i32(segred_group_sizze_212159))) {\n                            x_233408 = ((__local\n                                         double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387 +\n                                                                       offset_233420)];\n                        }\n                    }\n                    offset_233420 = 1;\n                    while (slt32(offset_233420, wave_sizze_233389)) {\n                        if (slt32(local_tid_233387 + offset_233420,\n                                  sext_i64_i32(segred_group_sizze_212159)) &&\n                            ((local_tid_233387 - squot32(local_tid_233387,\n                                                         wave_sizze_233389) *\n                              wave_sizze_233389) & (2 * offset_233420 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233409 = ((volatile __local\n                                             double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387 +\n                                                                           offset_233420)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233410 = x_233408 +\n                                       x_233409;\n                                \n                                x_233408 = defunc_1_op_res_233410;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387)] =\n                           ",
            "         x_233408;\n                            }\n                        }\n                        offset_233420 *= 2;\n                    }\n                    while (slt32(skip_waves_233421,\n                                 squot32(sext_i64_i32(segred_group_sizze_212159) +\n                                         wave_sizze_233389 - 1,\n                                         wave_sizze_233389))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233420 = skip_waves_233421 * wave_sizze_233389;\n                        if (slt32(local_tid_233387 + offset_233420,\n                                  sext_i64_i32(segred_group_sizze_212159)) &&\n                            ((local_tid_233387 - squot32(local_tid_233387,\n                                                         wave_sizze_233389) *\n                              wave_sizze_233389) == 0 &&\n                             (squot32(local_tid_233387, wave_sizze_233389) &\n                              (2 * skip_waves_233421 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233409 = ((__local\n                                             double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387 +\n                                                                           offset_233420)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233410 = x_233408 +\n                                       x_233409;\n                                \n                                x_233408 = defunc_1_op_res_233410;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233391)[sext_i32_i64(local_tid_233387)] =\n                                ",
            "    x_233408;\n                            }\n                        }\n                        skip_waves_233421 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233387 == 0) {\n                            ((__global double *) mem_229822)[gtid_212163 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212164 *\n                                                             s_n_m_203726 +\n                                                             gtid_212165] =\n                                x_233408;\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_212159\n}\n__kernel void mainzisegred_large_214227(__global int *global_failure,\n                                        uint sync_arr_mem_233658_backing_offset_0,\n                                        uint red_arr_mem_233656_backing_offset_1,\n                                        uint red_arr_mem_233654_backing_offset_2,\n                                        uint red_arr_mem_233652_backing_offset_3,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214218,\n                                        int64_t groups_per_segment_233634,\n                                        int64_t elements_per_thread_233635,\n                                        int64_t virt_num_groups_233636,\n                          ",
            "              int64_t threads_per_segment_233638,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230081,\n                                        __global unsigned char *mem_230091,\n                                        __global unsigned char *mem_230096,\n                                        __global unsigned char *mem_230101,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233639,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233641,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233643,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233645)\n{\n    #define segred_group_sizze_214217 (mainzisegred_group_sizze_213183)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233658_backing_3 =\n                           &shared_mem[sync_arr_mem_233658_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233656_backing_2 =\n                           &shared_mem[red_arr_mem_233656_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233654_backing_1 =\n                           &shared_mem[red_arr_mem_233654_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233652_backing_0 =\n                           &shared_mem[red_arr_mem_233652_backing_offset_3];\n    \n    if (*global_fai",
            "lure >= 0)\n        return;\n    \n    int32_t global_tid_233647;\n    int32_t local_tid_233648;\n    int64_t group_sizze_233651;\n    int32_t wave_sizze_233650;\n    int32_t group_tid_233649;\n    \n    global_tid_233647 = get_global_id(0);\n    local_tid_233648 = get_local_id(0);\n    group_sizze_233651 = get_local_size(0);\n    wave_sizze_233650 = LOCKSTEP_WIDTH;\n    group_tid_233649 = get_group_id(0);\n    \n    int32_t phys_tid_214227 = global_tid_233647;\n    __local unsigned char *red_arr_mem_233652;\n    \n    red_arr_mem_233652 = (__local unsigned char *) red_arr_mem_233652_backing_0;\n    \n    __local unsigned char *red_arr_mem_233654;\n    \n    red_arr_mem_233654 = (__local unsigned char *) red_arr_mem_233654_backing_1;\n    \n    __local unsigned char *red_arr_mem_233656;\n    \n    red_arr_mem_233656 = (__local unsigned char *) red_arr_mem_233656_backing_2;\n    \n    __local unsigned char *sync_arr_mem_233658;\n    \n    sync_arr_mem_233658 = (__local\n                           unsigned char *) sync_arr_mem_233658_backing_3;\n    \n    int32_t phys_group_id_233660;\n    \n    phys_group_id_233660 = get_group_id(0);\n    for (int32_t i_233661 = 0; i_233661 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233636) - phys_group_id_233660,\n                   sext_i64_i32(num_groups_214218)); i_233661++) {\n        int32_t virt_group_id_233662 = phys_group_id_233660 + i_233661 *\n                sext_i64_i32(num_groups_214218);\n        int32_t flat_segment_id_233663 = squot32(virt_group_id_233662,\n                                                 sext_i64_i32(groups_per_segment_233634));\n        int64_t global_tid_233664 = srem64(sext_i32_i64(virt_group_id_233662) *\n                                           segred_group_sizze_214217 +\n                                           sext_i32_i64(local_tid_233648),\n                                           segred_group_sizze_214217 *\n                                           groups_per_segment_233634);\n        int64_t slice_233665 = s_n_m_203726",
            ";\n        int64_t slice_233666 = n_p_203574 * slice_233665;\n        int64_t slice_233667 = partition_sizze_203667 * slice_233666;\n        int64_t gtid_214223 = squot64(sext_i32_i64(flat_segment_id_233663),\n                                      slice_233666);\n        int64_t remnant_233668 = sext_i32_i64(flat_segment_id_233663) -\n                gtid_214223 * slice_233666;\n        int64_t gtid_214224 = squot64(remnant_233668, slice_233665);\n        int64_t remnant_233669 = remnant_233668 - gtid_214224 * slice_233665;\n        int64_t gtid_214225 = remnant_233669;\n        int64_t remnant_233670 = remnant_233669 - gtid_214225;\n        int64_t gtid_214226;\n        double x_acc_233671;\n        double x_acc_233672;\n        double x_acc_233673;\n        int64_t chunk_sizze_233674 = smin64(elements_per_thread_233635,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233664,\n                                                      threads_per_segment_233638));\n        double x_214228;\n        double x_214229;\n        double x_214230;\n        double x_214231;\n        double x_214232;\n        double x_214233;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233671 = 0.0;\n            x_acc_233672 = 0.0;\n            x_acc_233673 = 0.0;\n        }\n        for (int64_t i_233684 = 0; i_233684 < chunk_sizze_233674; i_233684++) {\n            gtid_214226 = global_tid_233664 + threads_per_segment_233638 *\n                i_233684;\n            // apply map function\n            {\n                int64_t x_214245;\n                \n                x_214245 = ((__global int64_t *) ext_mem_229372)[gtid_214223 *\n                                                                 n_p_203574 +\n                                                                 gtid_214224];\n                \n                int64_t x_214249;\n                \n                x_214249 = ((__global int64_t *) ex",
            "t_mem_229471)[gtid_214223 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214224 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_214225];\n                \n                double x_214250;\n                \n                x_214250 = ((__global double *) ext_mem_229470)[gtid_214223 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214224 *\n                                                                s_n_m_203726 +\n                                                                gtid_214225];\n                \n                int64_t defunc_0_m_fun_res_214251;\n                \n                defunc_0_m_fun_res_214251 = ((__global\n                                              int64_t *) mem_230081)[gtid_214223 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214224 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214225];\n                \n                bool cond_214253 = sle64(x_214245, gtid_214226);\n                int64_t defunc_0_f_res_214254;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214254 = (int64_t) 0;\n                } else {\n                    int64_t i_214255 = add64(gtid_214226, x_214249);\n                    int64_t defunc_0_add_arg_214256;\n       ",
            "             \n                    defunc_0_add_arg_214256 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214223 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_214224 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214255];\n                    \n                    int64_t defunc_1_add_res_214257 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214256);\n                    \n                    defunc_0_f_res_214254 = defunc_1_add_res_214257;\n                }\n                \n                double defunc_0_f_res_214258;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214258 = 0.0;\n                } else {\n                    int64_t i_214259 = add64(gtid_214226, x_214249);\n                    double defunc_0_add_arg_214260;\n                    \n                    defunc_0_add_arg_214260 = ((__global\n                                                double *) mem_229639)[gtid_214223 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214224 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214259];\n                    defunc_0_f_res_214258 = defunc_0_add_arg_214260;\n                }\n                \n                int64_t binop_p_214261 = sub64(defunc_0_f_res_214254,\n   ",
            "                                            defunc_0_m_fun_res_214251);\n                double defunc_0_f_res_214262 = sitofp_i64_f64(binop_p_214261);\n                double abs_res_214263 = fabs(defunc_0_f_res_214262);\n                double tmp1_214264 = abs_res_214263 / x_214250;\n                double x_214265 = tmp1_214264 * tmp1_214264;\n                double y_214266 = tmp1_214264 * x_214265;\n                double tmp2_214267 = 1.0 - y_214266;\n                double x_214268 = tmp2_214267 * tmp2_214267;\n                double tmp3_214269 = tmp2_214267 * x_214268;\n                double w_j_214270 = defunc_0_f_res_214258 * tmp3_214269;\n                double xw_j_214271 = defunc_0_f_res_214262 * w_j_214270;\n                double x2w_j_214272 = defunc_0_f_res_214262 * xw_j_214271;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214228 = x_acc_233671;\n                    x_214229 = x_acc_233672;\n                    x_214230 = x_acc_233673;\n                }\n                // load new values\n                {\n                    x_214231 = w_j_214270;\n                    x_214232 = xw_j_214271;\n                    x_214233 = x2w_j_214272;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214234 = x_214228 + x_214231;\n                    double defunc_1_op_res_214235 = x_214229 + x_214232;\n                    double defunc_1_op_res_214236 = x_214230 + x_214233;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233671 = defunc_1_op_res_214234;\n                        x_acc_233672 = defunc_1_op_res_214235;\n                        x_acc_233673 = defunc_1_op_res_214236;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_",
            "214228 = x_acc_233671;\n            x_214229 = x_acc_233672;\n            x_214230 = x_acc_233673;\n            ((__local\n              double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648)] =\n                x_214228;\n            ((__local\n              double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648)] =\n                x_214229;\n            ((__local\n              double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648)] =\n                x_214230;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233685;\n        int32_t skip_waves_233686 = 1;\n        double x_233675;\n        double x_233676;\n        double x_233677;\n        double x_233678;\n        double x_233679;\n        double x_233680;\n        \n        offset_233685 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233648,\n                      sext_i64_i32(segred_group_sizze_214217))) {\n                x_233675 = ((__local\n                             double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648 +\n                                                           offset_233685)];\n                x_233676 = ((__local\n                             double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648 +\n                                                           offset_233685)];\n                x_233677 = ((__local\n                             double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648 +\n                                                           offset_233685)];\n            }\n        }\n        offset_233685 = 1;\n        while (slt32(offset_233685, wave_sizze_233650)) {\n            if (slt32(local_tid_233648 + offset_233685,\n                      sext_i64_i32(segred_group_sizze_214217)) &&\n                ((local_tid_233648 - squot32(local_tid_233648,\n                                             wave_sizze_233650) *\n                  wave_sizze_233650) & (2 * offset_233685 - 1)) ==",
            " 0) {\n                // read array element\n                {\n                    x_233678 = ((volatile __local\n                                 double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648 +\n                                                               offset_233685)];\n                    x_233679 = ((volatile __local\n                                 double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648 +\n                                                               offset_233685)];\n                    x_233680 = ((volatile __local\n                                 double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648 +\n                                                               offset_233685)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233681 = x_233675 + x_233678;\n                    double defunc_1_op_res_233682 = x_233676 + x_233679;\n                    double defunc_1_op_res_233683 = x_233677 + x_233680;\n                    \n                    x_233675 = defunc_1_op_res_233681;\n                    x_233676 = defunc_1_op_res_233682;\n                    x_233677 = defunc_1_op_res_233683;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648)] =\n                        x_233675;\n                    ((volatile __local\n                      double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648)] =\n                        x_233676;\n                    ((volatile __local\n                      double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648)] =\n                        x_233677;\n                }\n            }\n            offset_233685 *= 2;\n        }\n        while (slt32(skip_waves_233686,\n                     squot32(sext_i64_i32(segred_group_sizze_214217) +\n                             wave_",
            "sizze_233650 - 1, wave_sizze_233650))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233685 = skip_waves_233686 * wave_sizze_233650;\n            if (slt32(local_tid_233648 + offset_233685,\n                      sext_i64_i32(segred_group_sizze_214217)) &&\n                ((local_tid_233648 - squot32(local_tid_233648,\n                                             wave_sizze_233650) *\n                  wave_sizze_233650) == 0 && (squot32(local_tid_233648,\n                                                      wave_sizze_233650) & (2 *\n                                                                            skip_waves_233686 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233678 = ((__local\n                                 double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648 +\n                                                               offset_233685)];\n                    x_233679 = ((__local\n                                 double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648 +\n                                                               offset_233685)];\n                    x_233680 = ((__local\n                                 double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648 +\n                                                               offset_233685)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233681 = x_233675 + x_233678;\n                    double defunc_1_op_res_233682 = x_233676 + x_233679;\n                    double defunc_1_op_res_233683 = x_233677 + x_233680;\n                    \n                    x_233675 = defunc_1_op_res_233681;\n                    x_233676 = defunc_1_op_res_233682;\n                    x_233677 = defunc_1_op_res_233683;\n                }\n                // write result of op",
            "eration\n                {\n                    ((__local\n                      double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648)] =\n                        x_233675;\n                    ((__local\n                      double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648)] =\n                        x_233676;\n                    ((__local\n                      double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648)] =\n                        x_233677;\n                }\n            }\n            skip_waves_233686 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233648) == (int64_t) 0) {\n                x_acc_233671 = x_233675;\n                x_acc_233672 = x_233676;\n                x_acc_233673 = x_233677;\n            }\n        }\n        if (groups_per_segment_233634 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233648 == 0) {\n                    ((__global double *) mem_230091)[gtid_214223 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214224 *\n                                                     s_n_m_203726 +\n                                                     gtid_214225] =\n                        x_acc_233671;\n                    ((__global double *) mem_230096)[gtid_214223 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214224 *\n                                                     s_n_m_203726 +\n                                                     gtid_214225] =\n                        x_acc_233672;\n                    ((__global double *) mem_230101)[gtid_2",
            "14223 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214224 *\n                                                     s_n_m_203726 +\n                                                     gtid_214225] =\n                        x_acc_233673;\n                }\n            }\n        } else {\n            int32_t old_counter_233687;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233648 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233639)[sext_i32_i64(virt_group_id_233662)] =\n                        x_acc_233671;\n                    ((__global\n                      double *) segred_tmp_mem_233641)[sext_i32_i64(virt_group_id_233662)] =\n                        x_acc_233672;\n                    ((__global\n                      double *) segred_tmp_mem_233643)[sext_i32_i64(virt_group_id_233662)] =\n                        x_acc_233673;\n                    mem_fence_global();\n                    old_counter_233687 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233645)[sext_i32_i64(srem32(flat_segment_id_233663,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233658)[(int64_t) 0] =\n                        old_counter_233687 == groups_per_segment_233634 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233688;\n            \n            is_last_group_233688 = ((__local\n                                     bool *) sync_arr_mem_23",
            "3658)[(int64_t) 0];\n            if (is_last_group_233688) {\n                if (local_tid_233648 == 0) {\n                    old_counter_233687 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233645)[sext_i32_i64(srem32(flat_segment_id_233663,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233634));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233689 =\n                            sdiv_up64(groups_per_segment_233634,\n                                      segred_group_sizze_214217);\n                    \n                    x_214228 = 0.0;\n                    x_214229 = 0.0;\n                    x_214230 = 0.0;\n                    for (int64_t i_233690 = 0; i_233690 <\n                         read_per_thread_233689; i_233690++) {\n                        int64_t group_res_id_233691 =\n                                sext_i32_i64(local_tid_233648) *\n                                read_per_thread_233689 + i_233690;\n                        int64_t index_of_group_res_233692 =\n                                sext_i32_i64(flat_segment_id_233663) *\n                                groups_per_segment_233634 + group_res_id_233691;\n                        \n                        if (slt64(group_res_id_233691,\n                                  groups_per_segment_233634)) {\n                            x_214231 = ((__global\n                                         double *) segred_tmp_mem_233639)[index_of_group_res_233692];\n                            x_214232 = ((__global\n                                         double *) segred_tmp_mem_233641)[index_of_group_res_233692];\n                            x_21423",
            "3 = ((__global\n                                         double *) segred_tmp_mem_233643)[index_of_group_res_233692];\n                            \n                            double defunc_1_op_res_214234 = x_214228 + x_214231;\n                            double defunc_1_op_res_214235 = x_214229 + x_214232;\n                            double defunc_1_op_res_214236 = x_214230 + x_214233;\n                            \n                            x_214228 = defunc_1_op_res_214234;\n                            x_214229 = defunc_1_op_res_214235;\n                            x_214230 = defunc_1_op_res_214236;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648)] =\n                    x_214228;\n                ((__local\n                  double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648)] =\n                    x_214229;\n                ((__local\n                  double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648)] =\n                    x_214230;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233693;\n                    int32_t skip_waves_233694 = 1;\n                    double x_233675;\n                    double x_233676;\n                    double x_233677;\n                    double x_233678;\n                    double x_233679;\n                    double x_233680;\n                    \n                    offset_233693 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233648,\n                                  sext_i64_i32(segred_group_sizze_214217))) {\n                            x_233675 = ((__local\n                                         double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648 +\n                                                   ",
            "                    offset_233693)];\n                            x_233676 = ((__local\n                                         double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648 +\n                                                                       offset_233693)];\n                            x_233677 = ((__local\n                                         double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648 +\n                                                                       offset_233693)];\n                        }\n                    }\n                    offset_233693 = 1;\n                    while (slt32(offset_233693, wave_sizze_233650)) {\n                        if (slt32(local_tid_233648 + offset_233693,\n                                  sext_i64_i32(segred_group_sizze_214217)) &&\n                            ((local_tid_233648 - squot32(local_tid_233648,\n                                                         wave_sizze_233650) *\n                              wave_sizze_233650) & (2 * offset_233693 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233678 = ((volatile __local\n                                             double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648 +\n                                                                           offset_233693)];\n                                x_233679 = ((volatile __local\n                                             double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648 +\n                                                                           offset_233693)];\n                                x_233680 = ((volatile __local\n                                             double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648 +\n                                                                           offset_233693)];\n                            }\n                      ",
            "      // apply reduction operation\n                            {\n                                double defunc_1_op_res_233681 = x_233675 +\n                                       x_233678;\n                                double defunc_1_op_res_233682 = x_233676 +\n                                       x_233679;\n                                double defunc_1_op_res_233683 = x_233677 +\n                                       x_233680;\n                                \n                                x_233675 = defunc_1_op_res_233681;\n                                x_233676 = defunc_1_op_res_233682;\n                                x_233677 = defunc_1_op_res_233683;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648)] =\n                                    x_233675;\n                                ((volatile __local\n                                  double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648)] =\n                                    x_233676;\n                                ((volatile __local\n                                  double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648)] =\n                                    x_233677;\n                            }\n                        }\n                        offset_233693 *= 2;\n                    }\n                    while (slt32(skip_waves_233694,\n                                 squot32(sext_i64_i32(segred_group_sizze_214217) +\n                                         wave_sizze_233650 - 1,\n                                         wave_sizze_233650))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233693 = skip_waves_233694 * wave_sizze_233650;\n                        if (slt32(local_tid_233648 + offset_233693,\n                                  sext_i6",
            "4_i32(segred_group_sizze_214217)) &&\n                            ((local_tid_233648 - squot32(local_tid_233648,\n                                                         wave_sizze_233650) *\n                              wave_sizze_233650) == 0 &&\n                             (squot32(local_tid_233648, wave_sizze_233650) &\n                              (2 * skip_waves_233694 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233678 = ((__local\n                                             double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648 +\n                                                                           offset_233693)];\n                                x_233679 = ((__local\n                                             double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648 +\n                                                                           offset_233693)];\n                                x_233680 = ((__local\n                                             double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648 +\n                                                                           offset_233693)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233681 = x_233675 +\n                                       x_233678;\n                                double defunc_1_op_res_233682 = x_233676 +\n                                       x_233679;\n                                double defunc_1_op_res_233683 = x_233677 +\n                                       x_233680;\n                                \n                                x_233675 = defunc_1_op_res_233681;\n                                x_233676 = defunc_1_op_res_233682;\n                                x_233677 = defunc_1_op_res_233683;\n                            }\n                   ",
            "         // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233652)[sext_i32_i64(local_tid_233648)] =\n                                    x_233675;\n                                ((__local\n                                  double *) red_arr_mem_233654)[sext_i32_i64(local_tid_233648)] =\n                                    x_233676;\n                                ((__local\n                                  double *) red_arr_mem_233656)[sext_i32_i64(local_tid_233648)] =\n                                    x_233677;\n                            }\n                        }\n                        skip_waves_233694 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233648 == 0) {\n                            ((__global double *) mem_230091)[gtid_214223 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214224 *\n                                                             s_n_m_203726 +\n                                                             gtid_214225] =\n                                x_233675;\n                            ((__global double *) mem_230096)[gtid_214223 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214224 *\n                                                             s_n_m_203726 +\n                                                             gtid_214225] =\n                                x_233676;\n                            ((__global double *) mem_230101)[gtid_214223 *\n                                        ",
            "                     (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214224 *\n                                                             s_n_m_203726 +\n                                                             gtid_214225] =\n                                x_233677;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214217\n}\n__kernel void mainzisegred_large_214321(__global int *global_failure,\n                                        uint sync_arr_mem_233764_backing_offset_0,\n                                        uint red_arr_mem_233762_backing_offset_1,\n                                        uint red_arr_mem_233760_backing_offset_2,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214313,\n                                        int64_t groups_per_segment_233744,\n                                        int64_t elements_per_thread_233745,\n                                        int64_t virt_num_groups_233746,\n                                        int64_t threads_per_segment_233748,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                              ",
            "          __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230107,\n                                        __global unsigned char *mem_230112,\n                                        __global unsigned char *mem_230117,\n                                        __global unsigned char *mem_230122,\n                                        __global unsigned char *mem_230128,\n                                        __global unsigned char *mem_230133,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233749,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233751,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233753)\n{\n    #define segred_group_sizze_214312 (mainzisegred_group_sizze_213050)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_233764_backing_2 =\n                           &shared_mem[sync_arr_mem_233764_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233762_backing_1 =\n                           &shared_mem[red_arr_mem_233762_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233760_backing_0 =\n                           &shared_mem[red_arr_mem_233760_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233755;\n    int32_t local_tid_233756;\n    int64_t group_sizze_233759;\n    int32_t wave_sizze_233758;\n    int32_t group_tid_233757;\n    \n    global_tid_233755 = get_global_id(0);\n    local_tid_233756 = get_local_id(0);\n    group_sizze_233759 = get_local_size(0);\n    wave_sizze_233758 = LOCKSTEP_WIDTH;\n    group_tid_233757 = get_group_id(0);\n    \n    int32_t phys_tid_214321 = global_tid_233755;\n    __local unsigned char *red_arr_mem_233760;\n    \n    red_",
            "arr_mem_233760 = (__local unsigned char *) red_arr_mem_233760_backing_0;\n    \n    __local unsigned char *red_arr_mem_233762;\n    \n    red_arr_mem_233762 = (__local unsigned char *) red_arr_mem_233762_backing_1;\n    \n    __local unsigned char *sync_arr_mem_233764;\n    \n    sync_arr_mem_233764 = (__local\n                           unsigned char *) sync_arr_mem_233764_backing_2;\n    \n    int32_t phys_group_id_233766;\n    \n    phys_group_id_233766 = get_group_id(0);\n    for (int32_t i_233767 = 0; i_233767 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233746) - phys_group_id_233766,\n                   sext_i64_i32(num_groups_214313)); i_233767++) {\n        int32_t virt_group_id_233768 = phys_group_id_233766 + i_233767 *\n                sext_i64_i32(num_groups_214313);\n        int32_t flat_segment_id_233769 = squot32(virt_group_id_233768,\n                                                 sext_i64_i32(groups_per_segment_233744));\n        int64_t global_tid_233770 = srem64(sext_i32_i64(virt_group_id_233768) *\n                                           segred_group_sizze_214312 +\n                                           sext_i32_i64(local_tid_233756),\n                                           segred_group_sizze_214312 *\n                                           groups_per_segment_233744);\n        int64_t slice_233771 = s_n_m_203726;\n        int64_t slice_233772 = n_p_203574 * slice_233771;\n        int64_t slice_233773 = partition_sizze_203667 * slice_233772;\n        int64_t gtid_214317 = squot64(sext_i32_i64(flat_segment_id_233769),\n                                      slice_233772);\n        int64_t remnant_233774 = sext_i32_i64(flat_segment_id_233769) -\n                gtid_214317 * slice_233772;\n        int64_t gtid_214318 = squot64(remnant_233774, slice_233771);\n        int64_t remnant_233775 = remnant_233774 - gtid_214318 * slice_233771;\n        int64_t gtid_214319 = remnant_233775;\n        int64_t remnant_233776 = remnant_233775 - gtid_214319;\n        int64_t gt",
            "id_214320;\n        double x_acc_233777;\n        double x_acc_233778;\n        int64_t chunk_sizze_233779 = smin64(elements_per_thread_233745,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_233770,\n                                                      threads_per_segment_233748));\n        double x_214322;\n        double x_214323;\n        double x_214324;\n        double x_214325;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233777 = 0.0;\n            x_acc_233778 = 0.0;\n        }\n        for (int64_t i_233786 = 0; i_233786 < chunk_sizze_233779; i_233786++) {\n            gtid_214320 = global_tid_233770 + threads_per_segment_233748 *\n                i_233786;\n            // apply map function\n            {\n                int64_t x_214341;\n                \n                x_214341 = ((__global int64_t *) ext_mem_229372)[gtid_214317 *\n                                                                 n_p_203574 +\n                                                                 gtid_214318];\n                \n                int64_t x_214348;\n                \n                x_214348 = ((__global int64_t *) ext_mem_229471)[gtid_214317 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214318 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_214319];\n                \n                double x_214349;\n                \n                x_214349 = ((__global double *) ext_mem_229470)[gtid_214317 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                             ",
            "                                   gtid_214318 *\n                                                                s_n_m_203726 +\n                                                                gtid_214319];\n                \n                double a11_214350;\n                \n                a11_214350 = ((__global double *) mem_230107)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double b11_214351;\n                \n                b11_214351 = ((__global double *) mem_230112)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double c11_214352;\n                \n                c11_214352 = ((__global double *) mem_230117)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                int64_t defunc_0_m_fun_res_214353;\n                \n                defunc_0_m_fun_res_214353 = ((__global\n                                              int64_t *) mem_230122",
            ")[gtid_214317 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214318 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214319];\n                \n                bool cond_214355 = sle64(x_214341, gtid_214320);\n                int64_t defunc_0_f_res_214356;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214356 = (int64_t) 0;\n                } else {\n                    int64_t i_214357 = add64(gtid_214320, x_214348);\n                    int64_t defunc_0_add_arg_214358;\n                    \n                    defunc_0_add_arg_214358 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214317 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_214318 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214357];\n                    \n                    int64_t defunc_1_add_res_214359 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214358);\n                    \n                    defunc_0_f_res_214356 = defunc_1_add_res_214359;\n                }\n                \n                double defunc_0_f_res_214360;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214360 = 0.0;\n                } else {\n                    int64_t i_214361 = add64(gtid_214320, x_214348);\n   ",
            "                 double defunc_0_add_arg_214362;\n                    \n                    defunc_0_add_arg_214362 = ((__global\n                                                double *) mem_229639)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214361];\n                    defunc_0_f_res_214360 = defunc_0_add_arg_214362;\n                }\n                \n                int64_t binop_p_214363 = sub64(defunc_0_f_res_214356,\n                                               defunc_0_m_fun_res_214353);\n                double defunc_0_f_res_214364 = sitofp_i64_f64(binop_p_214363);\n                double abs_res_214365 = fabs(defunc_0_f_res_214364);\n                double tmp1_214366 = abs_res_214365 / x_214349;\n                double x_214367 = tmp1_214366 * tmp1_214366;\n                double y_214368 = tmp1_214366 * x_214367;\n                double tmp2_214369 = 1.0 - y_214368;\n                double x_214370 = tmp2_214369 * tmp2_214369;\n                double tmp3_214371 = tmp2_214369 * x_214370;\n                double tmp4_214372 = defunc_0_f_res_214360 * tmp3_214371;\n                double defunc_1_f_res_214373 = defunc_0_f_res_214364 *\n                       tmp4_214372;\n                double defunc_0_f_res_214374;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214374 = 0.0;\n                } else {\n                    int64_t i_214375 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_214376;\n                    \n                    defunc_0_add_arg_214376 = ((__global\n                                           ",
            "     double *) mem_229634)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214375];\n                    defunc_0_f_res_214374 = defunc_0_add_arg_214376;\n                }\n                \n                double x_214377 = a11_214350 * tmp4_214372;\n                double y_214378 = b11_214351 * defunc_1_f_res_214373;\n                double x_214379 = x_214377 + y_214378;\n                double defunc_9_fit_fun_res_214380 = defunc_0_f_res_214374 *\n                       x_214379;\n                double x_214381 = b11_214351 * tmp4_214372;\n                double y_214382 = c11_214352 * defunc_1_f_res_214373;\n                double x_214383 = x_214381 + y_214382;\n                double defunc_9_slope_fun_res_214384 = defunc_0_f_res_214374 *\n                       x_214383;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214322 = x_acc_233777;\n                    x_214323 = x_acc_233778;\n                }\n                // load new values\n                {\n                    x_214324 = defunc_9_fit_fun_res_214380;\n                    x_214325 = defunc_9_slope_fun_res_214384;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214326 = x_214322 + x_214324;\n                    double defunc_1_op_res_214327 = x_214323 + x_214325;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233777 = defunc_1_op_res_214326;\n                        x_acc_2337",
            "78 = defunc_1_op_res_214327;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_214322 = x_acc_233777;\n            x_214323 = x_acc_233778;\n            ((__local\n              double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756)] =\n                x_214322;\n            ((__local\n              double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756)] =\n                x_214323;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233787;\n        int32_t skip_waves_233788 = 1;\n        double x_233780;\n        double x_233781;\n        double x_233782;\n        double x_233783;\n        \n        offset_233787 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233756,\n                      sext_i64_i32(segred_group_sizze_214312))) {\n                x_233780 = ((__local\n                             double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756 +\n                                                           offset_233787)];\n                x_233781 = ((__local\n                             double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756 +\n                                                           offset_233787)];\n            }\n        }\n        offset_233787 = 1;\n        while (slt32(offset_233787, wave_sizze_233758)) {\n            if (slt32(local_tid_233756 + offset_233787,\n                      sext_i64_i32(segred_group_sizze_214312)) &&\n                ((local_tid_233756 - squot32(local_tid_233756,\n                                             wave_sizze_233758) *\n                  wave_sizze_233758) & (2 * offset_233787 - 1)) == 0) {\n                // read array element\n                {\n                    x_233782 = ((volatile __local\n                                 double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756 +\n                        ",
            "                                       offset_233787)];\n                    x_233783 = ((volatile __local\n                                 double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756 +\n                                                               offset_233787)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233784 = x_233780 + x_233782;\n                    double defunc_1_op_res_233785 = x_233781 + x_233783;\n                    \n                    x_233780 = defunc_1_op_res_233784;\n                    x_233781 = defunc_1_op_res_233785;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756)] =\n                        x_233780;\n                    ((volatile __local\n                      double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756)] =\n                        x_233781;\n                }\n            }\n            offset_233787 *= 2;\n        }\n        while (slt32(skip_waves_233788,\n                     squot32(sext_i64_i32(segred_group_sizze_214312) +\n                             wave_sizze_233758 - 1, wave_sizze_233758))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233787 = skip_waves_233788 * wave_sizze_233758;\n            if (slt32(local_tid_233756 + offset_233787,\n                      sext_i64_i32(segred_group_sizze_214312)) &&\n                ((local_tid_233756 - squot32(local_tid_233756,\n                                             wave_sizze_233758) *\n                  wave_sizze_233758) == 0 && (squot32(local_tid_233756,\n                                                      wave_sizze_233758) & (2 *\n                                                                            skip_waves_233788 -\n                                                                            1)) ==\n           ",
            "      0)) {\n                // read array element\n                {\n                    x_233782 = ((__local\n                                 double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756 +\n                                                               offset_233787)];\n                    x_233783 = ((__local\n                                 double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756 +\n                                                               offset_233787)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233784 = x_233780 + x_233782;\n                    double defunc_1_op_res_233785 = x_233781 + x_233783;\n                    \n                    x_233780 = defunc_1_op_res_233784;\n                    x_233781 = defunc_1_op_res_233785;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756)] =\n                        x_233780;\n                    ((__local\n                      double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756)] =\n                        x_233781;\n                }\n            }\n            skip_waves_233788 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233756) == (int64_t) 0) {\n                x_acc_233777 = x_233780;\n                x_acc_233778 = x_233781;\n            }\n        }\n        if (groups_per_segment_233744 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233756 == 0) {\n                    ((__global double *) mem_230128)[gtid_214317 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                       ",
            "                              gtid_214318 *\n                                                     s_n_m_203726 +\n                                                     gtid_214319] =\n                        x_acc_233777;\n                    ((__global double *) mem_230133)[gtid_214317 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_214318 *\n                                                     s_n_m_203726 +\n                                                     gtid_214319] =\n                        x_acc_233778;\n                }\n            }\n        } else {\n            int32_t old_counter_233789;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233756 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233749)[sext_i32_i64(virt_group_id_233768)] =\n                        x_acc_233777;\n                    ((__global\n                      double *) segred_tmp_mem_233751)[sext_i32_i64(virt_group_id_233768)] =\n                        x_acc_233778;\n                    mem_fence_global();\n                    old_counter_233789 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233753)[sext_i32_i64(srem32(flat_segment_id_233769,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233764)[(int64_t) 0] =\n                        old_counter_233789 == groups_per_segment_233744 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233790;\n   ",
            "         \n            is_last_group_233790 = ((__local\n                                     bool *) sync_arr_mem_233764)[(int64_t) 0];\n            if (is_last_group_233790) {\n                if (local_tid_233756 == 0) {\n                    old_counter_233789 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233753)[sext_i32_i64(srem32(flat_segment_id_233769,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233744));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233791 =\n                            sdiv_up64(groups_per_segment_233744,\n                                      segred_group_sizze_214312);\n                    \n                    x_214322 = 0.0;\n                    x_214323 = 0.0;\n                    for (int64_t i_233792 = 0; i_233792 <\n                         read_per_thread_233791; i_233792++) {\n                        int64_t group_res_id_233793 =\n                                sext_i32_i64(local_tid_233756) *\n                                read_per_thread_233791 + i_233792;\n                        int64_t index_of_group_res_233794 =\n                                sext_i32_i64(flat_segment_id_233769) *\n                                groups_per_segment_233744 + group_res_id_233793;\n                        \n                        if (slt64(group_res_id_233793,\n                                  groups_per_segment_233744)) {\n                            x_214324 = ((__global\n                                         double *) segred_tmp_mem_233749)[index_of_group_res_233794];\n                            x_214325 = ((__global\n                                         double *) segred_",
            "tmp_mem_233751)[index_of_group_res_233794];\n                            \n                            double defunc_1_op_res_214326 = x_214322 + x_214324;\n                            double defunc_1_op_res_214327 = x_214323 + x_214325;\n                            \n                            x_214322 = defunc_1_op_res_214326;\n                            x_214323 = defunc_1_op_res_214327;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756)] =\n                    x_214322;\n                ((__local\n                  double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756)] =\n                    x_214323;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233795;\n                    int32_t skip_waves_233796 = 1;\n                    double x_233780;\n                    double x_233781;\n                    double x_233782;\n                    double x_233783;\n                    \n                    offset_233795 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233756,\n                                  sext_i64_i32(segred_group_sizze_214312))) {\n                            x_233780 = ((__local\n                                         double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756 +\n                                                                       offset_233795)];\n                            x_233781 = ((__local\n                                         double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756 +\n                                                                       offset_233795)];\n                        }\n                    }\n                    offset_233795 = 1;\n                    while (slt32(offset_233795, wave_sizze_233758",
            ")) {\n                        if (slt32(local_tid_233756 + offset_233795,\n                                  sext_i64_i32(segred_group_sizze_214312)) &&\n                            ((local_tid_233756 - squot32(local_tid_233756,\n                                                         wave_sizze_233758) *\n                              wave_sizze_233758) & (2 * offset_233795 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233782 = ((volatile __local\n                                             double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756 +\n                                                                           offset_233795)];\n                                x_233783 = ((volatile __local\n                                             double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756 +\n                                                                           offset_233795)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233784 = x_233780 +\n                                       x_233782;\n                                double defunc_1_op_res_233785 = x_233781 +\n                                       x_233783;\n                                \n                                x_233780 = defunc_1_op_res_233784;\n                                x_233781 = defunc_1_op_res_233785;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756)] =\n                                    x_233780;\n                                ((volatile __local\n                                  double *) red_arr_mem_233762)[sext_i32_i64(local_tid_",
            "233756)] =\n                                    x_233781;\n                            }\n                        }\n                        offset_233795 *= 2;\n                    }\n                    while (slt32(skip_waves_233796,\n                                 squot32(sext_i64_i32(segred_group_sizze_214312) +\n                                         wave_sizze_233758 - 1,\n                                         wave_sizze_233758))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233795 = skip_waves_233796 * wave_sizze_233758;\n                        if (slt32(local_tid_233756 + offset_233795,\n                                  sext_i64_i32(segred_group_sizze_214312)) &&\n                            ((local_tid_233756 - squot32(local_tid_233756,\n                                                         wave_sizze_233758) *\n                              wave_sizze_233758) == 0 &&\n                             (squot32(local_tid_233756, wave_sizze_233758) &\n                              (2 * skip_waves_233796 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233782 = ((__local\n                                             double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756 +\n                                                                           offset_233795)];\n                                x_233783 = ((__local\n                                             double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756 +\n                                                                           offset_233795)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233784 = x_233780 +\n                                       x_233782;\n                                double defunc_1_op_res_233785 = x_233781 +\n                        ",
            "               x_233783;\n                                \n                                x_233780 = defunc_1_op_res_233784;\n                                x_233781 = defunc_1_op_res_233785;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233756)] =\n                                    x_233780;\n                                ((__local\n                                  double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233756)] =\n                                    x_233781;\n                            }\n                        }\n                        skip_waves_233796 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233756 == 0) {\n                            ((__global double *) mem_230128)[gtid_214317 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214318 *\n                                                             s_n_m_203726 +\n                                                             gtid_214319] =\n                                x_233780;\n                            ((__global double *) mem_230133)[gtid_214317 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_214318 *\n                                                             s_n_m_203726 +\n                                                             gtid_214319] =\n                                x_233781;\n                        }\n                    }\n            ",
            "    }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214312\n}\n__kernel void mainzisegred_large_216874(__global int *global_failure,\n                                        uint sync_arr_mem_234075_backing_offset_0,\n                                        uint red_arr_mem_234073_backing_offset_1,\n                                        uint red_arr_mem_234071_backing_offset_2,\n                                        uint red_arr_mem_234069_backing_offset_3,\n                                        uint red_arr_mem_234067_backing_offset_4,\n                                        uint red_arr_mem_234065_backing_offset_5,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216863,\n                                        int64_t groups_per_segment_234043,\n                                        int64_t elements_per_thread_234044,\n                                        int64_t virt_num_groups_234045,\n                                        int64_t threads_per_segment_234047,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230420,\n                                        __global unsigned char *mem_230430,\n                                        __global unsigned char *mem_230435",
            ",\n                                        __global unsigned char *mem_230440,\n                                        __global unsigned char *mem_230445,\n                                        __global unsigned char *mem_230450,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234048,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234050,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234052,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234054,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234056,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234058)\n{\n    #define segred_group_sizze_216862 (mainzisegred_group_sizze_215602)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234075_backing_5 =\n                           &shared_mem[sync_arr_mem_234075_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234073_backing_4 =\n                           &shared_mem[red_arr_mem_234073_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234071_backing_3 =\n                           &shared_mem[red_arr_mem_234071_backing_offset_2];\n    volatile unsigned char *red_arr_mem_234069_backing_2 =\n                           &shared_mem[red_arr_mem_234069_backing_offset_3];\n    volatile unsigned char *red_arr_mem_234067_backing_1 =\n                           &shared_mem[red_arr_mem_234067_backing_offset_4];\n    volatile unsigned char *red_arr_mem_234065_backing_0 =\n                           &shared_mem[red_arr_mem_234065_backing_offset_5];\n    \n    if (*glob",
            "al_failure >= 0)\n        return;\n    \n    int32_t global_tid_234060;\n    int32_t local_tid_234061;\n    int64_t group_sizze_234064;\n    int32_t wave_sizze_234063;\n    int32_t group_tid_234062;\n    \n    global_tid_234060 = get_global_id(0);\n    local_tid_234061 = get_local_id(0);\n    group_sizze_234064 = get_local_size(0);\n    wave_sizze_234063 = LOCKSTEP_WIDTH;\n    group_tid_234062 = get_group_id(0);\n    \n    int32_t phys_tid_216874 = global_tid_234060;\n    __local unsigned char *red_arr_mem_234065;\n    \n    red_arr_mem_234065 = (__local unsigned char *) red_arr_mem_234065_backing_0;\n    \n    __local unsigned char *red_arr_mem_234067;\n    \n    red_arr_mem_234067 = (__local unsigned char *) red_arr_mem_234067_backing_1;\n    \n    __local unsigned char *red_arr_mem_234069;\n    \n    red_arr_mem_234069 = (__local unsigned char *) red_arr_mem_234069_backing_2;\n    \n    __local unsigned char *red_arr_mem_234071;\n    \n    red_arr_mem_234071 = (__local unsigned char *) red_arr_mem_234071_backing_3;\n    \n    __local unsigned char *red_arr_mem_234073;\n    \n    red_arr_mem_234073 = (__local unsigned char *) red_arr_mem_234073_backing_4;\n    \n    __local unsigned char *sync_arr_mem_234075;\n    \n    sync_arr_mem_234075 = (__local\n                           unsigned char *) sync_arr_mem_234075_backing_5;\n    \n    int32_t phys_group_id_234077;\n    \n    phys_group_id_234077 = get_group_id(0);\n    for (int32_t i_234078 = 0; i_234078 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234045) - phys_group_id_234077,\n                   sext_i64_i32(num_groups_216863)); i_234078++) {\n        int32_t virt_group_id_234079 = phys_group_id_234077 + i_234078 *\n                sext_i64_i32(num_groups_216863);\n        int32_t flat_segment_id_234080 = squot32(virt_group_id_234079,\n                                                 sext_i64_i32(groups_per_segment_234043));\n        int64_t global_tid_234081 = srem64(sext_i32_i64(virt_group_id_234079) *\n                                           segred",
            "_group_sizze_216862 +\n                                           sext_i32_i64(local_tid_234061),\n                                           segred_group_sizze_216862 *\n                                           groups_per_segment_234043);\n        int64_t slice_234082 = s_n_m_203726;\n        int64_t slice_234083 = n_p_203574 * slice_234082;\n        int64_t slice_234084 = partition_sizze_203667 * slice_234083;\n        int64_t gtid_216870 = squot64(sext_i32_i64(flat_segment_id_234080),\n                                      slice_234083);\n        int64_t remnant_234085 = sext_i32_i64(flat_segment_id_234080) -\n                gtid_216870 * slice_234083;\n        int64_t gtid_216871 = squot64(remnant_234085, slice_234082);\n        int64_t remnant_234086 = remnant_234085 - gtid_216871 * slice_234082;\n        int64_t gtid_216872 = remnant_234086;\n        int64_t remnant_234087 = remnant_234086 - gtid_216872;\n        int64_t gtid_216873;\n        double x_acc_234088;\n        double x_acc_234089;\n        double x_acc_234090;\n        double x_acc_234091;\n        double x_acc_234092;\n        int64_t chunk_sizze_234093 = smin64(elements_per_thread_234044,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_234081,\n                                                      threads_per_segment_234047));\n        double x_216875;\n        double x_216876;\n        double x_216877;\n        double x_216878;\n        double x_216879;\n        double x_216880;\n        double x_216881;\n        double x_216882;\n        double x_216883;\n        double x_216884;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234088 = 0.0;\n            x_acc_234089 = 0.0;\n            x_acc_234090 = 0.0;\n            x_acc_234091 = 0.0;\n            x_acc_234092 = 0.0;\n        }\n        for (int64_t i_234109 = 0; i_234109 < chunk_sizze_234093; i_234109++) {\n            gtid_216873 = global_tid_234081 + threa",
            "ds_per_segment_234047 *\n                i_234109;\n            // apply map function\n            {\n                int64_t x_216898;\n                \n                x_216898 = ((__global int64_t *) ext_mem_229372)[gtid_216870 *\n                                                                 n_p_203574 +\n                                                                 gtid_216871];\n                \n                int64_t x_216902;\n                \n                x_216902 = ((__global int64_t *) ext_mem_229471)[gtid_216870 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_216871 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216872];\n                \n                double x_216903;\n                \n                x_216903 = ((__global double *) ext_mem_229470)[gtid_216870 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_216871 *\n                                                                s_n_m_203726 +\n                                                                gtid_216872];\n                \n                int64_t defunc_0_m_fun_res_216904;\n                \n                defunc_0_m_fun_res_216904 = ((__global\n                                              int64_t *) mem_230420)[gtid_216870 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216871 *\n                                                       ",
            "              s_n_m_203726 +\n                                                                     gtid_216872];\n                \n                bool cond_216906 = sle64(x_216898, gtid_216873);\n                int64_t defunc_0_f_res_216907;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216907 = (int64_t) 0;\n                } else {\n                    int64_t i_216908 = add64(gtid_216873, x_216902);\n                    int64_t defunc_0_add_arg_216909;\n                    \n                    defunc_0_add_arg_216909 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216870 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216871 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_216908];\n                    \n                    int64_t defunc_1_add_res_216910 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216909);\n                    \n                    defunc_0_f_res_216907 = defunc_1_add_res_216910;\n                }\n                \n                double defunc_0_f_res_216911;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216911 = 0.0;\n                } else {\n                    int64_t i_216912 = add64(gtid_216873, x_216902);\n                    double defunc_0_add_arg_216913;\n                    \n                    defunc_0_add_arg_216913 = ((__global\n                                                double *) mem_229639)[gtid_216870 *\n                                                                      (defunc_0_f_res_203721 *\n                 ",
            "                                                      n_p_203574) +\n                                                                      gtid_216871 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_216912];\n                    defunc_0_f_res_216911 = defunc_0_add_arg_216913;\n                }\n                \n                int64_t binop_p_216914 = sub64(defunc_0_f_res_216907,\n                                               defunc_0_m_fun_res_216904);\n                double defunc_0_f_res_216915 = sitofp_i64_f64(binop_p_216914);\n                double abs_res_216916 = fabs(defunc_0_f_res_216915);\n                double tmp1_216917 = abs_res_216916 / x_216903;\n                double x_216918 = tmp1_216917 * tmp1_216917;\n                double y_216919 = tmp1_216917 * x_216918;\n                double tmp2_216920 = 1.0 - y_216919;\n                double x_216921 = tmp2_216920 * tmp2_216920;\n                double tmp3_216922 = tmp2_216920 * x_216921;\n                double w_j_216923 = defunc_0_f_res_216911 * tmp3_216922;\n                double xw_j_216924 = defunc_0_f_res_216915 * w_j_216923;\n                double x2w_j_216925 = defunc_0_f_res_216915 * xw_j_216924;\n                double x3w_j_216926 = defunc_0_f_res_216915 * x2w_j_216925;\n                double x4w_j_216927 = defunc_0_f_res_216915 * x3w_j_216926;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216875 = x_acc_234088;\n                    x_216876 = x_acc_234089;\n                    x_216877 = x_acc_234090;\n                    x_216878 = x_acc_234091;\n                    x_216879 = x_acc_234092;\n                }\n                // load new values\n                {\n                    x_216880 = w_j_216923;\n                    x_216881 = xw_j_216924;\n                    x_216882 = ",
            "x2w_j_216925;\n                    x_216883 = x3w_j_216926;\n                    x_216884 = x4w_j_216927;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_216885 = x_216875 + x_216880;\n                    double defunc_1_op_res_216886 = x_216876 + x_216881;\n                    double defunc_1_op_res_216887 = x_216877 + x_216882;\n                    double defunc_1_op_res_216888 = x_216878 + x_216883;\n                    double defunc_1_op_res_216889 = x_216879 + x_216884;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234088 = defunc_1_op_res_216885;\n                        x_acc_234089 = defunc_1_op_res_216886;\n                        x_acc_234090 = defunc_1_op_res_216887;\n                        x_acc_234091 = defunc_1_op_res_216888;\n                        x_acc_234092 = defunc_1_op_res_216889;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216875 = x_acc_234088;\n            x_216876 = x_acc_234089;\n            x_216877 = x_acc_234090;\n            x_216878 = x_acc_234091;\n            x_216879 = x_acc_234092;\n            ((__local\n              double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061)] =\n                x_216875;\n            ((__local\n              double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061)] =\n                x_216876;\n            ((__local\n              double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061)] =\n                x_216877;\n            ((__local\n              double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061)] =\n                x_216878;\n            ((__local\n              double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061)] =\n                x_216879;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234110;\n   ",
            "     int32_t skip_waves_234111 = 1;\n        double x_234094;\n        double x_234095;\n        double x_234096;\n        double x_234097;\n        double x_234098;\n        double x_234099;\n        double x_234100;\n        double x_234101;\n        double x_234102;\n        double x_234103;\n        \n        offset_234110 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234061,\n                      sext_i64_i32(segred_group_sizze_216862))) {\n                x_234094 = ((__local\n                             double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061 +\n                                                           offset_234110)];\n                x_234095 = ((__local\n                             double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061 +\n                                                           offset_234110)];\n                x_234096 = ((__local\n                             double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061 +\n                                                           offset_234110)];\n                x_234097 = ((__local\n                             double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061 +\n                                                           offset_234110)];\n                x_234098 = ((__local\n                             double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061 +\n                                                           offset_234110)];\n            }\n        }\n        offset_234110 = 1;\n        while (slt32(offset_234110, wave_sizze_234063)) {\n            if (slt32(local_tid_234061 + offset_234110,\n                      sext_i64_i32(segred_group_sizze_216862)) &&\n                ((local_tid_234061 - squot32(local_tid_234061,\n                                             wave_sizze_234063) *\n                  wave_sizze_234063) & (2 * offset_234110 - 1)) == 0) {\n                // read array element\n              ",
            "  {\n                    x_234099 = ((volatile __local\n                                 double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234100 = ((volatile __local\n                                 double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234101 = ((volatile __local\n                                 double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234102 = ((volatile __local\n                                 double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234103 = ((volatile __local\n                                 double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234104 = x_234094 + x_234099;\n                    double defunc_1_op_res_234105 = x_234095 + x_234100;\n                    double defunc_1_op_res_234106 = x_234096 + x_234101;\n                    double defunc_1_op_res_234107 = x_234097 + x_234102;\n                    double defunc_1_op_res_234108 = x_234098 + x_234103;\n                    \n                    x_234094 = defunc_1_op_res_234104;\n                    x_234095 = defunc_1_op_res_234105;\n                    x_234096 = defunc_1_op_res_234106;\n                    x_234097 = defunc_1_op_res_234107;\n                    x_234098 = defunc_1_op_res_234108;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n         ",
            "             double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061)] =\n                        x_234094;\n                    ((volatile __local\n                      double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061)] =\n                        x_234095;\n                    ((volatile __local\n                      double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061)] =\n                        x_234096;\n                    ((volatile __local\n                      double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061)] =\n                        x_234097;\n                    ((volatile __local\n                      double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061)] =\n                        x_234098;\n                }\n            }\n            offset_234110 *= 2;\n        }\n        while (slt32(skip_waves_234111,\n                     squot32(sext_i64_i32(segred_group_sizze_216862) +\n                             wave_sizze_234063 - 1, wave_sizze_234063))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234110 = skip_waves_234111 * wave_sizze_234063;\n            if (slt32(local_tid_234061 + offset_234110,\n                      sext_i64_i32(segred_group_sizze_216862)) &&\n                ((local_tid_234061 - squot32(local_tid_234061,\n                                             wave_sizze_234063) *\n                  wave_sizze_234063) == 0 && (squot32(local_tid_234061,\n                                                      wave_sizze_234063) & (2 *\n                                                                            skip_waves_234111 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234099 = ((__local\n                                 double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n       ",
            "             x_234100 = ((__local\n                                 double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234101 = ((__local\n                                 double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234102 = ((__local\n                                 double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                    x_234103 = ((__local\n                                 double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061 +\n                                                               offset_234110)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234104 = x_234094 + x_234099;\n                    double defunc_1_op_res_234105 = x_234095 + x_234100;\n                    double defunc_1_op_res_234106 = x_234096 + x_234101;\n                    double defunc_1_op_res_234107 = x_234097 + x_234102;\n                    double defunc_1_op_res_234108 = x_234098 + x_234103;\n                    \n                    x_234094 = defunc_1_op_res_234104;\n                    x_234095 = defunc_1_op_res_234105;\n                    x_234096 = defunc_1_op_res_234106;\n                    x_234097 = defunc_1_op_res_234107;\n                    x_234098 = defunc_1_op_res_234108;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061)] =\n                        x_234094;\n                    ((__local\n                      double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061)] =\n                        x_234095;\n                    ",
            "((__local\n                      double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061)] =\n                        x_234096;\n                    ((__local\n                      double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061)] =\n                        x_234097;\n                    ((__local\n                      double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061)] =\n                        x_234098;\n                }\n            }\n            skip_waves_234111 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234061) == (int64_t) 0) {\n                x_acc_234088 = x_234094;\n                x_acc_234089 = x_234095;\n                x_acc_234090 = x_234096;\n                x_acc_234091 = x_234097;\n                x_acc_234092 = x_234098;\n            }\n        }\n        if (groups_per_segment_234043 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234061 == 0) {\n                    ((__global double *) mem_230430)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_234088;\n                    ((__global double *) mem_230435)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_234089;\n                    ((_",
            "_global double *) mem_230440)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_234090;\n                    ((__global double *) mem_230445)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_234091;\n                    ((__global double *) mem_230450)[gtid_216870 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216871 *\n                                                     s_n_m_203726 +\n                                                     gtid_216872] =\n                        x_acc_234092;\n                }\n            }\n        } else {\n            int32_t old_counter_234112;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234061 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234048)[sext_i32_i64(virt_group_id_234079)] =\n                        x_acc_234088;\n                    ((__global\n                      double *) segred_tmp_mem_234050)[sext_i32_i64(virt_group_id_234079)] =\n                        x_acc_234089;\n                    ((__global\n                      double *) segred_tmp_mem_234052)[sext_i32_i64(virt_group_id_234079)] =\n      ",
            "                  x_acc_234090;\n                    ((__global\n                      double *) segred_tmp_mem_234054)[sext_i32_i64(virt_group_id_234079)] =\n                        x_acc_234091;\n                    ((__global\n                      double *) segred_tmp_mem_234056)[sext_i32_i64(virt_group_id_234079)] =\n                        x_acc_234092;\n                    mem_fence_global();\n                    old_counter_234112 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234058)[sext_i32_i64(srem32(flat_segment_id_234080,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234075)[(int64_t) 0] =\n                        old_counter_234112 == groups_per_segment_234043 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234113;\n            \n            is_last_group_234113 = ((__local\n                                     bool *) sync_arr_mem_234075)[(int64_t) 0];\n            if (is_last_group_234113) {\n                if (local_tid_234061 == 0) {\n                    old_counter_234112 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234058)[sext_i32_i64(srem32(flat_segment_id_234080,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234043));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234114 =\n            ",
            "                sdiv_up64(groups_per_segment_234043,\n                                      segred_group_sizze_216862);\n                    \n                    x_216875 = 0.0;\n                    x_216876 = 0.0;\n                    x_216877 = 0.0;\n                    x_216878 = 0.0;\n                    x_216879 = 0.0;\n                    for (int64_t i_234115 = 0; i_234115 <\n                         read_per_thread_234114; i_234115++) {\n                        int64_t group_res_id_234116 =\n                                sext_i32_i64(local_tid_234061) *\n                                read_per_thread_234114 + i_234115;\n                        int64_t index_of_group_res_234117 =\n                                sext_i32_i64(flat_segment_id_234080) *\n                                groups_per_segment_234043 + group_res_id_234116;\n                        \n                        if (slt64(group_res_id_234116,\n                                  groups_per_segment_234043)) {\n                            x_216880 = ((__global\n                                         double *) segred_tmp_mem_234048)[index_of_group_res_234117];\n                            x_216881 = ((__global\n                                         double *) segred_tmp_mem_234050)[index_of_group_res_234117];\n                            x_216882 = ((__global\n                                         double *) segred_tmp_mem_234052)[index_of_group_res_234117];\n                            x_216883 = ((__global\n                                         double *) segred_tmp_mem_234054)[index_of_group_res_234117];\n                            x_216884 = ((__global\n                                         double *) segred_tmp_mem_234056)[index_of_group_res_234117];\n                            \n                            double defunc_1_op_res_216885 = x_216875 + x_216880;\n                            double defunc_1_op_res_216886 = x_216876 + x_216881;\n                            double defunc_1_op_res_216887 = x_2168",
            "77 + x_216882;\n                            double defunc_1_op_res_216888 = x_216878 + x_216883;\n                            double defunc_1_op_res_216889 = x_216879 + x_216884;\n                            \n                            x_216875 = defunc_1_op_res_216885;\n                            x_216876 = defunc_1_op_res_216886;\n                            x_216877 = defunc_1_op_res_216887;\n                            x_216878 = defunc_1_op_res_216888;\n                            x_216879 = defunc_1_op_res_216889;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061)] =\n                    x_216875;\n                ((__local\n                  double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061)] =\n                    x_216876;\n                ((__local\n                  double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061)] =\n                    x_216877;\n                ((__local\n                  double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061)] =\n                    x_216878;\n                ((__local\n                  double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061)] =\n                    x_216879;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234118;\n                    int32_t skip_waves_234119 = 1;\n                    double x_234094;\n                    double x_234095;\n                    double x_234096;\n                    double x_234097;\n                    double x_234098;\n                    double x_234099;\n                    double x_234100;\n                    double x_234101;\n                    double x_234102;\n                    double x_234103;\n                    \n                    offset_234118 = 0;\n                    // participating threads read initial accumulator\n                 ",
            "   {\n                        if (slt32(local_tid_234061,\n                                  sext_i64_i32(segred_group_sizze_216862))) {\n                            x_234094 = ((__local\n                                         double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061 +\n                                                                       offset_234118)];\n                            x_234095 = ((__local\n                                         double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061 +\n                                                                       offset_234118)];\n                            x_234096 = ((__local\n                                         double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061 +\n                                                                       offset_234118)];\n                            x_234097 = ((__local\n                                         double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061 +\n                                                                       offset_234118)];\n                            x_234098 = ((__local\n                                         double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061 +\n                                                                       offset_234118)];\n                        }\n                    }\n                    offset_234118 = 1;\n                    while (slt32(offset_234118, wave_sizze_234063)) {\n                        if (slt32(local_tid_234061 + offset_234118,\n                                  sext_i64_i32(segred_group_sizze_216862)) &&\n                            ((local_tid_234061 - squot32(local_tid_234061,\n                                                         wave_sizze_234063) *\n                              wave_sizze_234063) & (2 * offset_234118 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                 ",
            "               x_234099 = ((volatile __local\n                                             double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234100 = ((volatile __local\n                                             double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234101 = ((volatile __local\n                                             double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234102 = ((volatile __local\n                                             double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234103 = ((volatile __local\n                                             double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234104 = x_234094 +\n                                       x_234099;\n                                double defunc_1_op_res_234105 = x_234095 +\n                                       x_234100;\n                                double defunc_1_op_res_234106 = x_234096 +\n                                       x_234101;\n                                double defunc_1_op_res_234107 = x_234097 +\n                                       x_234102;\n                                double defunc_1_op_res_234108 = x_234098 +\n                        ",
            "               x_234103;\n                                \n                                x_234094 = defunc_1_op_res_234104;\n                                x_234095 = defunc_1_op_res_234105;\n                                x_234096 = defunc_1_op_res_234106;\n                                x_234097 = defunc_1_op_res_234107;\n                                x_234098 = defunc_1_op_res_234108;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061)] =\n                                    x_234094;\n                                ((volatile __local\n                                  double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061)] =\n                                    x_234095;\n                                ((volatile __local\n                                  double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061)] =\n                                    x_234096;\n                                ((volatile __local\n                                  double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061)] =\n                                    x_234097;\n                                ((volatile __local\n                                  double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061)] =\n                                    x_234098;\n                            }\n                        }\n                        offset_234118 *= 2;\n                    }\n                    while (slt32(skip_waves_234119,\n                                 squot32(sext_i64_i32(segred_group_sizze_216862) +\n                                         wave_sizze_234063 - 1,\n                                         wave_sizze_234063))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234118 = skip_waves_234119 * wave_sizze_23406",
            "3;\n                        if (slt32(local_tid_234061 + offset_234118,\n                                  sext_i64_i32(segred_group_sizze_216862)) &&\n                            ((local_tid_234061 - squot32(local_tid_234061,\n                                                         wave_sizze_234063) *\n                              wave_sizze_234063) == 0 &&\n                             (squot32(local_tid_234061, wave_sizze_234063) &\n                              (2 * skip_waves_234119 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234099 = ((__local\n                                             double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234100 = ((__local\n                                             double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234101 = ((__local\n                                             double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234102 = ((__local\n                                             double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                                x_234103 = ((__local\n                                             double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061 +\n                                                                           offset_234118)];\n                            }\n                            // apply reduction operation\n                            {\n                                double ",
            "defunc_1_op_res_234104 = x_234094 +\n                                       x_234099;\n                                double defunc_1_op_res_234105 = x_234095 +\n                                       x_234100;\n                                double defunc_1_op_res_234106 = x_234096 +\n                                       x_234101;\n                                double defunc_1_op_res_234107 = x_234097 +\n                                       x_234102;\n                                double defunc_1_op_res_234108 = x_234098 +\n                                       x_234103;\n                                \n                                x_234094 = defunc_1_op_res_234104;\n                                x_234095 = defunc_1_op_res_234105;\n                                x_234096 = defunc_1_op_res_234106;\n                                x_234097 = defunc_1_op_res_234107;\n                                x_234098 = defunc_1_op_res_234108;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234065)[sext_i32_i64(local_tid_234061)] =\n                                    x_234094;\n                                ((__local\n                                  double *) red_arr_mem_234067)[sext_i32_i64(local_tid_234061)] =\n                                    x_234095;\n                                ((__local\n                                  double *) red_arr_mem_234069)[sext_i32_i64(local_tid_234061)] =\n                                    x_234096;\n                                ((__local\n                                  double *) red_arr_mem_234071)[sext_i32_i64(local_tid_234061)] =\n                                    x_234097;\n                                ((__local\n                                  double *) red_arr_mem_234073)[sext_i32_i64(local_tid_234061)] =\n                                    x_234098;\n    ",
            "                        }\n                        }\n                        skip_waves_234119 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234061 == 0) {\n                            ((__global double *) mem_230430)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_234094;\n                            ((__global double *) mem_230435)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_234095;\n                            ((__global double *) mem_230440)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_234096;\n                            ((__global double *) mem_230445)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                    ",
            "                                         gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_234097;\n                            ((__global double *) mem_230450)[gtid_216870 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216871 *\n                                                             s_n_m_203726 +\n                                                             gtid_216872] =\n                                x_234098;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216862\n}\n__kernel void mainzisegred_large_216997(__global int *global_failure,\n                                        uint sync_arr_mem_234189_backing_offset_0,\n                                        uint red_arr_mem_234187_backing_offset_1,\n                                        uint red_arr_mem_234185_backing_offset_2,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216989,\n                                        int64_t groups_per_segment_234169,\n                                        int64_t elements_per_thread_234170,\n                                        int64_t virt_num_groups_234171,\n                                        int64_t threads_per_segment_234173,\n                                        __global unsigned char",
            " *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230456,\n                                        __global unsigned char *mem_230461,\n                                        __global unsigned char *mem_230466,\n                                        __global unsigned char *mem_230471,\n                                        __global unsigned char *mem_230476,\n                                        __global unsigned char *mem_230481,\n                                        __global unsigned char *mem_230487,\n                                        __global unsigned char *mem_230492,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234174,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234176,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234178)\n{\n    #define segred_group_sizze_216988 (mainzisegred_group_sizze_215433)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234189_backing_2 =\n                           &shared_mem[sync_arr_mem_234189_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234187_backing_1 =\n                           &shared_mem[red_arr_mem_234187_backing_offset_1];\n    volatile unsigned char *red_arr_mem_234185_backing_0 =\n                           &shared_mem[red_arr_mem_234185_backing_offset_2];\n    \n    if (*globa",
            "l_failure >= 0)\n        return;\n    \n    int32_t global_tid_234180;\n    int32_t local_tid_234181;\n    int64_t group_sizze_234184;\n    int32_t wave_sizze_234183;\n    int32_t group_tid_234182;\n    \n    global_tid_234180 = get_global_id(0);\n    local_tid_234181 = get_local_id(0);\n    group_sizze_234184 = get_local_size(0);\n    wave_sizze_234183 = LOCKSTEP_WIDTH;\n    group_tid_234182 = get_group_id(0);\n    \n    int32_t phys_tid_216997 = global_tid_234180;\n    __local unsigned char *red_arr_mem_234185;\n    \n    red_arr_mem_234185 = (__local unsigned char *) red_arr_mem_234185_backing_0;\n    \n    __local unsigned char *red_arr_mem_234187;\n    \n    red_arr_mem_234187 = (__local unsigned char *) red_arr_mem_234187_backing_1;\n    \n    __local unsigned char *sync_arr_mem_234189;\n    \n    sync_arr_mem_234189 = (__local\n                           unsigned char *) sync_arr_mem_234189_backing_2;\n    \n    int32_t phys_group_id_234191;\n    \n    phys_group_id_234191 = get_group_id(0);\n    for (int32_t i_234192 = 0; i_234192 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234171) - phys_group_id_234191,\n                   sext_i64_i32(num_groups_216989)); i_234192++) {\n        int32_t virt_group_id_234193 = phys_group_id_234191 + i_234192 *\n                sext_i64_i32(num_groups_216989);\n        int32_t flat_segment_id_234194 = squot32(virt_group_id_234193,\n                                                 sext_i64_i32(groups_per_segment_234169));\n        int64_t global_tid_234195 = srem64(sext_i32_i64(virt_group_id_234193) *\n                                           segred_group_sizze_216988 +\n                                           sext_i32_i64(local_tid_234181),\n                                           segred_group_sizze_216988 *\n                                           groups_per_segment_234169);\n        int64_t slice_234196 = s_n_m_203726;\n        int64_t slice_234197 = n_p_203574 * slice_234196;\n        int64_t slice_234198 = partition_sizze_203667 * slice_234197;\n   ",
            "     int64_t gtid_216993 = squot64(sext_i32_i64(flat_segment_id_234194),\n                                      slice_234197);\n        int64_t remnant_234199 = sext_i32_i64(flat_segment_id_234194) -\n                gtid_216993 * slice_234197;\n        int64_t gtid_216994 = squot64(remnant_234199, slice_234196);\n        int64_t remnant_234200 = remnant_234199 - gtid_216994 * slice_234196;\n        int64_t gtid_216995 = remnant_234200;\n        int64_t remnant_234201 = remnant_234200 - gtid_216995;\n        int64_t gtid_216996;\n        double x_acc_234202;\n        double x_acc_234203;\n        int64_t chunk_sizze_234204 = smin64(elements_per_thread_234170,\n                                            sdiv_up64(q_s_203575 -\n                                                      global_tid_234195,\n                                                      threads_per_segment_234173));\n        double x_216998;\n        double x_216999;\n        double x_217000;\n        double x_217001;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234202 = 0.0;\n            x_acc_234203 = 0.0;\n        }\n        for (int64_t i_234211 = 0; i_234211 < chunk_sizze_234204; i_234211++) {\n            gtid_216996 = global_tid_234195 + threads_per_segment_234173 *\n                i_234211;\n            // apply map function\n            {\n                int64_t x_217019;\n                \n                x_217019 = ((__global int64_t *) ext_mem_229372)[gtid_216993 *\n                                                                 n_p_203574 +\n                                                                 gtid_216994];\n                \n                int64_t x_217028;\n                \n                x_217028 = ((__global int64_t *) ext_mem_229471)[gtid_216993 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                       ",
            "          gtid_216994 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216995];\n                \n                double x_217029;\n                \n                x_217029 = ((__global double *) ext_mem_229470)[gtid_216993 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_216994 *\n                                                                s_n_m_203726 +\n                                                                gtid_216995];\n                \n                double a12_217030;\n                \n                a12_217030 = ((__global double *) mem_230456)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b12_217031;\n                \n                b12_217031 = ((__global double *) mem_230461)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double c12_217032;\n                \n                c12_217032 = ((__global double *) mem_230466)[gtid_216993 *\n                                                              (s_n_m_203726",
            " *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b2_217033;\n                \n                b2_217033 = ((__global double *) mem_230471)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                double c2_217034;\n                \n                c2_217034 = ((__global double *) mem_230476)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                int64_t defunc_0_m_fun_res_217035;\n                \n                defunc_0_m_fun_res_217035 = ((__global\n                                              int64_t *) mem_230481)[gtid_216993 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216994 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216995];\n     ",
            "           \n                bool cond_217037 = sle64(x_217019, gtid_216996);\n                int64_t defunc_0_f_res_217038;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217038 = (int64_t) 0;\n                } else {\n                    int64_t i_217039 = add64(gtid_216996, x_217028);\n                    int64_t defunc_0_add_arg_217040;\n                    \n                    defunc_0_add_arg_217040 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216993 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216994 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_217039];\n                    \n                    int64_t defunc_1_add_res_217041 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_217040);\n                    \n                    defunc_0_f_res_217038 = defunc_1_add_res_217041;\n                }\n                \n                double defunc_0_f_res_217042;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217042 = 0.0;\n                } else {\n                    int64_t i_217043 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217044;\n                    \n                    defunc_0_add_arg_217044 = ((__global\n                                                double *) mem_229639)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                 ",
            "                     gtid_216994 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_217043];\n                    defunc_0_f_res_217042 = defunc_0_add_arg_217044;\n                }\n                \n                int64_t binop_p_217045 = sub64(defunc_0_f_res_217038,\n                                               defunc_0_m_fun_res_217035);\n                double defunc_0_f_res_217046 = sitofp_i64_f64(binop_p_217045);\n                double abs_res_217047 = fabs(defunc_0_f_res_217046);\n                double tmp1_217048 = abs_res_217047 / x_217029;\n                double x_217049 = tmp1_217048 * tmp1_217048;\n                double y_217050 = tmp1_217048 * x_217049;\n                double tmp2_217051 = 1.0 - y_217050;\n                double x_217052 = tmp2_217051 * tmp2_217051;\n                double tmp3_217053 = tmp2_217051 * x_217052;\n                double tmp4_217054 = defunc_0_f_res_217042 * tmp3_217053;\n                double defunc_1_f_res_217055 = defunc_0_f_res_217046 *\n                       tmp4_217054;\n                double defunc_1_f_res_217056 = defunc_0_f_res_217046 *\n                       defunc_1_f_res_217055;\n                double defunc_0_f_res_217057;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217057 = 0.0;\n                } else {\n                    int64_t i_217058 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217059;\n                    \n                    defunc_0_add_arg_217059 = ((__global\n                                                double *) mem_229634)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216994 *\n                  ",
            "                                                    defunc_0_f_res_203721 +\n                                                                      i_217058];\n                    defunc_0_f_res_217057 = defunc_0_add_arg_217059;\n                }\n                \n                double x_217060 = a12_217030 * tmp4_217054;\n                double y_217061 = b12_217031 * defunc_1_f_res_217055;\n                double x_217062 = x_217060 + y_217061;\n                double y_217063 = c12_217032 * defunc_1_f_res_217056;\n                double x_217064 = x_217062 + y_217063;\n                double defunc_9_fit_fun_res_217065 = defunc_0_f_res_217057 *\n                       x_217064;\n                double x_217066 = b12_217031 * tmp4_217054;\n                double y_217067 = b2_217033 * defunc_1_f_res_217055;\n                double x_217068 = x_217066 + y_217067;\n                double y_217069 = c2_217034 * defunc_1_f_res_217056;\n                double x_217070 = x_217068 + y_217069;\n                double defunc_9_slope_fun_res_217071 = defunc_0_f_res_217057 *\n                       x_217070;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216998 = x_acc_234202;\n                    x_216999 = x_acc_234203;\n                }\n                // load new values\n                {\n                    x_217000 = defunc_9_fit_fun_res_217065;\n                    x_217001 = defunc_9_slope_fun_res_217071;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_217002 = x_216998 + x_217000;\n                    double defunc_1_op_res_217003 = x_216999 + x_217001;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234202 = defunc_1_op_res_217002;\n                        x_acc_234203 = defunc_1_op_res_217003;\n                    }\n                }\n      ",
            "      }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216998 = x_acc_234202;\n            x_216999 = x_acc_234203;\n            ((__local\n              double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181)] =\n                x_216998;\n            ((__local\n              double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181)] =\n                x_216999;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234212;\n        int32_t skip_waves_234213 = 1;\n        double x_234205;\n        double x_234206;\n        double x_234207;\n        double x_234208;\n        \n        offset_234212 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234181,\n                      sext_i64_i32(segred_group_sizze_216988))) {\n                x_234205 = ((__local\n                             double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181 +\n                                                           offset_234212)];\n                x_234206 = ((__local\n                             double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181 +\n                                                           offset_234212)];\n            }\n        }\n        offset_234212 = 1;\n        while (slt32(offset_234212, wave_sizze_234183)) {\n            if (slt32(local_tid_234181 + offset_234212,\n                      sext_i64_i32(segred_group_sizze_216988)) &&\n                ((local_tid_234181 - squot32(local_tid_234181,\n                                             wave_sizze_234183) *\n                  wave_sizze_234183) & (2 * offset_234212 - 1)) == 0) {\n                // read array element\n                {\n                    x_234207 = ((volatile __local\n                                 double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181 +\n                                                               offset_234212)];\n                   ",
            " x_234208 = ((volatile __local\n                                 double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181 +\n                                                               offset_234212)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234209 = x_234205 + x_234207;\n                    double defunc_1_op_res_234210 = x_234206 + x_234208;\n                    \n                    x_234205 = defunc_1_op_res_234209;\n                    x_234206 = defunc_1_op_res_234210;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181)] =\n                        x_234205;\n                    ((volatile __local\n                      double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181)] =\n                        x_234206;\n                }\n            }\n            offset_234212 *= 2;\n        }\n        while (slt32(skip_waves_234213,\n                     squot32(sext_i64_i32(segred_group_sizze_216988) +\n                             wave_sizze_234183 - 1, wave_sizze_234183))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234212 = skip_waves_234213 * wave_sizze_234183;\n            if (slt32(local_tid_234181 + offset_234212,\n                      sext_i64_i32(segred_group_sizze_216988)) &&\n                ((local_tid_234181 - squot32(local_tid_234181,\n                                             wave_sizze_234183) *\n                  wave_sizze_234183) == 0 && (squot32(local_tid_234181,\n                                                      wave_sizze_234183) & (2 *\n                                                                            skip_waves_234213 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n       ",
            "             x_234207 = ((__local\n                                 double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181 +\n                                                               offset_234212)];\n                    x_234208 = ((__local\n                                 double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181 +\n                                                               offset_234212)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234209 = x_234205 + x_234207;\n                    double defunc_1_op_res_234210 = x_234206 + x_234208;\n                    \n                    x_234205 = defunc_1_op_res_234209;\n                    x_234206 = defunc_1_op_res_234210;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181)] =\n                        x_234205;\n                    ((__local\n                      double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181)] =\n                        x_234206;\n                }\n            }\n            skip_waves_234213 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234181) == (int64_t) 0) {\n                x_acc_234202 = x_234205;\n                x_acc_234203 = x_234206;\n            }\n        }\n        if (groups_per_segment_234169 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234181 == 0) {\n                    ((__global double *) mem_230487)[gtid_216993 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216994 *\n                               ",
            "                      s_n_m_203726 +\n                                                     gtid_216995] =\n                        x_acc_234202;\n                    ((__global double *) mem_230492)[gtid_216993 *\n                                                     (s_n_m_203726 *\n                                                      n_p_203574) +\n                                                     gtid_216994 *\n                                                     s_n_m_203726 +\n                                                     gtid_216995] =\n                        x_acc_234203;\n                }\n            }\n        } else {\n            int32_t old_counter_234214;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234181 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234174)[sext_i32_i64(virt_group_id_234193)] =\n                        x_acc_234202;\n                    ((__global\n                      double *) segred_tmp_mem_234176)[sext_i32_i64(virt_group_id_234193)] =\n                        x_acc_234203;\n                    mem_fence_global();\n                    old_counter_234214 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234178)[sext_i32_i64(srem32(flat_segment_id_234194,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234189)[(int64_t) 0] =\n                        old_counter_234214 == groups_per_segment_234169 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234215;\n            \n            is_last_group_234215 = ((__local\n                    ",
            "                 bool *) sync_arr_mem_234189)[(int64_t) 0];\n            if (is_last_group_234215) {\n                if (local_tid_234181 == 0) {\n                    old_counter_234214 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234178)[sext_i32_i64(srem32(flat_segment_id_234194,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234169));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234216 =\n                            sdiv_up64(groups_per_segment_234169,\n                                      segred_group_sizze_216988);\n                    \n                    x_216998 = 0.0;\n                    x_216999 = 0.0;\n                    for (int64_t i_234217 = 0; i_234217 <\n                         read_per_thread_234216; i_234217++) {\n                        int64_t group_res_id_234218 =\n                                sext_i32_i64(local_tid_234181) *\n                                read_per_thread_234216 + i_234217;\n                        int64_t index_of_group_res_234219 =\n                                sext_i32_i64(flat_segment_id_234194) *\n                                groups_per_segment_234169 + group_res_id_234218;\n                        \n                        if (slt64(group_res_id_234218,\n                                  groups_per_segment_234169)) {\n                            x_217000 = ((__global\n                                         double *) segred_tmp_mem_234174)[index_of_group_res_234219];\n                            x_217001 = ((__global\n                                         double *) segred_tmp_mem_234176)[index_of_group_res_234219];\n                            \n  ",
            "                          double defunc_1_op_res_217002 = x_216998 + x_217000;\n                            double defunc_1_op_res_217003 = x_216999 + x_217001;\n                            \n                            x_216998 = defunc_1_op_res_217002;\n                            x_216999 = defunc_1_op_res_217003;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181)] =\n                    x_216998;\n                ((__local\n                  double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181)] =\n                    x_216999;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234220;\n                    int32_t skip_waves_234221 = 1;\n                    double x_234205;\n                    double x_234206;\n                    double x_234207;\n                    double x_234208;\n                    \n                    offset_234220 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234181,\n                                  sext_i64_i32(segred_group_sizze_216988))) {\n                            x_234205 = ((__local\n                                         double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181 +\n                                                                       offset_234220)];\n                            x_234206 = ((__local\n                                         double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181 +\n                                                                       offset_234220)];\n                        }\n                    }\n                    offset_234220 = 1;\n                    while (slt32(offset_234220, wave_sizze_234183)) {\n                        if (slt32(local_tid_234181 + offset_234220,\n  ",
            "                                sext_i64_i32(segred_group_sizze_216988)) &&\n                            ((local_tid_234181 - squot32(local_tid_234181,\n                                                         wave_sizze_234183) *\n                              wave_sizze_234183) & (2 * offset_234220 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234207 = ((volatile __local\n                                             double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181 +\n                                                                           offset_234220)];\n                                x_234208 = ((volatile __local\n                                             double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181 +\n                                                                           offset_234220)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234209 = x_234205 +\n                                       x_234207;\n                                double defunc_1_op_res_234210 = x_234206 +\n                                       x_234208;\n                                \n                                x_234205 = defunc_1_op_res_234209;\n                                x_234206 = defunc_1_op_res_234210;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181)] =\n                                    x_234205;\n                                ((volatile __local\n                                  double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181)] =\n                                    x_234206;\n                  ",
            "          }\n                        }\n                        offset_234220 *= 2;\n                    }\n                    while (slt32(skip_waves_234221,\n                                 squot32(sext_i64_i32(segred_group_sizze_216988) +\n                                         wave_sizze_234183 - 1,\n                                         wave_sizze_234183))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234220 = skip_waves_234221 * wave_sizze_234183;\n                        if (slt32(local_tid_234181 + offset_234220,\n                                  sext_i64_i32(segred_group_sizze_216988)) &&\n                            ((local_tid_234181 - squot32(local_tid_234181,\n                                                         wave_sizze_234183) *\n                              wave_sizze_234183) == 0 &&\n                             (squot32(local_tid_234181, wave_sizze_234183) &\n                              (2 * skip_waves_234221 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234207 = ((__local\n                                             double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181 +\n                                                                           offset_234220)];\n                                x_234208 = ((__local\n                                             double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181 +\n                                                                           offset_234220)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234209 = x_234205 +\n                                       x_234207;\n                                double defunc_1_op_res_234210 = x_234206 +\n                                       x_234208;\n                                \n                 ",
            "               x_234205 = defunc_1_op_res_234209;\n                                x_234206 = defunc_1_op_res_234210;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234185)[sext_i32_i64(local_tid_234181)] =\n                                    x_234205;\n                                ((__local\n                                  double *) red_arr_mem_234187)[sext_i32_i64(local_tid_234181)] =\n                                    x_234206;\n                            }\n                        }\n                        skip_waves_234221 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234181 == 0) {\n                            ((__global double *) mem_230487)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995] =\n                                x_234205;\n                            ((__global double *) mem_230492)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995] =\n                                x_234206;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LO",
            "CAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216988\n}\n__kernel void mainzisegred_large_218721(__global int *global_failure,\n                                        uint sync_arr_mem_234382_backing_offset_0,\n                                        uint red_arr_mem_234380_backing_offset_1,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t C_len_203724,\n                                        int64_t num_groups_218716,\n                                        int64_t groups_per_segment_234366,\n                                        int64_t elements_per_thread_234367,\n                                        int64_t virt_num_groups_234368,\n                                        int64_t threads_per_segment_234370,\n                                        __global unsigned char *mem_230608,\n                                        __global unsigned char *mem_230619,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234371,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234373)\n{\n    #define segred_group_sizze_218715 (mainzisegred_group_sizze_218698)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234382_backing_1 =\n                           &shared_mem[sync_arr_mem_234382_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234380_backing_0 =\n                           &shared_mem[red_arr_mem_234380_backing_offset_1];\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    loc",
            "al_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_218721 = global_tid_234375;\n    __local unsigned char *red_arr_mem_234380;\n    \n    red_arr_mem_234380 = (__local unsigned char *) red_arr_mem_234380_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234382;\n    \n    sync_arr_mem_234382 = (__local\n                           unsigned char *) sync_arr_mem_234382_backing_1;\n    \n    int32_t phys_group_id_234384;\n    \n    phys_group_id_234384 = get_group_id(0);\n    for (int32_t i_234385 = 0; i_234385 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234368) - phys_group_id_234384,\n                   sext_i64_i32(num_groups_218716)); i_234385++) {\n        int32_t virt_group_id_234386 = phys_group_id_234384 + i_234385 *\n                sext_i64_i32(num_groups_218716);\n        int32_t flat_segment_id_234387 = squot32(virt_group_id_234386,\n                                                 sext_i64_i32(groups_per_segment_234366));\n        int64_t global_tid_234388 = srem64(sext_i32_i64(virt_group_id_234386) *\n                                           segred_group_sizze_218715 +\n                                           sext_i32_i64(local_tid_234376),\n                                           segred_group_sizze_218715 *\n                                           groups_per_segment_234366);\n        int64_t slice_234389 = partition_sizze_203667;\n        int64_t gtid_218719 = sext_i32_i64(flat_segment_id_234387);\n        int64_t remnant_234390 = sext_i32_i64(flat_segment_id_234387) -\n                gtid_218719;\n        int64_t gtid_218720;\n        double x_acc_234391;\n        int64_t chunk_sizze_234392 = smin64(elements_per_thread_234367,\n                                            sdiv_up64(n_p_203574 -\n                                                      global_tid_234388,\n                                                      threads_per",
            "_segment_234370));\n        double x_218722;\n        double x_218723;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234391 = 0.0;\n        }\n        for (int64_t i_234396 = 0; i_234396 < chunk_sizze_234392; i_234396++) {\n            gtid_218720 = global_tid_234388 + threads_per_segment_234370 *\n                i_234396;\n            // apply map function\n            {\n                double x_218726;\n                \n                x_218726 = ((__global double *) mem_230608)[gtid_218719 *\n                                                            C_len_203724 +\n                                                            gtid_218720];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218722 = x_acc_234391;\n                }\n                // load new values\n                {\n                    x_218723 = x_218726;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218724 = x_218722 + x_218723;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234391 = defunc_1_op_res_218724;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218722 = x_acc_234391;\n            ((__local\n              double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376)] =\n                x_218722;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234397;\n        int32_t skip_waves_234398 = 1;\n        double x_234393;\n        double x_234394;\n        \n        offset_234397 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234376,\n                      sext_i64_i32(segred_group_sizze_218715))) {\n                x_234393 = ((__local\n                 ",
            "            double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376 +\n                                                           offset_234397)];\n            }\n        }\n        offset_234397 = 1;\n        while (slt32(offset_234397, wave_sizze_234378)) {\n            if (slt32(local_tid_234376 + offset_234397,\n                      sext_i64_i32(segred_group_sizze_218715)) &&\n                ((local_tid_234376 - squot32(local_tid_234376,\n                                             wave_sizze_234378) *\n                  wave_sizze_234378) & (2 * offset_234397 - 1)) == 0) {\n                // read array element\n                {\n                    x_234394 = ((volatile __local\n                                 double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376 +\n                                                               offset_234397)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234395 = x_234393 + x_234394;\n                    \n                    x_234393 = defunc_1_op_res_234395;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376)] =\n                        x_234393;\n                }\n            }\n            offset_234397 *= 2;\n        }\n        while (slt32(skip_waves_234398,\n                     squot32(sext_i64_i32(segred_group_sizze_218715) +\n                             wave_sizze_234378 - 1, wave_sizze_234378))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234397 = skip_waves_234398 * wave_sizze_234378;\n            if (slt32(local_tid_234376 + offset_234397,\n                      sext_i64_i32(segred_group_sizze_218715)) &&\n                ((local_tid_234376 - squot32(local_tid_234376,\n                                             wave_sizze_234378) *\n                  wave_sizze_234378) == 0 && (s",
            "quot32(local_tid_234376,\n                                                      wave_sizze_234378) & (2 *\n                                                                            skip_waves_234398 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234394 = ((__local\n                                 double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376 +\n                                                               offset_234397)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234395 = x_234393 + x_234394;\n                    \n                    x_234393 = defunc_1_op_res_234395;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376)] =\n                        x_234393;\n                }\n            }\n            skip_waves_234398 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234376) == (int64_t) 0) {\n                x_acc_234391 = x_234393;\n            }\n        }\n        if (groups_per_segment_234366 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234376 == 0) {\n                    ((__global double *) mem_230619)[gtid_218719] =\n                        x_acc_234391;\n                }\n            }\n        } else {\n            int32_t old_counter_234399;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234376 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234371)[sext_i32_i64(virt_group_id_234386)] =\n   ",
            "                     x_acc_234391;\n                    mem_fence_global();\n                    old_counter_234399 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234373)[sext_i32_i64(srem32(flat_segment_id_234387,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234382)[(int64_t) 0] =\n                        old_counter_234399 == groups_per_segment_234366 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234400;\n            \n            is_last_group_234400 = ((__local\n                                     bool *) sync_arr_mem_234382)[(int64_t) 0];\n            if (is_last_group_234400) {\n                if (local_tid_234376 == 0) {\n                    old_counter_234399 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234373)[sext_i32_i64(srem32(flat_segment_id_234387,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234366));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234401 =\n                            sdiv_up64(groups_per_segment_234366,\n                                      segred_group_sizze_218715);\n                    \n                    x_218722 = 0.0;\n                    for (int64_t i_234402 = 0; i_234402 <\n                         read_per_thread_234401; i_234402++) {\n                        ",
            "int64_t group_res_id_234403 =\n                                sext_i32_i64(local_tid_234376) *\n                                read_per_thread_234401 + i_234402;\n                        int64_t index_of_group_res_234404 =\n                                sext_i32_i64(flat_segment_id_234387) *\n                                groups_per_segment_234366 + group_res_id_234403;\n                        \n                        if (slt64(group_res_id_234403,\n                                  groups_per_segment_234366)) {\n                            x_218723 = ((__global\n                                         double *) segred_tmp_mem_234371)[index_of_group_res_234404];\n                            \n                            double defunc_1_op_res_218724 = x_218722 + x_218723;\n                            \n                            x_218722 = defunc_1_op_res_218724;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376)] =\n                    x_218722;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234405;\n                    int32_t skip_waves_234406 = 1;\n                    double x_234393;\n                    double x_234394;\n                    \n                    offset_234405 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234376,\n                                  sext_i64_i32(segred_group_sizze_218715))) {\n                            x_234393 = ((__local\n                                         double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376 +\n                                                                       offset_234405)];\n                        }\n                    }\n                    offset_234405 = 1;\n                    while (slt32(of",
            "fset_234405, wave_sizze_234378)) {\n                        if (slt32(local_tid_234376 + offset_234405,\n                                  sext_i64_i32(segred_group_sizze_218715)) &&\n                            ((local_tid_234376 - squot32(local_tid_234376,\n                                                         wave_sizze_234378) *\n                              wave_sizze_234378) & (2 * offset_234405 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234394 = ((volatile __local\n                                             double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376 +\n                                                                           offset_234405)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234395 = x_234393 +\n                                       x_234394;\n                                \n                                x_234393 = defunc_1_op_res_234395;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376)] =\n                                    x_234393;\n                            }\n                        }\n                        offset_234405 *= 2;\n                    }\n                    while (slt32(skip_waves_234406,\n                                 squot32(sext_i64_i32(segred_group_sizze_218715) +\n                                         wave_sizze_234378 - 1,\n                                         wave_sizze_234378))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234405 = skip_waves_234406 * wave_sizze_234378;\n                        if (slt32(local_ti",
            "d_234376 + offset_234405,\n                                  sext_i64_i32(segred_group_sizze_218715)) &&\n                            ((local_tid_234376 - squot32(local_tid_234376,\n                                                         wave_sizze_234378) *\n                              wave_sizze_234378) == 0 &&\n                             (squot32(local_tid_234376, wave_sizze_234378) &\n                              (2 * skip_waves_234406 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234394 = ((__local\n                                             double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376 +\n                                                                           offset_234405)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234395 = x_234393 +\n                                       x_234394;\n                                \n                                x_234393 = defunc_1_op_res_234395;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234380)[sext_i32_i64(local_tid_234376)] =\n                                    x_234393;\n                            }\n                        }\n                        skip_waves_234406 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234376 == 0) {\n                            ((__global double *) mem_230619)[gtid_218719] =\n                                x_234393;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    retur",
            "n;\n    #undef segred_group_sizze_218715\n}\n__kernel void mainzisegred_large_218852(__global int *global_failure,\n                                        uint sync_arr_mem_234563_backing_offset_0,\n                                        uint red_arr_mem_234561_backing_offset_1,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t lifted_single_ma_l_arg_204224,\n                                        int64_t num_groups_218847,\n                                        int64_t groups_per_segment_234547,\n                                        int64_t elements_per_thread_234548,\n                                        int64_t virt_num_groups_234549,\n                                        int64_t threads_per_segment_234551,\n                                        __global unsigned char *mem_230625,\n                                        __global unsigned char *mem_230636,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234552,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234554)\n{\n    #define segred_group_sizze_218846 (mainzisegred_group_sizze_218829)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234563_backing_1 =\n                           &shared_mem[sync_arr_mem_234563_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234561_backing_0 =\n                           &shared_mem[red_arr_mem_234561_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234556;\n    int32_t local_tid_234557;\n    int64_t group_sizze_234560;\n    int32_t wave_sizze_234559;\n    int32_t group_tid_234558;\n    \n    global_tid_234556 = get_global_id(0);\n    local_tid_234557 = get_local_id(0",
            ");\n    group_sizze_234560 = get_local_size(0);\n    wave_sizze_234559 = LOCKSTEP_WIDTH;\n    group_tid_234558 = get_group_id(0);\n    \n    int32_t phys_tid_218852 = global_tid_234556;\n    __local unsigned char *red_arr_mem_234561;\n    \n    red_arr_mem_234561 = (__local unsigned char *) red_arr_mem_234561_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234563;\n    \n    sync_arr_mem_234563 = (__local\n                           unsigned char *) sync_arr_mem_234563_backing_1;\n    \n    int32_t phys_group_id_234565;\n    \n    phys_group_id_234565 = get_group_id(0);\n    for (int32_t i_234566 = 0; i_234566 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234549) - phys_group_id_234565,\n                   sext_i64_i32(num_groups_218847)); i_234566++) {\n        int32_t virt_group_id_234567 = phys_group_id_234565 + i_234566 *\n                sext_i64_i32(num_groups_218847);\n        int32_t flat_segment_id_234568 = squot32(virt_group_id_234567,\n                                                 sext_i64_i32(groups_per_segment_234547));\n        int64_t global_tid_234569 = srem64(sext_i32_i64(virt_group_id_234567) *\n                                           segred_group_sizze_218846 +\n                                           sext_i32_i64(local_tid_234557),\n                                           segred_group_sizze_218846 *\n                                           groups_per_segment_234547);\n        int64_t slice_234570 = partition_sizze_203667;\n        int64_t gtid_218850 = sext_i32_i64(flat_segment_id_234568);\n        int64_t remnant_234571 = sext_i32_i64(flat_segment_id_234568) -\n                gtid_218850;\n        int64_t gtid_218851;\n        double x_acc_234572;\n        int64_t chunk_sizze_234573 = smin64(elements_per_thread_234548,\n                                            sdiv_up64(n_p_203574 -\n                                                      global_tid_234569,\n                                                      threads_per_segment_234551));\n        dou",
            "ble x_218853;\n        double x_218854;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234572 = 0.0;\n        }\n        for (int64_t i_234577 = 0; i_234577 < chunk_sizze_234573; i_234577++) {\n            gtid_218851 = global_tid_234569 + threads_per_segment_234551 *\n                i_234577;\n            // apply map function\n            {\n                double x_218857;\n                \n                x_218857 = ((__global double *) mem_230625)[gtid_218850 *\n                                                            lifted_single_ma_l_arg_204224 +\n                                                            gtid_218851];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218853 = x_acc_234572;\n                }\n                // load new values\n                {\n                    x_218854 = x_218857;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218855 = x_218853 + x_218854;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234572 = defunc_1_op_res_218855;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218853 = x_acc_234572;\n            ((__local\n              double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557)] =\n                x_218853;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234578;\n        int32_t skip_waves_234579 = 1;\n        double x_234574;\n        double x_234575;\n        \n        offset_234578 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234557,\n                      sext_i64_i32(segred_group_sizze_218846))) {\n                x_234574 = ((__local\n                             d",
            "ouble *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557 +\n                                                           offset_234578)];\n            }\n        }\n        offset_234578 = 1;\n        while (slt32(offset_234578, wave_sizze_234559)) {\n            if (slt32(local_tid_234557 + offset_234578,\n                      sext_i64_i32(segred_group_sizze_218846)) &&\n                ((local_tid_234557 - squot32(local_tid_234557,\n                                             wave_sizze_234559) *\n                  wave_sizze_234559) & (2 * offset_234578 - 1)) == 0) {\n                // read array element\n                {\n                    x_234575 = ((volatile __local\n                                 double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557 +\n                                                               offset_234578)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234576 = x_234574 + x_234575;\n                    \n                    x_234574 = defunc_1_op_res_234576;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557)] =\n                        x_234574;\n                }\n            }\n            offset_234578 *= 2;\n        }\n        while (slt32(skip_waves_234579,\n                     squot32(sext_i64_i32(segred_group_sizze_218846) +\n                             wave_sizze_234559 - 1, wave_sizze_234559))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234578 = skip_waves_234579 * wave_sizze_234559;\n            if (slt32(local_tid_234557 + offset_234578,\n                      sext_i64_i32(segred_group_sizze_218846)) &&\n                ((local_tid_234557 - squot32(local_tid_234557,\n                                             wave_sizze_234559) *\n                  wave_sizze_234559) == 0 && (squot32(local_",
            "tid_234557,\n                                                      wave_sizze_234559) & (2 *\n                                                                            skip_waves_234579 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234575 = ((__local\n                                 double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557 +\n                                                               offset_234578)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234576 = x_234574 + x_234575;\n                    \n                    x_234574 = defunc_1_op_res_234576;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557)] =\n                        x_234574;\n                }\n            }\n            skip_waves_234579 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234557) == (int64_t) 0) {\n                x_acc_234572 = x_234574;\n            }\n        }\n        if (groups_per_segment_234547 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234557 == 0) {\n                    ((__global double *) mem_230636)[gtid_218850] =\n                        x_acc_234572;\n                }\n            }\n        } else {\n            int32_t old_counter_234580;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234557 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234552)[sext_i32_i64(virt_group_id_234567)] =\n                ",
            "        x_acc_234572;\n                    mem_fence_global();\n                    old_counter_234580 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234554)[sext_i32_i64(srem32(flat_segment_id_234568,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234563)[(int64_t) 0] =\n                        old_counter_234580 == groups_per_segment_234547 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234581;\n            \n            is_last_group_234581 = ((__local\n                                     bool *) sync_arr_mem_234563)[(int64_t) 0];\n            if (is_last_group_234581) {\n                if (local_tid_234557 == 0) {\n                    old_counter_234580 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234554)[sext_i32_i64(srem32(flat_segment_id_234568,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234547));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234582 =\n                            sdiv_up64(groups_per_segment_234547,\n                                      segred_group_sizze_218846);\n                    \n                    x_218853 = 0.0;\n                    for (int64_t i_234583 = 0; i_234583 <\n                         read_per_thread_234582; i_234583++) {\n                        int64_t group",
            "_res_id_234584 =\n                                sext_i32_i64(local_tid_234557) *\n                                read_per_thread_234582 + i_234583;\n                        int64_t index_of_group_res_234585 =\n                                sext_i32_i64(flat_segment_id_234568) *\n                                groups_per_segment_234547 + group_res_id_234584;\n                        \n                        if (slt64(group_res_id_234584,\n                                  groups_per_segment_234547)) {\n                            x_218854 = ((__global\n                                         double *) segred_tmp_mem_234552)[index_of_group_res_234585];\n                            \n                            double defunc_1_op_res_218855 = x_218853 + x_218854;\n                            \n                            x_218853 = defunc_1_op_res_218855;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557)] =\n                    x_218853;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234586;\n                    int32_t skip_waves_234587 = 1;\n                    double x_234574;\n                    double x_234575;\n                    \n                    offset_234586 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234557,\n                                  sext_i64_i32(segred_group_sizze_218846))) {\n                            x_234574 = ((__local\n                                         double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557 +\n                                                                       offset_234586)];\n                        }\n                    }\n                    offset_234586 = 1;\n                    while (slt32(offset_234586, ",
            "wave_sizze_234559)) {\n                        if (slt32(local_tid_234557 + offset_234586,\n                                  sext_i64_i32(segred_group_sizze_218846)) &&\n                            ((local_tid_234557 - squot32(local_tid_234557,\n                                                         wave_sizze_234559) *\n                              wave_sizze_234559) & (2 * offset_234586 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234575 = ((volatile __local\n                                             double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557 +\n                                                                           offset_234586)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234576 = x_234574 +\n                                       x_234575;\n                                \n                                x_234574 = defunc_1_op_res_234576;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557)] =\n                                    x_234574;\n                            }\n                        }\n                        offset_234586 *= 2;\n                    }\n                    while (slt32(skip_waves_234587,\n                                 squot32(sext_i64_i32(segred_group_sizze_218846) +\n                                         wave_sizze_234559 - 1,\n                                         wave_sizze_234559))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234586 = skip_waves_234587 * wave_sizze_234559;\n                        if (slt32(local_tid_234557 + of",
            "fset_234586,\n                                  sext_i64_i32(segred_group_sizze_218846)) &&\n                            ((local_tid_234557 - squot32(local_tid_234557,\n                                                         wave_sizze_234559) *\n                              wave_sizze_234559) == 0 &&\n                             (squot32(local_tid_234557, wave_sizze_234559) &\n                              (2 * skip_waves_234587 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234575 = ((__local\n                                             double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557 +\n                                                                           offset_234586)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234576 = x_234574 +\n                                       x_234575;\n                                \n                                x_234574 = defunc_1_op_res_234576;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234561)[sext_i32_i64(local_tid_234557)] =\n                                    x_234574;\n                            }\n                        }\n                        skip_waves_234587 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234557 == 0) {\n                            ((__global double *) mem_230636)[gtid_218850] =\n                                x_234574;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef",
            " segred_group_sizze_218846\n}\n__kernel void mainzisegred_large_218983(__global int *global_failure,\n                                        uint sync_arr_mem_234744_backing_offset_0,\n                                        uint red_arr_mem_234742_backing_offset_1,\n                                        int64_t partition_sizze_203667,\n                                        int64_t dyn_lifted_single_ma_l_arg_204234,\n                                        int64_t num_groups_218978,\n                                        int64_t groups_per_segment_234728,\n                                        int64_t elements_per_thread_234729,\n                                        int64_t virt_num_groups_234730,\n                                        int64_t threads_per_segment_234732,\n                                        __global unsigned char *mem_230642,\n                                        __global unsigned char *mem_230653,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234733,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234735)\n{\n    #define segred_group_sizze_218977 (mainzisegred_group_sizze_218960)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234744_backing_1 =\n                           &shared_mem[sync_arr_mem_234744_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234742_backing_0 =\n                           &shared_mem[red_arr_mem_234742_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234737;\n    int32_t local_tid_234738;\n    int64_t group_sizze_234741;\n    int32_t wave_sizze_234740;\n    int32_t group_tid_234739;\n    \n    global_tid_234737 = get_global_id(0);\n    local_tid_234738 = get_local_id(0);\n    group_sizze_234741 = get_local_size(0);\n    wave_sizze_234740 ",
            "= LOCKSTEP_WIDTH;\n    group_tid_234739 = get_group_id(0);\n    \n    int32_t phys_tid_218983 = global_tid_234737;\n    __local unsigned char *red_arr_mem_234742;\n    \n    red_arr_mem_234742 = (__local unsigned char *) red_arr_mem_234742_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234744;\n    \n    sync_arr_mem_234744 = (__local\n                           unsigned char *) sync_arr_mem_234744_backing_1;\n    \n    int32_t phys_group_id_234746;\n    \n    phys_group_id_234746 = get_group_id(0);\n    for (int32_t i_234747 = 0; i_234747 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234730) - phys_group_id_234746,\n                   sext_i64_i32(num_groups_218978)); i_234747++) {\n        int32_t virt_group_id_234748 = phys_group_id_234746 + i_234747 *\n                sext_i64_i32(num_groups_218978);\n        int32_t flat_segment_id_234749 = squot32(virt_group_id_234748,\n                                                 sext_i64_i32(groups_per_segment_234728));\n        int64_t global_tid_234750 = srem64(sext_i32_i64(virt_group_id_234748) *\n                                           segred_group_sizze_218977 +\n                                           sext_i32_i64(local_tid_234738),\n                                           segred_group_sizze_218977 *\n                                           groups_per_segment_234728);\n        int64_t slice_234751 = partition_sizze_203667;\n        int64_t gtid_218981 = sext_i32_i64(flat_segment_id_234749);\n        int64_t remnant_234752 = sext_i32_i64(flat_segment_id_234749) -\n                gtid_218981;\n        int64_t gtid_218982;\n        double x_acc_234753;\n        int64_t chunk_sizze_234754 = smin64(elements_per_thread_234729,\n                                            sdiv_up64((int64_t) 3 -\n                                                      global_tid_234750,\n                                                      threads_per_segment_234732));\n        double x_218984;\n        double x_218985;\n        \n        // neutral-i",
            "nitialise the accumulators\n        {\n            x_acc_234753 = 0.0;\n        }\n        for (int64_t i_234758 = 0; i_234758 < chunk_sizze_234754; i_234758++) {\n            gtid_218982 = global_tid_234750 + threads_per_segment_234732 *\n                i_234758;\n            // apply map function\n            {\n                double x_218988;\n                \n                x_218988 = ((__global double *) mem_230642)[gtid_218981 *\n                                                            dyn_lifted_single_ma_l_arg_204234 +\n                                                            gtid_218982];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218984 = x_acc_234753;\n                }\n                // load new values\n                {\n                    x_218985 = x_218988;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218986 = x_218984 + x_218985;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234753 = defunc_1_op_res_218986;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218984 = x_acc_234753;\n            ((__local\n              double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738)] =\n                x_218984;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234759;\n        int32_t skip_waves_234760 = 1;\n        double x_234755;\n        double x_234756;\n        \n        offset_234759 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234738,\n                      sext_i64_i32(segred_group_sizze_218977))) {\n                x_234755 = ((__local\n                             double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738 +\n   ",
            "                                                        offset_234759)];\n            }\n        }\n        offset_234759 = 1;\n        while (slt32(offset_234759, wave_sizze_234740)) {\n            if (slt32(local_tid_234738 + offset_234759,\n                      sext_i64_i32(segred_group_sizze_218977)) &&\n                ((local_tid_234738 - squot32(local_tid_234738,\n                                             wave_sizze_234740) *\n                  wave_sizze_234740) & (2 * offset_234759 - 1)) == 0) {\n                // read array element\n                {\n                    x_234756 = ((volatile __local\n                                 double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738 +\n                                                               offset_234759)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234757 = x_234755 + x_234756;\n                    \n                    x_234755 = defunc_1_op_res_234757;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738)] =\n                        x_234755;\n                }\n            }\n            offset_234759 *= 2;\n        }\n        while (slt32(skip_waves_234760,\n                     squot32(sext_i64_i32(segred_group_sizze_218977) +\n                             wave_sizze_234740 - 1, wave_sizze_234740))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234759 = skip_waves_234760 * wave_sizze_234740;\n            if (slt32(local_tid_234738 + offset_234759,\n                      sext_i64_i32(segred_group_sizze_218977)) &&\n                ((local_tid_234738 - squot32(local_tid_234738,\n                                             wave_sizze_234740) *\n                  wave_sizze_234740) == 0 && (squot32(local_tid_234738,\n                                                    ",
            "  wave_sizze_234740) & (2 *\n                                                                            skip_waves_234760 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234756 = ((__local\n                                 double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738 +\n                                                               offset_234759)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234757 = x_234755 + x_234756;\n                    \n                    x_234755 = defunc_1_op_res_234757;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738)] =\n                        x_234755;\n                }\n            }\n            skip_waves_234760 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234738) == (int64_t) 0) {\n                x_acc_234753 = x_234755;\n            }\n        }\n        if (groups_per_segment_234728 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234738 == 0) {\n                    ((__global double *) mem_230653)[gtid_218981] =\n                        x_acc_234753;\n                }\n            }\n        } else {\n            int32_t old_counter_234761;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234738 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234733)[sext_i32_i64(virt_group_id_234748)] =\n                        x_acc_234753;\n                    mem_fence_global();\n  ",
            "                  old_counter_234761 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234735)[sext_i32_i64(srem32(flat_segment_id_234749,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234744)[(int64_t) 0] =\n                        old_counter_234761 == groups_per_segment_234728 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234762;\n            \n            is_last_group_234762 = ((__local\n                                     bool *) sync_arr_mem_234744)[(int64_t) 0];\n            if (is_last_group_234762) {\n                if (local_tid_234738 == 0) {\n                    old_counter_234761 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234735)[sext_i32_i64(srem32(flat_segment_id_234749,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234728));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234763 =\n                            sdiv_up64(groups_per_segment_234728,\n                                      segred_group_sizze_218977);\n                    \n                    x_218984 = 0.0;\n                    for (int64_t i_234764 = 0; i_234764 <\n                         read_per_thread_234763; i_234764++) {\n                        int64_t group_res_id_234765 =\n                                sext_i32_i64(lo",
            "cal_tid_234738) *\n                                read_per_thread_234763 + i_234764;\n                        int64_t index_of_group_res_234766 =\n                                sext_i32_i64(flat_segment_id_234749) *\n                                groups_per_segment_234728 + group_res_id_234765;\n                        \n                        if (slt64(group_res_id_234765,\n                                  groups_per_segment_234728)) {\n                            x_218985 = ((__global\n                                         double *) segred_tmp_mem_234733)[index_of_group_res_234766];\n                            \n                            double defunc_1_op_res_218986 = x_218984 + x_218985;\n                            \n                            x_218984 = defunc_1_op_res_218986;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738)] =\n                    x_218984;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234767;\n                    int32_t skip_waves_234768 = 1;\n                    double x_234755;\n                    double x_234756;\n                    \n                    offset_234767 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234738,\n                                  sext_i64_i32(segred_group_sizze_218977))) {\n                            x_234755 = ((__local\n                                         double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738 +\n                                                                       offset_234767)];\n                        }\n                    }\n                    offset_234767 = 1;\n                    while (slt32(offset_234767, wave_sizze_234740)) {\n                        if (slt32(local_ti",
            "d_234738 + offset_234767,\n                                  sext_i64_i32(segred_group_sizze_218977)) &&\n                            ((local_tid_234738 - squot32(local_tid_234738,\n                                                         wave_sizze_234740) *\n                              wave_sizze_234740) & (2 * offset_234767 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234756 = ((volatile __local\n                                             double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738 +\n                                                                           offset_234767)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234757 = x_234755 +\n                                       x_234756;\n                                \n                                x_234755 = defunc_1_op_res_234757;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738)] =\n                                    x_234755;\n                            }\n                        }\n                        offset_234767 *= 2;\n                    }\n                    while (slt32(skip_waves_234768,\n                                 squot32(sext_i64_i32(segred_group_sizze_218977) +\n                                         wave_sizze_234740 - 1,\n                                         wave_sizze_234740))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234767 = skip_waves_234768 * wave_sizze_234740;\n                        if (slt32(local_tid_234738 + offset_234767,\n                                  sext_i64_i32(segr",
            "ed_group_sizze_218977)) &&\n                            ((local_tid_234738 - squot32(local_tid_234738,\n                                                         wave_sizze_234740) *\n                              wave_sizze_234740) == 0 &&\n                             (squot32(local_tid_234738, wave_sizze_234740) &\n                              (2 * skip_waves_234768 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234756 = ((__local\n                                             double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738 +\n                                                                           offset_234767)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234757 = x_234755 +\n                                       x_234756;\n                                \n                                x_234755 = defunc_1_op_res_234757;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234742)[sext_i32_i64(local_tid_234738)] =\n                                    x_234755;\n                            }\n                        }\n                        skip_waves_234768 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234738 == 0) {\n                            ((__global double *) mem_230653)[gtid_218981] =\n                                x_234755;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218977\n}\n__kernel void mainzisegred_large_21",
            "9605(__global int *global_failure,\n                                        uint sync_arr_mem_234961_backing_offset_0,\n                                        uint red_arr_mem_234959_backing_offset_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219599,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_234945,\n                                        int64_t elements_per_thread_234946,\n                                        int64_t virt_num_groups_234947,\n                                        int64_t threads_per_segment_234949,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230704,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234950,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234952)\n{\n    #define segred_group_sizze_219598 (mainzisegred_group_sizze_219350)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_234961_backing_1 =\n                           &shared_mem[sync_arr_mem_234961_backing_offset_0];\n    volat",
            "ile unsigned char *red_arr_mem_234959_backing_0 =\n                           &shared_mem[red_arr_mem_234959_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234954;\n    int32_t local_tid_234955;\n    int64_t group_sizze_234958;\n    int32_t wave_sizze_234957;\n    int32_t group_tid_234956;\n    \n    global_tid_234954 = get_global_id(0);\n    local_tid_234955 = get_local_id(0);\n    group_sizze_234958 = get_local_size(0);\n    wave_sizze_234957 = LOCKSTEP_WIDTH;\n    group_tid_234956 = get_group_id(0);\n    \n    int32_t phys_tid_219605 = global_tid_234954;\n    __local unsigned char *red_arr_mem_234959;\n    \n    red_arr_mem_234959 = (__local unsigned char *) red_arr_mem_234959_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234961;\n    \n    sync_arr_mem_234961 = (__local\n                           unsigned char *) sync_arr_mem_234961_backing_1;\n    \n    int32_t phys_group_id_234963;\n    \n    phys_group_id_234963 = get_group_id(0);\n    for (int32_t i_234964 = 0; i_234964 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234947) - phys_group_id_234963,\n                   sext_i64_i32(num_groups_219599)); i_234964++) {\n        int32_t virt_group_id_234965 = phys_group_id_234963 + i_234964 *\n                sext_i64_i32(num_groups_219599);\n        int32_t flat_segment_id_234966 = squot32(virt_group_id_234965,\n                                                 sext_i64_i32(groups_per_segment_234945));\n        int64_t global_tid_234967 = srem64(sext_i32_i64(virt_group_id_234965) *\n                                           segred_group_sizze_219598 +\n                                           sext_i32_i64(local_tid_234955),\n                                           segred_group_sizze_219598 *\n                                           groups_per_segment_234945);\n        int64_t slice_234968 = l_n_m_203733;\n        int64_t slice_234969 = partition_sizze_203667 * slice_234968;\n        int64_t gtid_219602 = squot64(sext_i32_i64(fl",
            "at_segment_id_234966),\n                                      slice_234968);\n        int64_t remnant_234970 = sext_i32_i64(flat_segment_id_234966) -\n                gtid_219602 * slice_234968;\n        int64_t gtid_219603 = remnant_234970;\n        int64_t remnant_234971 = remnant_234970 - gtid_219603;\n        int64_t gtid_219604;\n        double x_acc_234972;\n        int64_t chunk_sizze_234973 = smin64(elements_per_thread_234946,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_234967,\n                                                      threads_per_segment_234949));\n        double x_219606;\n        double x_219607;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234972 = 0.0;\n        }\n        for (int64_t i_234977 = 0; i_234977 < chunk_sizze_234973; i_234977++) {\n            gtid_219604 = global_tid_234967 + threads_per_segment_234949 *\n                i_234977;\n            // apply map function\n            {\n                int64_t x_219613;\n                \n                x_219613 = ((__global int64_t *) ext_mem_229520)[gtid_219602 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219603];\n                \n                double x_219614;\n                \n                x_219614 = ((__global double *) ext_mem_229519)[gtid_219602 *\n                                                                l_n_m_203733 +\n                                                                gtid_219603];\n                \n                int64_t binop_y_228780 = mul64(jump_t_203582, gtid_219603);\n                int64_t binop_y_228781 = smin64(i_203760, binop_y_228780);\n                int64_t index_primexp_228782 = add64((int64_t) 1,\n                                                     binop_y_228781);\n                bool cond_219617 = sle64(n_203572, gtid_219604)",
            ";\n                int64_t defunc_0_f_res_219618;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219618 = (int64_t) 0;\n                } else {\n                    int64_t i_219619 = add64(gtid_219604, x_219613);\n                    int64_t defunc_1_add_res_219620 = add64((int64_t) 1,\n                                                            i_219619);\n                    \n                    defunc_0_f_res_219618 = defunc_1_add_res_219620;\n                }\n                \n                double defunc_0_f_res_219621;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219621 = 0.0;\n                } else {\n                    int64_t i_219622 = add64(gtid_219604, x_219613);\n                    double defunc_0_add_arg_219623;\n                    \n                    defunc_0_add_arg_219623 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219602 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219622 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219621 = defunc_0_add_arg_219623;\n                }\n                \n                int64_t binop_p_219624 = sub64(defunc_0_f_res_219618,\n                                               index_primexp_228782);\n                double defunc_0_f_res_219625 = sitofp_i64_f64(binop_p_219624);\n                double abs_res_219626 = fabs(defunc_0_f_res_219625);\n                double tmp1_219627 = abs_res_219626 / x_219614;\n                double x_219628 = tmp1_219627 * tmp1_219627;\n                double y_219629 = tmp1_219627 * x_219628;\n                double tmp2_219630 = 1.0 - y_219629;\n ",
            "               double x_219631 = tmp2_219630 * tmp2_219630;\n                double tmp3_219632 = tmp2_219630 * x_219631;\n                double w_j_219633 = defunc_0_f_res_219621 * tmp3_219632;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219606 = x_acc_234972;\n                }\n                // load new values\n                {\n                    x_219607 = w_j_219633;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219608 = x_219606 + x_219607;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234972 = defunc_1_op_res_219608;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219606 = x_acc_234972;\n            ((__local\n              double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955)] =\n                x_219606;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234978;\n        int32_t skip_waves_234979 = 1;\n        double x_234974;\n        double x_234975;\n        \n        offset_234978 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234955,\n                      sext_i64_i32(segred_group_sizze_219598))) {\n                x_234974 = ((__local\n                             double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955 +\n                                                           offset_234978)];\n            }\n        }\n        offset_234978 = 1;\n        while (slt32(offset_234978, wave_sizze_234957)) {\n            if (slt32(local_tid_234955 + offset_234978,\n                      sext_i64_i32(segred_group_sizze_219598)) &&\n                ((local_tid_234955 - squot32(local_tid_234955,\n                      ",
            "                       wave_sizze_234957) *\n                  wave_sizze_234957) & (2 * offset_234978 - 1)) == 0) {\n                // read array element\n                {\n                    x_234975 = ((volatile __local\n                                 double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955 +\n                                                               offset_234978)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234976 = x_234974 + x_234975;\n                    \n                    x_234974 = defunc_1_op_res_234976;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955)] =\n                        x_234974;\n                }\n            }\n            offset_234978 *= 2;\n        }\n        while (slt32(skip_waves_234979,\n                     squot32(sext_i64_i32(segred_group_sizze_219598) +\n                             wave_sizze_234957 - 1, wave_sizze_234957))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234978 = skip_waves_234979 * wave_sizze_234957;\n            if (slt32(local_tid_234955 + offset_234978,\n                      sext_i64_i32(segred_group_sizze_219598)) &&\n                ((local_tid_234955 - squot32(local_tid_234955,\n                                             wave_sizze_234957) *\n                  wave_sizze_234957) == 0 && (squot32(local_tid_234955,\n                                                      wave_sizze_234957) & (2 *\n                                                                            skip_waves_234979 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234975 = ((__local\n                                 double *) red_arr_mem_234959)",
            "[sext_i32_i64(local_tid_234955 +\n                                                               offset_234978)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234976 = x_234974 + x_234975;\n                    \n                    x_234974 = defunc_1_op_res_234976;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955)] =\n                        x_234974;\n                }\n            }\n            skip_waves_234979 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234955) == (int64_t) 0) {\n                x_acc_234972 = x_234974;\n            }\n        }\n        if (groups_per_segment_234945 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234955 == 0) {\n                    ((__global double *) mem_230704)[gtid_219602 *\n                                                     l_n_m_203733 +\n                                                     gtid_219603] =\n                        x_acc_234972;\n                }\n            }\n        } else {\n            int32_t old_counter_234980;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234955 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234950)[sext_i32_i64(virt_group_id_234965)] =\n                        x_acc_234972;\n                    mem_fence_global();\n                    old_counter_234980 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234952)[sext_i32_i64(srem32(flat_segment_id_234966,\n                      ",
            "                                                                                10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234961)[(int64_t) 0] =\n                        old_counter_234980 == groups_per_segment_234945 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234981;\n            \n            is_last_group_234981 = ((__local\n                                     bool *) sync_arr_mem_234961)[(int64_t) 0];\n            if (is_last_group_234981) {\n                if (local_tid_234955 == 0) {\n                    old_counter_234980 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234952)[sext_i32_i64(srem32(flat_segment_id_234966,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234945));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234982 =\n                            sdiv_up64(groups_per_segment_234945,\n                                      segred_group_sizze_219598);\n                    \n                    x_219606 = 0.0;\n                    for (int64_t i_234983 = 0; i_234983 <\n                         read_per_thread_234982; i_234983++) {\n                        int64_t group_res_id_234984 =\n                                sext_i32_i64(local_tid_234955) *\n                                read_per_thread_234982 + i_234983;\n                        int64_t index_of_group_res_234985 =\n                                sext_i32_i64(flat_segment_id_234966) *\n                                groups",
            "_per_segment_234945 + group_res_id_234984;\n                        \n                        if (slt64(group_res_id_234984,\n                                  groups_per_segment_234945)) {\n                            x_219607 = ((__global\n                                         double *) segred_tmp_mem_234950)[index_of_group_res_234985];\n                            \n                            double defunc_1_op_res_219608 = x_219606 + x_219607;\n                            \n                            x_219606 = defunc_1_op_res_219608;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955)] =\n                    x_219606;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234986;\n                    int32_t skip_waves_234987 = 1;\n                    double x_234974;\n                    double x_234975;\n                    \n                    offset_234986 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234955,\n                                  sext_i64_i32(segred_group_sizze_219598))) {\n                            x_234974 = ((__local\n                                         double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955 +\n                                                                       offset_234986)];\n                        }\n                    }\n                    offset_234986 = 1;\n                    while (slt32(offset_234986, wave_sizze_234957)) {\n                        if (slt32(local_tid_234955 + offset_234986,\n                                  sext_i64_i32(segred_group_sizze_219598)) &&\n                            ((local_tid_234955 - squot32(local_tid_234955,\n                                                         wave_sizze_234957)",
            " *\n                              wave_sizze_234957) & (2 * offset_234986 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234975 = ((volatile __local\n                                             double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955 +\n                                                                           offset_234986)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234976 = x_234974 +\n                                       x_234975;\n                                \n                                x_234974 = defunc_1_op_res_234976;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955)] =\n                                    x_234974;\n                            }\n                        }\n                        offset_234986 *= 2;\n                    }\n                    while (slt32(skip_waves_234987,\n                                 squot32(sext_i64_i32(segred_group_sizze_219598) +\n                                         wave_sizze_234957 - 1,\n                                         wave_sizze_234957))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234986 = skip_waves_234987 * wave_sizze_234957;\n                        if (slt32(local_tid_234955 + offset_234986,\n                                  sext_i64_i32(segred_group_sizze_219598)) &&\n                            ((local_tid_234955 - squot32(local_tid_234955,\n                                                         wave_sizze_234957) *\n                              wave_sizze_234957) == 0 &&\n                 ",
            "            (squot32(local_tid_234955, wave_sizze_234957) &\n                              (2 * skip_waves_234987 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234975 = ((__local\n                                             double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955 +\n                                                                           offset_234986)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234976 = x_234974 +\n                                       x_234975;\n                                \n                                x_234974 = defunc_1_op_res_234976;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234959)[sext_i32_i64(local_tid_234955)] =\n                                    x_234974;\n                            }\n                        }\n                        skip_waves_234987 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234955 == 0) {\n                            ((__global double *) mem_230704)[gtid_219602 *\n                                                             l_n_m_203733 +\n                                                             gtid_219603] =\n                                x_234974;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219598\n}\n__kernel void mainzisegred_large_219654(__global int *global_failure,\n                                        uint sync_arr_mem_235043_bac",
            "king_offset_0,\n                                        uint red_arr_mem_235041_backing_offset_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219648,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235027,\n                                        int64_t elements_per_thread_235028,\n                                        int64_t virt_num_groups_235029,\n                                        int64_t threads_per_segment_235031,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230709,\n                                        __global unsigned char *mem_230714,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235032,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235034)\n{\n    #define segred_group_sizze_219647 (mainzisegred_group_sizze_219283)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235043_backing_1 =\n                           &shared_mem",
            "[sync_arr_mem_235043_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235041_backing_0 =\n                           &shared_mem[red_arr_mem_235041_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235036;\n    int32_t local_tid_235037;\n    int64_t group_sizze_235040;\n    int32_t wave_sizze_235039;\n    int32_t group_tid_235038;\n    \n    global_tid_235036 = get_global_id(0);\n    local_tid_235037 = get_local_id(0);\n    group_sizze_235040 = get_local_size(0);\n    wave_sizze_235039 = LOCKSTEP_WIDTH;\n    group_tid_235038 = get_group_id(0);\n    \n    int32_t phys_tid_219654 = global_tid_235036;\n    __local unsigned char *red_arr_mem_235041;\n    \n    red_arr_mem_235041 = (__local unsigned char *) red_arr_mem_235041_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235043;\n    \n    sync_arr_mem_235043 = (__local\n                           unsigned char *) sync_arr_mem_235043_backing_1;\n    \n    int32_t phys_group_id_235045;\n    \n    phys_group_id_235045 = get_group_id(0);\n    for (int32_t i_235046 = 0; i_235046 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235029) - phys_group_id_235045,\n                   sext_i64_i32(num_groups_219648)); i_235046++) {\n        int32_t virt_group_id_235047 = phys_group_id_235045 + i_235046 *\n                sext_i64_i32(num_groups_219648);\n        int32_t flat_segment_id_235048 = squot32(virt_group_id_235047,\n                                                 sext_i64_i32(groups_per_segment_235027));\n        int64_t global_tid_235049 = srem64(sext_i32_i64(virt_group_id_235047) *\n                                           segred_group_sizze_219647 +\n                                           sext_i32_i64(local_tid_235037),\n                                           segred_group_sizze_219647 *\n                                           groups_per_segment_235027);\n        int64_t slice_235050 = l_n_m_203733;\n        int64_t slice_235051 = partition_sizze_203667 * slice_235050;\n    ",
            "    int64_t gtid_219651 = squot64(sext_i32_i64(flat_segment_id_235048),\n                                      slice_235050);\n        int64_t remnant_235052 = sext_i32_i64(flat_segment_id_235048) -\n                gtid_219651 * slice_235050;\n        int64_t gtid_219652 = remnant_235052;\n        int64_t remnant_235053 = remnant_235052 - gtid_219652;\n        int64_t gtid_219653;\n        double x_acc_235054;\n        int64_t chunk_sizze_235055 = smin64(elements_per_thread_235028,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235049,\n                                                      threads_per_segment_235031));\n        double x_219655;\n        double x_219656;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235054 = 0.0;\n        }\n        for (int64_t i_235059 = 0; i_235059 < chunk_sizze_235055; i_235059++) {\n            gtid_219653 = global_tid_235049 + threads_per_segment_235031 *\n                i_235059;\n            // apply map function\n            {\n                int64_t x_219664;\n                \n                x_219664 = ((__global int64_t *) ext_mem_229520)[gtid_219651 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219652];\n                \n                double x_219665;\n                \n                x_219665 = ((__global double *) ext_mem_229519)[gtid_219651 *\n                                                                l_n_m_203733 +\n                                                                gtid_219652];\n                \n                int64_t binop_y_228775 = mul64(jump_t_203582, gtid_219652);\n                int64_t binop_y_228776 = smin64(i_203760, binop_y_228775);\n                int64_t index_primexp_228777 = add64((int64_t) 1,\n                                                     binop_y_228776);\n              ",
            "  double a0_219667;\n                \n                a0_219667 = ((__global double *) mem_230709)[gtid_219651 *\n                                                             l_n_m_203733 +\n                                                             gtid_219652];\n                \n                bool cond_219669 = sle64(n_203572, gtid_219653);\n                int64_t defunc_0_f_res_219670;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219670 = (int64_t) 0;\n                } else {\n                    int64_t i_219671 = add64(gtid_219653, x_219664);\n                    int64_t defunc_1_add_res_219672 = add64((int64_t) 1,\n                                                            i_219671);\n                    \n                    defunc_0_f_res_219670 = defunc_1_add_res_219672;\n                }\n                \n                double defunc_0_f_res_219673;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219673 = 0.0;\n                } else {\n                    int64_t i_219674 = add64(gtid_219653, x_219664);\n                    double defunc_0_add_arg_219675;\n                    \n                    defunc_0_add_arg_219675 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219651 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219674 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219673 = defunc_0_add_arg_219675;\n                }\n                \n                int64_t binop_p_219676 = sub64(defunc_0_f_res_219670,\n                                               index_primexp_228777);\n                double defunc_0_f_res_2196",
            "77 = sitofp_i64_f64(binop_p_219676);\n                double abs_res_219678 = fabs(defunc_0_f_res_219677);\n                double tmp1_219679 = abs_res_219678 / x_219665;\n                double x_219680 = tmp1_219679 * tmp1_219679;\n                double y_219681 = tmp1_219679 * x_219680;\n                double tmp2_219682 = 1.0 - y_219681;\n                double x_219683 = tmp2_219682 * tmp2_219682;\n                double tmp3_219684 = tmp2_219682 * x_219683;\n                double tmp4_219685 = defunc_0_f_res_219673 * tmp3_219684;\n                double defunc_0_f_res_219686;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219686 = 0.0;\n                } else {\n                    int64_t i_219687 = add64(gtid_219653, x_219664);\n                    double defunc_0_add_arg_219688;\n                    \n                    defunc_0_add_arg_219688 = ((__global\n                                                double *) mem_230659)[gtid_219651 *\n                                                                      n_203572 +\n                                                                      i_219687];\n                    defunc_0_f_res_219686 = defunc_0_add_arg_219688;\n                }\n                \n                double x_219689 = a0_219667 * tmp4_219685;\n                double defunc_9_fit_fun_res_219690 = defunc_0_f_res_219686 *\n                       x_219689;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219655 = x_acc_235054;\n                }\n                // load new values\n                {\n                    x_219656 = defunc_9_fit_fun_res_219690;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219657 = x_219655 + x_219656;\n                    \n                    // store in accumulator\n                    {\n                        x",
            "_acc_235054 = defunc_1_op_res_219657;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219655 = x_acc_235054;\n            ((__local\n              double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037)] =\n                x_219655;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235060;\n        int32_t skip_waves_235061 = 1;\n        double x_235056;\n        double x_235057;\n        \n        offset_235060 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235037,\n                      sext_i64_i32(segred_group_sizze_219647))) {\n                x_235056 = ((__local\n                             double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037 +\n                                                           offset_235060)];\n            }\n        }\n        offset_235060 = 1;\n        while (slt32(offset_235060, wave_sizze_235039)) {\n            if (slt32(local_tid_235037 + offset_235060,\n                      sext_i64_i32(segred_group_sizze_219647)) &&\n                ((local_tid_235037 - squot32(local_tid_235037,\n                                             wave_sizze_235039) *\n                  wave_sizze_235039) & (2 * offset_235060 - 1)) == 0) {\n                // read array element\n                {\n                    x_235057 = ((volatile __local\n                                 double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037 +\n                                                               offset_235060)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235058 = x_235056 + x_235057;\n                    \n                    x_235056 = defunc_1_op_res_235058;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n  ",
            "                    double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037)] =\n                        x_235056;\n                }\n            }\n            offset_235060 *= 2;\n        }\n        while (slt32(skip_waves_235061,\n                     squot32(sext_i64_i32(segred_group_sizze_219647) +\n                             wave_sizze_235039 - 1, wave_sizze_235039))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235060 = skip_waves_235061 * wave_sizze_235039;\n            if (slt32(local_tid_235037 + offset_235060,\n                      sext_i64_i32(segred_group_sizze_219647)) &&\n                ((local_tid_235037 - squot32(local_tid_235037,\n                                             wave_sizze_235039) *\n                  wave_sizze_235039) == 0 && (squot32(local_tid_235037,\n                                                      wave_sizze_235039) & (2 *\n                                                                            skip_waves_235061 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235057 = ((__local\n                                 double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037 +\n                                                               offset_235060)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235058 = x_235056 + x_235057;\n                    \n                    x_235056 = defunc_1_op_res_235058;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037)] =\n                        x_235056;\n                }\n            }\n            skip_waves_235061 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n   ",
            "     {\n            if (sext_i32_i64(local_tid_235037) == (int64_t) 0) {\n                x_acc_235054 = x_235056;\n            }\n        }\n        if (groups_per_segment_235027 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235037 == 0) {\n                    ((__global double *) mem_230714)[gtid_219651 *\n                                                     l_n_m_203733 +\n                                                     gtid_219652] =\n                        x_acc_235054;\n                }\n            }\n        } else {\n            int32_t old_counter_235062;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235037 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235032)[sext_i32_i64(virt_group_id_235047)] =\n                        x_acc_235054;\n                    mem_fence_global();\n                    old_counter_235062 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235034)[sext_i32_i64(srem32(flat_segment_id_235048,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235043)[(int64_t) 0] =\n                        old_counter_235062 == groups_per_segment_235027 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235063;\n            \n            is_last_group_235063 = ((__local\n                                     bool *) sync_arr_mem_235043)[(int64_t) 0];\n            if (is_last_group_235063) {\n                if (local_tid_235037 == 0) {\n                    old_counter_235062 =\n     ",
            "                   atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235034)[sext_i32_i64(srem32(flat_segment_id_235048,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235027));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235064 =\n                            sdiv_up64(groups_per_segment_235027,\n                                      segred_group_sizze_219647);\n                    \n                    x_219655 = 0.0;\n                    for (int64_t i_235065 = 0; i_235065 <\n                         read_per_thread_235064; i_235065++) {\n                        int64_t group_res_id_235066 =\n                                sext_i32_i64(local_tid_235037) *\n                                read_per_thread_235064 + i_235065;\n                        int64_t index_of_group_res_235067 =\n                                sext_i32_i64(flat_segment_id_235048) *\n                                groups_per_segment_235027 + group_res_id_235066;\n                        \n                        if (slt64(group_res_id_235066,\n                                  groups_per_segment_235027)) {\n                            x_219656 = ((__global\n                                         double *) segred_tmp_mem_235032)[index_of_group_res_235067];\n                            \n                            double defunc_1_op_res_219657 = x_219655 + x_219656;\n                            \n                            x_219655 = defunc_1_op_res_219657;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037)] =\n                    x_219655;\n    ",
            "            barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235068;\n                    int32_t skip_waves_235069 = 1;\n                    double x_235056;\n                    double x_235057;\n                    \n                    offset_235068 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235037,\n                                  sext_i64_i32(segred_group_sizze_219647))) {\n                            x_235056 = ((__local\n                                         double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037 +\n                                                                       offset_235068)];\n                        }\n                    }\n                    offset_235068 = 1;\n                    while (slt32(offset_235068, wave_sizze_235039)) {\n                        if (slt32(local_tid_235037 + offset_235068,\n                                  sext_i64_i32(segred_group_sizze_219647)) &&\n                            ((local_tid_235037 - squot32(local_tid_235037,\n                                                         wave_sizze_235039) *\n                              wave_sizze_235039) & (2 * offset_235068 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235057 = ((volatile __local\n                                             double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037 +\n                                                                           offset_235068)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235058 = x_235056 +\n                                       x_235057;\n                                \n                   ",
            "             x_235056 = defunc_1_op_res_235058;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037)] =\n                                    x_235056;\n                            }\n                        }\n                        offset_235068 *= 2;\n                    }\n                    while (slt32(skip_waves_235069,\n                                 squot32(sext_i64_i32(segred_group_sizze_219647) +\n                                         wave_sizze_235039 - 1,\n                                         wave_sizze_235039))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235068 = skip_waves_235069 * wave_sizze_235039;\n                        if (slt32(local_tid_235037 + offset_235068,\n                                  sext_i64_i32(segred_group_sizze_219647)) &&\n                            ((local_tid_235037 - squot32(local_tid_235037,\n                                                         wave_sizze_235039) *\n                              wave_sizze_235039) == 0 &&\n                             (squot32(local_tid_235037, wave_sizze_235039) &\n                              (2 * skip_waves_235069 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235057 = ((__local\n                                             double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037 +\n                                                                           offset_235068)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235058 = x_235056 +\n                                       x_235057;\n                                \n               ",
            "                 x_235056 = defunc_1_op_res_235058;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235041)[sext_i32_i64(local_tid_235037)] =\n                                    x_235056;\n                            }\n                        }\n                        skip_waves_235069 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235037 == 0) {\n                            ((__global double *) mem_230714)[gtid_219651 *\n                                                             l_n_m_203733 +\n                                                             gtid_219652] =\n                                x_235056;\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_219647\n}\n__kernel void mainzisegred_large_220434(__global int *global_failure,\n                                        uint sync_arr_mem_235189_backing_offset_0,\n                                        uint red_arr_mem_235187_backing_offset_1,\n                                        uint red_arr_mem_235185_backing_offset_2,\n                                        uint red_arr_mem_235183_backing_offset_3,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220426,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_",
            "ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235165,\n                                        int64_t elements_per_thread_235166,\n                                        int64_t virt_num_groups_235167,\n                                        int64_t threads_per_segment_235169,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230784,\n                                        __global unsigned char *mem_230788,\n                                        __global unsigned char *mem_230792,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235170,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235172,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235174,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235176)\n{\n    #define segred_group_sizze_220425 (mainzisegred_group_sizze_220102)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235189_backing_3 =\n                           &shared_mem[sync_arr_mem_235189_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235187_backing_2 =\n                           &shared_mem[red_arr_mem_235187_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235185_backing_1 =\n                           &shared_mem[red_arr_mem_235185_backing_offset_2];\n    volatile unsign",
            "ed char *red_arr_mem_235183_backing_0 =\n                           &shared_mem[red_arr_mem_235183_backing_offset_3];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235178;\n    int32_t local_tid_235179;\n    int64_t group_sizze_235182;\n    int32_t wave_sizze_235181;\n    int32_t group_tid_235180;\n    \n    global_tid_235178 = get_global_id(0);\n    local_tid_235179 = get_local_id(0);\n    group_sizze_235182 = get_local_size(0);\n    wave_sizze_235181 = LOCKSTEP_WIDTH;\n    group_tid_235180 = get_group_id(0);\n    \n    int32_t phys_tid_220434 = global_tid_235178;\n    __local unsigned char *red_arr_mem_235183;\n    \n    red_arr_mem_235183 = (__local unsigned char *) red_arr_mem_235183_backing_0;\n    \n    __local unsigned char *red_arr_mem_235185;\n    \n    red_arr_mem_235185 = (__local unsigned char *) red_arr_mem_235185_backing_1;\n    \n    __local unsigned char *red_arr_mem_235187;\n    \n    red_arr_mem_235187 = (__local unsigned char *) red_arr_mem_235187_backing_2;\n    \n    __local unsigned char *sync_arr_mem_235189;\n    \n    sync_arr_mem_235189 = (__local\n                           unsigned char *) sync_arr_mem_235189_backing_3;\n    \n    int32_t phys_group_id_235191;\n    \n    phys_group_id_235191 = get_group_id(0);\n    for (int32_t i_235192 = 0; i_235192 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235167) - phys_group_id_235191,\n                   sext_i64_i32(num_groups_220426)); i_235192++) {\n        int32_t virt_group_id_235193 = phys_group_id_235191 + i_235192 *\n                sext_i64_i32(num_groups_220426);\n        int32_t flat_segment_id_235194 = squot32(virt_group_id_235193,\n                                                 sext_i64_i32(groups_per_segment_235165));\n        int64_t global_tid_235195 = srem64(sext_i32_i64(virt_group_id_235193) *\n                                           segred_group_sizze_220425 +\n                                           sext_i32_i64(local_tid_235179),\n                                           s",
            "egred_group_sizze_220425 *\n                                           groups_per_segment_235165);\n        int64_t slice_235196 = l_n_m_203733;\n        int64_t slice_235197 = partition_sizze_203667 * slice_235196;\n        int64_t gtid_220431 = squot64(sext_i32_i64(flat_segment_id_235194),\n                                      slice_235196);\n        int64_t remnant_235198 = sext_i32_i64(flat_segment_id_235194) -\n                gtid_220431 * slice_235196;\n        int64_t gtid_220432 = remnant_235198;\n        int64_t remnant_235199 = remnant_235198 - gtid_220432;\n        int64_t gtid_220433;\n        double x_acc_235200;\n        double x_acc_235201;\n        double x_acc_235202;\n        int64_t chunk_sizze_235203 = smin64(elements_per_thread_235166,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235195,\n                                                      threads_per_segment_235169));\n        double x_220435;\n        double x_220436;\n        double x_220437;\n        double x_220438;\n        double x_220439;\n        double x_220440;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235200 = 0.0;\n            x_acc_235201 = 0.0;\n            x_acc_235202 = 0.0;\n        }\n        for (int64_t i_235213 = 0; i_235213 < chunk_sizze_235203; i_235213++) {\n            gtid_220433 = global_tid_235195 + threads_per_segment_235169 *\n                i_235213;\n            // apply map function\n            {\n                int64_t x_220448;\n                \n                x_220448 = ((__global int64_t *) ext_mem_229520)[gtid_220431 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220432];\n                \n                double x_220449;\n                \n                x_220449 = ((__global double *) ext_mem_229519)[gtid_220431 *\n                                    ",
            "                            l_n_m_203733 +\n                                                                gtid_220432];\n                \n                int64_t binop_y_228790 = mul64(jump_t_203582, gtid_220432);\n                int64_t binop_y_228791 = smin64(i_203760, binop_y_228790);\n                int64_t index_primexp_228792 = add64((int64_t) 1,\n                                                     binop_y_228791);\n                bool cond_220452 = sle64(n_203572, gtid_220433);\n                int64_t defunc_0_f_res_220453;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220453 = (int64_t) 0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220433, x_220448);\n                    int64_t defunc_1_add_res_220455 = add64((int64_t) 1,\n                                                            i_220454);\n                    \n                    defunc_0_f_res_220453 = defunc_1_add_res_220455;\n                }\n                \n                double defunc_0_f_res_220456;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220456 = 0.0;\n                } else {\n                    int64_t i_220457 = add64(gtid_220433, x_220448);\n                    double defunc_0_add_arg_220458;\n                    \n                    defunc_0_add_arg_220458 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220431 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220457 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220456 = defunc_0_add_arg_220458;\n                }\n                \n                int64_t binop_p_22045",
            "9 = sub64(defunc_0_f_res_220453,\n                                               index_primexp_228792);\n                double defunc_0_f_res_220460 = sitofp_i64_f64(binop_p_220459);\n                double abs_res_220461 = fabs(defunc_0_f_res_220460);\n                double tmp1_220462 = abs_res_220461 / x_220449;\n                double x_220463 = tmp1_220462 * tmp1_220462;\n                double y_220464 = tmp1_220462 * x_220463;\n                double tmp2_220465 = 1.0 - y_220464;\n                double x_220466 = tmp2_220465 * tmp2_220465;\n                double tmp3_220467 = tmp2_220465 * x_220466;\n                double w_j_220468 = defunc_0_f_res_220456 * tmp3_220467;\n                double xw_j_220469 = defunc_0_f_res_220460 * w_j_220468;\n                double x2w_j_220470 = defunc_0_f_res_220460 * xw_j_220469;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220435 = x_acc_235200;\n                    x_220436 = x_acc_235201;\n                    x_220437 = x_acc_235202;\n                }\n                // load new values\n                {\n                    x_220438 = w_j_220468;\n                    x_220439 = xw_j_220469;\n                    x_220440 = x2w_j_220470;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220441 = x_220435 + x_220438;\n                    double defunc_1_op_res_220442 = x_220436 + x_220439;\n                    double defunc_1_op_res_220443 = x_220437 + x_220440;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235200 = defunc_1_op_res_220441;\n                        x_acc_235201 = defunc_1_op_res_220442;\n                        x_acc_235202 = defunc_1_op_res_220443;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in ",
            "memory\n        {\n            x_220435 = x_acc_235200;\n            x_220436 = x_acc_235201;\n            x_220437 = x_acc_235202;\n            ((__local\n              double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179)] =\n                x_220435;\n            ((__local\n              double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179)] =\n                x_220436;\n            ((__local\n              double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179)] =\n                x_220437;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235214;\n        int32_t skip_waves_235215 = 1;\n        double x_235204;\n        double x_235205;\n        double x_235206;\n        double x_235207;\n        double x_235208;\n        double x_235209;\n        \n        offset_235214 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235179,\n                      sext_i64_i32(segred_group_sizze_220425))) {\n                x_235204 = ((__local\n                             double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179 +\n                                                           offset_235214)];\n                x_235205 = ((__local\n                             double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179 +\n                                                           offset_235214)];\n                x_235206 = ((__local\n                             double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179 +\n                                                           offset_235214)];\n            }\n        }\n        offset_235214 = 1;\n        while (slt32(offset_235214, wave_sizze_235181)) {\n            if (slt32(local_tid_235179 + offset_235214,\n                      sext_i64_i32(segred_group_sizze_220425)) &&\n                ((local_tid_235179 - squot32(local_tid_235179,\n                                             wave_sizze_235181) *\n                  wave_sizze_235181",
            ") & (2 * offset_235214 - 1)) == 0) {\n                // read array element\n                {\n                    x_235207 = ((volatile __local\n                                 double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179 +\n                                                               offset_235214)];\n                    x_235208 = ((volatile __local\n                                 double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179 +\n                                                               offset_235214)];\n                    x_235209 = ((volatile __local\n                                 double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179 +\n                                                               offset_235214)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235210 = x_235204 + x_235207;\n                    double defunc_1_op_res_235211 = x_235205 + x_235208;\n                    double defunc_1_op_res_235212 = x_235206 + x_235209;\n                    \n                    x_235204 = defunc_1_op_res_235210;\n                    x_235205 = defunc_1_op_res_235211;\n                    x_235206 = defunc_1_op_res_235212;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179)] =\n                        x_235204;\n                    ((volatile __local\n                      double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179)] =\n                        x_235205;\n                    ((volatile __local\n                      double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179)] =\n                        x_235206;\n                }\n            }\n            offset_235214 *= 2;\n        }\n        while (slt32(skip_waves_235215,\n                     squot32(sext_i64_i32(segred_group_sizze_220425) +\n   ",
            "                          wave_sizze_235181 - 1, wave_sizze_235181))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235214 = skip_waves_235215 * wave_sizze_235181;\n            if (slt32(local_tid_235179 + offset_235214,\n                      sext_i64_i32(segred_group_sizze_220425)) &&\n                ((local_tid_235179 - squot32(local_tid_235179,\n                                             wave_sizze_235181) *\n                  wave_sizze_235181) == 0 && (squot32(local_tid_235179,\n                                                      wave_sizze_235181) & (2 *\n                                                                            skip_waves_235215 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235207 = ((__local\n                                 double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179 +\n                                                               offset_235214)];\n                    x_235208 = ((__local\n                                 double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179 +\n                                                               offset_235214)];\n                    x_235209 = ((__local\n                                 double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179 +\n                                                               offset_235214)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235210 = x_235204 + x_235207;\n                    double defunc_1_op_res_235211 = x_235205 + x_235208;\n                    double defunc_1_op_res_235212 = x_235206 + x_235209;\n                    \n                    x_235204 = defunc_1_op_res_235210;\n                    x_235205 = defunc_1_op_res_235211;\n                    x_235206 = defunc_1_op_res_235212;\n                }\n      ",
            "          // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179)] =\n                        x_235204;\n                    ((__local\n                      double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179)] =\n                        x_235205;\n                    ((__local\n                      double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179)] =\n                        x_235206;\n                }\n            }\n            skip_waves_235215 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235179) == (int64_t) 0) {\n                x_acc_235200 = x_235204;\n                x_acc_235201 = x_235205;\n                x_acc_235202 = x_235206;\n            }\n        }\n        if (groups_per_segment_235165 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235179 == 0) {\n                    ((__global double *) mem_230784)[gtid_220431 *\n                                                     l_n_m_203733 +\n                                                     gtid_220432] =\n                        x_acc_235200;\n                    ((__global double *) mem_230788)[gtid_220431 *\n                                                     l_n_m_203733 +\n                                                     gtid_220432] =\n                        x_acc_235201;\n                    ((__global double *) mem_230792)[gtid_220431 *\n                                                     l_n_m_203733 +\n                                                     gtid_220432] =\n                        x_acc_235202;\n                }\n            }\n        } else {\n            int32_t old_counter_235216;\n            \n            // first thread in group saves group result to global memory\n            {\n      ",
            "          if (local_tid_235179 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235170)[sext_i32_i64(virt_group_id_235193)] =\n                        x_acc_235200;\n                    ((__global\n                      double *) segred_tmp_mem_235172)[sext_i32_i64(virt_group_id_235193)] =\n                        x_acc_235201;\n                    ((__global\n                      double *) segred_tmp_mem_235174)[sext_i32_i64(virt_group_id_235193)] =\n                        x_acc_235202;\n                    mem_fence_global();\n                    old_counter_235216 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235176)[sext_i32_i64(srem32(flat_segment_id_235194,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235189)[(int64_t) 0] =\n                        old_counter_235216 == groups_per_segment_235165 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235217;\n            \n            is_last_group_235217 = ((__local\n                                     bool *) sync_arr_mem_235189)[(int64_t) 0];\n            if (is_last_group_235217) {\n                if (local_tid_235179 == 0) {\n                    old_counter_235216 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235176)[sext_i32_i64(srem32(flat_segment_id_235194,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per",
            "_segment_235165));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235218 =\n                            sdiv_up64(groups_per_segment_235165,\n                                      segred_group_sizze_220425);\n                    \n                    x_220435 = 0.0;\n                    x_220436 = 0.0;\n                    x_220437 = 0.0;\n                    for (int64_t i_235219 = 0; i_235219 <\n                         read_per_thread_235218; i_235219++) {\n                        int64_t group_res_id_235220 =\n                                sext_i32_i64(local_tid_235179) *\n                                read_per_thread_235218 + i_235219;\n                        int64_t index_of_group_res_235221 =\n                                sext_i32_i64(flat_segment_id_235194) *\n                                groups_per_segment_235165 + group_res_id_235220;\n                        \n                        if (slt64(group_res_id_235220,\n                                  groups_per_segment_235165)) {\n                            x_220438 = ((__global\n                                         double *) segred_tmp_mem_235170)[index_of_group_res_235221];\n                            x_220439 = ((__global\n                                         double *) segred_tmp_mem_235172)[index_of_group_res_235221];\n                            x_220440 = ((__global\n                                         double *) segred_tmp_mem_235174)[index_of_group_res_235221];\n                            \n                            double defunc_1_op_res_220441 = x_220435 + x_220438;\n                            double defunc_1_op_res_220442 = x_220436 + x_220439;\n                            double defunc_1_op_res_220443 = x_220437 + x_220440;\n                            \n                            x_220435 = defunc_1_op_res_220441;\n                            x_220436 = defunc_1_op_res_220442;\n                            x_220437 ",
            "= defunc_1_op_res_220443;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179)] =\n                    x_220435;\n                ((__local\n                  double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179)] =\n                    x_220436;\n                ((__local\n                  double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179)] =\n                    x_220437;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235222;\n                    int32_t skip_waves_235223 = 1;\n                    double x_235204;\n                    double x_235205;\n                    double x_235206;\n                    double x_235207;\n                    double x_235208;\n                    double x_235209;\n                    \n                    offset_235222 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235179,\n                                  sext_i64_i32(segred_group_sizze_220425))) {\n                            x_235204 = ((__local\n                                         double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179 +\n                                                                       offset_235222)];\n                            x_235205 = ((__local\n                                         double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179 +\n                                                                       offset_235222)];\n                            x_235206 = ((__local\n                                         double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179 +\n                                                                       offset_235222)];\n                        }\n                    }\n                ",
            "    offset_235222 = 1;\n                    while (slt32(offset_235222, wave_sizze_235181)) {\n                        if (slt32(local_tid_235179 + offset_235222,\n                                  sext_i64_i32(segred_group_sizze_220425)) &&\n                            ((local_tid_235179 - squot32(local_tid_235179,\n                                                         wave_sizze_235181) *\n                              wave_sizze_235181) & (2 * offset_235222 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235207 = ((volatile __local\n                                             double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179 +\n                                                                           offset_235222)];\n                                x_235208 = ((volatile __local\n                                             double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179 +\n                                                                           offset_235222)];\n                                x_235209 = ((volatile __local\n                                             double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179 +\n                                                                           offset_235222)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235210 = x_235204 +\n                                       x_235207;\n                                double defunc_1_op_res_235211 = x_235205 +\n                                       x_235208;\n                                double defunc_1_op_res_235212 = x_235206 +\n                                       x_235209;\n                                \n                                x_235204 = defunc_1_op_res_235210;\n                                x_235205 = d",
            "efunc_1_op_res_235211;\n                                x_235206 = defunc_1_op_res_235212;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179)] =\n                                    x_235204;\n                                ((volatile __local\n                                  double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179)] =\n                                    x_235205;\n                                ((volatile __local\n                                  double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179)] =\n                                    x_235206;\n                            }\n                        }\n                        offset_235222 *= 2;\n                    }\n                    while (slt32(skip_waves_235223,\n                                 squot32(sext_i64_i32(segred_group_sizze_220425) +\n                                         wave_sizze_235181 - 1,\n                                         wave_sizze_235181))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235222 = skip_waves_235223 * wave_sizze_235181;\n                        if (slt32(local_tid_235179 + offset_235222,\n                                  sext_i64_i32(segred_group_sizze_220425)) &&\n                            ((local_tid_235179 - squot32(local_tid_235179,\n                                                         wave_sizze_235181) *\n                              wave_sizze_235181) == 0 &&\n                             (squot32(local_tid_235179, wave_sizze_235181) &\n                              (2 * skip_waves_235223 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235207 = ((__local\n                                             double *) r",
            "ed_arr_mem_235183)[sext_i32_i64(local_tid_235179 +\n                                                                           offset_235222)];\n                                x_235208 = ((__local\n                                             double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179 +\n                                                                           offset_235222)];\n                                x_235209 = ((__local\n                                             double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179 +\n                                                                           offset_235222)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235210 = x_235204 +\n                                       x_235207;\n                                double defunc_1_op_res_235211 = x_235205 +\n                                       x_235208;\n                                double defunc_1_op_res_235212 = x_235206 +\n                                       x_235209;\n                                \n                                x_235204 = defunc_1_op_res_235210;\n                                x_235205 = defunc_1_op_res_235211;\n                                x_235206 = defunc_1_op_res_235212;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235183)[sext_i32_i64(local_tid_235179)] =\n                                    x_235204;\n                                ((__local\n                                  double *) red_arr_mem_235185)[sext_i32_i64(local_tid_235179)] =\n                                    x_235205;\n                                ((__local\n                                  double *) red_arr_mem_235187)[sext_i32_i64(local_tid_235179)] =\n ",
            "                                   x_235206;\n                            }\n                        }\n                        skip_waves_235223 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235179 == 0) {\n                            ((__global double *) mem_230784)[gtid_220431 *\n                                                             l_n_m_203733 +\n                                                             gtid_220432] =\n                                x_235204;\n                            ((__global double *) mem_230788)[gtid_220431 *\n                                                             l_n_m_203733 +\n                                                             gtid_220432] =\n                                x_235205;\n                            ((__global double *) mem_230792)[gtid_220431 *\n                                                             l_n_m_203733 +\n                                                             gtid_220432] =\n                                x_235206;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220425\n}\n__kernel void mainzisegred_large_220503(__global int *global_failure,\n                                        uint sync_arr_mem_235289_backing_offset_0,\n                                        uint red_arr_mem_235287_backing_offset_1,\n                                        uint red_arr_mem_235285_backing_offset_2,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t n",
            "um_groups_220496,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235269,\n                                        int64_t elements_per_thread_235270,\n                                        int64_t virt_num_groups_235271,\n                                        int64_t threads_per_segment_235273,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230797,\n                                        __global unsigned char *mem_230801,\n                                        __global unsigned char *mem_230805,\n                                        __global unsigned char *mem_230810,\n                                        __global unsigned char *mem_230814,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235274,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235276,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235278)\n{\n    #define segred_group_sizze_220495 (mainzisegred_group_sizze_220008)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235289_backing_2 =\n                           &shared_mem[sync_arr_mem_235289_backing_offset_0];\n    volatile unsigned char *red_arr_mem_2352",
            "87_backing_1 =\n                           &shared_mem[red_arr_mem_235287_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235285_backing_0 =\n                           &shared_mem[red_arr_mem_235285_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235280;\n    int32_t local_tid_235281;\n    int64_t group_sizze_235284;\n    int32_t wave_sizze_235283;\n    int32_t group_tid_235282;\n    \n    global_tid_235280 = get_global_id(0);\n    local_tid_235281 = get_local_id(0);\n    group_sizze_235284 = get_local_size(0);\n    wave_sizze_235283 = LOCKSTEP_WIDTH;\n    group_tid_235282 = get_group_id(0);\n    \n    int32_t phys_tid_220503 = global_tid_235280;\n    __local unsigned char *red_arr_mem_235285;\n    \n    red_arr_mem_235285 = (__local unsigned char *) red_arr_mem_235285_backing_0;\n    \n    __local unsigned char *red_arr_mem_235287;\n    \n    red_arr_mem_235287 = (__local unsigned char *) red_arr_mem_235287_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235289;\n    \n    sync_arr_mem_235289 = (__local\n                           unsigned char *) sync_arr_mem_235289_backing_2;\n    \n    int32_t phys_group_id_235291;\n    \n    phys_group_id_235291 = get_group_id(0);\n    for (int32_t i_235292 = 0; i_235292 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235271) - phys_group_id_235291,\n                   sext_i64_i32(num_groups_220496)); i_235292++) {\n        int32_t virt_group_id_235293 = phys_group_id_235291 + i_235292 *\n                sext_i64_i32(num_groups_220496);\n        int32_t flat_segment_id_235294 = squot32(virt_group_id_235293,\n                                                 sext_i64_i32(groups_per_segment_235269));\n        int64_t global_tid_235295 = srem64(sext_i32_i64(virt_group_id_235293) *\n                                           segred_group_sizze_220495 +\n                                           sext_i32_i64(local_tid_235281),\n                                           segred_group_sizze_220495 *\n",
            "                                           groups_per_segment_235269);\n        int64_t slice_235296 = l_n_m_203733;\n        int64_t slice_235297 = partition_sizze_203667 * slice_235296;\n        int64_t gtid_220500 = squot64(sext_i32_i64(flat_segment_id_235294),\n                                      slice_235296);\n        int64_t remnant_235298 = sext_i32_i64(flat_segment_id_235294) -\n                gtid_220500 * slice_235296;\n        int64_t gtid_220501 = remnant_235298;\n        int64_t remnant_235299 = remnant_235298 - gtid_220501;\n        int64_t gtid_220502;\n        double x_acc_235300;\n        double x_acc_235301;\n        int64_t chunk_sizze_235302 = smin64(elements_per_thread_235270,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235295,\n                                                      threads_per_segment_235273));\n        double x_220504;\n        double x_220505;\n        double x_220506;\n        double x_220507;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235300 = 0.0;\n            x_acc_235301 = 0.0;\n        }\n        for (int64_t i_235309 = 0; i_235309 < chunk_sizze_235302; i_235309++) {\n            gtid_220502 = global_tid_235295 + threads_per_segment_235273 *\n                i_235309;\n            // apply map function\n            {\n                int64_t x_220518;\n                \n                x_220518 = ((__global int64_t *) ext_mem_229520)[gtid_220500 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220501];\n                \n                double x_220519;\n                \n                x_220519 = ((__global double *) ext_mem_229519)[gtid_220500 *\n                                                                l_n_m_203733 +\n                                                                gtid_220501];\n                \n",
            "                int64_t binop_y_228785 = mul64(jump_t_203582, gtid_220501);\n                int64_t binop_y_228786 = smin64(i_203760, binop_y_228785);\n                int64_t index_primexp_228787 = add64((int64_t) 1,\n                                                     binop_y_228786);\n                double a11_220521;\n                \n                a11_220521 = ((__global double *) mem_230797)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double b11_220522;\n                \n                b11_220522 = ((__global double *) mem_230801)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double c11_220523;\n                \n                c11_220523 = ((__global double *) mem_230805)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                bool cond_220525 = sle64(n_203572, gtid_220502);\n                int64_t defunc_0_f_res_220526;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220526 = (int64_t) 0;\n                } else {\n                    int64_t i_220527 = add64(gtid_220502, x_220518);\n                    int64_t defunc_1_add_res_220528 = add64((int64_t) 1,\n                                                            i_220527);\n                    \n                    defunc_0_f_res_220526 = defunc_1_add_res_220528;\n                }\n                \n                double defunc_0_f_res_220529;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220529 = 0.0;\n                } else {\n                    int64_t i_220530 = add64(gtid_220502, x_220",
            "518);\n                    double defunc_0_add_arg_220531;\n                    \n                    defunc_0_add_arg_220531 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220500 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220530 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220529 = defunc_0_add_arg_220531;\n                }\n                \n                int64_t binop_p_220532 = sub64(defunc_0_f_res_220526,\n                                               index_primexp_228787);\n                double defunc_0_f_res_220533 = sitofp_i64_f64(binop_p_220532);\n                double abs_res_220534 = fabs(defunc_0_f_res_220533);\n                double tmp1_220535 = abs_res_220534 / x_220519;\n                double x_220536 = tmp1_220535 * tmp1_220535;\n                double y_220537 = tmp1_220535 * x_220536;\n                double tmp2_220538 = 1.0 - y_220537;\n                double x_220539 = tmp2_220538 * tmp2_220538;\n                double tmp3_220540 = tmp2_220538 * x_220539;\n                double tmp4_220541 = defunc_0_f_res_220529 * tmp3_220540;\n                double defunc_1_f_res_220542 = defunc_0_f_res_220533 *\n                       tmp4_220541;\n                double defunc_0_f_res_220543;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220543 = 0.0;\n                } else {\n                    int64_t i_220544 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220545;\n                    \n                    defunc_0_add_arg_220545 = ((__global\n                                                double *) mem_230659)[gtid_220500 *",
            "\n                                                                      n_203572 +\n                                                                      i_220544];\n                    defunc_0_f_res_220543 = defunc_0_add_arg_220545;\n                }\n                \n                double x_220546 = a11_220521 * tmp4_220541;\n                double y_220547 = b11_220522 * defunc_1_f_res_220542;\n                double x_220548 = x_220546 + y_220547;\n                double defunc_9_fit_fun_res_220549 = defunc_0_f_res_220543 *\n                       x_220548;\n                double x_220550 = b11_220522 * tmp4_220541;\n                double y_220551 = c11_220523 * defunc_1_f_res_220542;\n                double x_220552 = x_220550 + y_220551;\n                double defunc_9_slope_fun_res_220553 = defunc_0_f_res_220543 *\n                       x_220552;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220504 = x_acc_235300;\n                    x_220505 = x_acc_235301;\n                }\n                // load new values\n                {\n                    x_220506 = defunc_9_fit_fun_res_220549;\n                    x_220507 = defunc_9_slope_fun_res_220553;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220508 = x_220504 + x_220506;\n                    double defunc_1_op_res_220509 = x_220505 + x_220507;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235300 = defunc_1_op_res_220508;\n                        x_acc_235301 = defunc_1_op_res_220509;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_220504 = x_acc_235300;\n            x_220505 = x_acc_235301;\n            ((__local\n              double *) red_arr_mem_235285)[sext_",
            "i32_i64(local_tid_235281)] =\n                x_220504;\n            ((__local\n              double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281)] =\n                x_220505;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235310;\n        int32_t skip_waves_235311 = 1;\n        double x_235303;\n        double x_235304;\n        double x_235305;\n        double x_235306;\n        \n        offset_235310 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235281,\n                      sext_i64_i32(segred_group_sizze_220495))) {\n                x_235303 = ((__local\n                             double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281 +\n                                                           offset_235310)];\n                x_235304 = ((__local\n                             double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281 +\n                                                           offset_235310)];\n            }\n        }\n        offset_235310 = 1;\n        while (slt32(offset_235310, wave_sizze_235283)) {\n            if (slt32(local_tid_235281 + offset_235310,\n                      sext_i64_i32(segred_group_sizze_220495)) &&\n                ((local_tid_235281 - squot32(local_tid_235281,\n                                             wave_sizze_235283) *\n                  wave_sizze_235283) & (2 * offset_235310 - 1)) == 0) {\n                // read array element\n                {\n                    x_235305 = ((volatile __local\n                                 double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281 +\n                                                               offset_235310)];\n                    x_235306 = ((volatile __local\n                                 double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281 +\n                                                               offset_235310)];\n                }\n                //",
            " apply reduction operation\n                {\n                    double defunc_1_op_res_235307 = x_235303 + x_235305;\n                    double defunc_1_op_res_235308 = x_235304 + x_235306;\n                    \n                    x_235303 = defunc_1_op_res_235307;\n                    x_235304 = defunc_1_op_res_235308;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281)] =\n                        x_235303;\n                    ((volatile __local\n                      double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281)] =\n                        x_235304;\n                }\n            }\n            offset_235310 *= 2;\n        }\n        while (slt32(skip_waves_235311,\n                     squot32(sext_i64_i32(segred_group_sizze_220495) +\n                             wave_sizze_235283 - 1, wave_sizze_235283))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235310 = skip_waves_235311 * wave_sizze_235283;\n            if (slt32(local_tid_235281 + offset_235310,\n                      sext_i64_i32(segred_group_sizze_220495)) &&\n                ((local_tid_235281 - squot32(local_tid_235281,\n                                             wave_sizze_235283) *\n                  wave_sizze_235283) == 0 && (squot32(local_tid_235281,\n                                                      wave_sizze_235283) & (2 *\n                                                                            skip_waves_235311 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235305 = ((__local\n                                 double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281 +\n                                                               offset_235310)];\n                    x_235306 = ((",
            "__local\n                                 double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281 +\n                                                               offset_235310)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235307 = x_235303 + x_235305;\n                    double defunc_1_op_res_235308 = x_235304 + x_235306;\n                    \n                    x_235303 = defunc_1_op_res_235307;\n                    x_235304 = defunc_1_op_res_235308;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281)] =\n                        x_235303;\n                    ((__local\n                      double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281)] =\n                        x_235304;\n                }\n            }\n            skip_waves_235311 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235281) == (int64_t) 0) {\n                x_acc_235300 = x_235303;\n                x_acc_235301 = x_235304;\n            }\n        }\n        if (groups_per_segment_235269 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235281 == 0) {\n                    ((__global double *) mem_230810)[gtid_220500 *\n                                                     l_n_m_203733 +\n                                                     gtid_220501] =\n                        x_acc_235300;\n                    ((__global double *) mem_230814)[gtid_220500 *\n                                                     l_n_m_203733 +\n                                                     gtid_220501] =\n                        x_acc_235301;\n                }\n            }\n        } else {\n            i",
            "nt32_t old_counter_235312;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235281 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235274)[sext_i32_i64(virt_group_id_235293)] =\n                        x_acc_235300;\n                    ((__global\n                      double *) segred_tmp_mem_235276)[sext_i32_i64(virt_group_id_235293)] =\n                        x_acc_235301;\n                    mem_fence_global();\n                    old_counter_235312 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235278)[sext_i32_i64(srem32(flat_segment_id_235294,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235289)[(int64_t) 0] =\n                        old_counter_235312 == groups_per_segment_235269 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235313;\n            \n            is_last_group_235313 = ((__local\n                                     bool *) sync_arr_mem_235289)[(int64_t) 0];\n            if (is_last_group_235313) {\n                if (local_tid_235281 == 0) {\n                    old_counter_235312 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235278)[sext_i32_i64(srem32(flat_segment_id_235294,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235269));\n          ",
            "      }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235314 =\n                            sdiv_up64(groups_per_segment_235269,\n                                      segred_group_sizze_220495);\n                    \n                    x_220504 = 0.0;\n                    x_220505 = 0.0;\n                    for (int64_t i_235315 = 0; i_235315 <\n                         read_per_thread_235314; i_235315++) {\n                        int64_t group_res_id_235316 =\n                                sext_i32_i64(local_tid_235281) *\n                                read_per_thread_235314 + i_235315;\n                        int64_t index_of_group_res_235317 =\n                                sext_i32_i64(flat_segment_id_235294) *\n                                groups_per_segment_235269 + group_res_id_235316;\n                        \n                        if (slt64(group_res_id_235316,\n                                  groups_per_segment_235269)) {\n                            x_220506 = ((__global\n                                         double *) segred_tmp_mem_235274)[index_of_group_res_235317];\n                            x_220507 = ((__global\n                                         double *) segred_tmp_mem_235276)[index_of_group_res_235317];\n                            \n                            double defunc_1_op_res_220508 = x_220504 + x_220506;\n                            double defunc_1_op_res_220509 = x_220505 + x_220507;\n                            \n                            x_220504 = defunc_1_op_res_220508;\n                            x_220505 = defunc_1_op_res_220509;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281)] =\n                    x_220504;\n                ((__local\n                  double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281)] =\n                    x_2",
            "20505;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235318;\n                    int32_t skip_waves_235319 = 1;\n                    double x_235303;\n                    double x_235304;\n                    double x_235305;\n                    double x_235306;\n                    \n                    offset_235318 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235281,\n                                  sext_i64_i32(segred_group_sizze_220495))) {\n                            x_235303 = ((__local\n                                         double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281 +\n                                                                       offset_235318)];\n                            x_235304 = ((__local\n                                         double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281 +\n                                                                       offset_235318)];\n                        }\n                    }\n                    offset_235318 = 1;\n                    while (slt32(offset_235318, wave_sizze_235283)) {\n                        if (slt32(local_tid_235281 + offset_235318,\n                                  sext_i64_i32(segred_group_sizze_220495)) &&\n                            ((local_tid_235281 - squot32(local_tid_235281,\n                                                         wave_sizze_235283) *\n                              wave_sizze_235283) & (2 * offset_235318 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235305 = ((volatile __local\n                                             double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281 +\n                                                            ",
            "               offset_235318)];\n                                x_235306 = ((volatile __local\n                                             double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281 +\n                                                                           offset_235318)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235307 = x_235303 +\n                                       x_235305;\n                                double defunc_1_op_res_235308 = x_235304 +\n                                       x_235306;\n                                \n                                x_235303 = defunc_1_op_res_235307;\n                                x_235304 = defunc_1_op_res_235308;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281)] =\n                                    x_235303;\n                                ((volatile __local\n                                  double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281)] =\n                                    x_235304;\n                            }\n                        }\n                        offset_235318 *= 2;\n                    }\n                    while (slt32(skip_waves_235319,\n                                 squot32(sext_i64_i32(segred_group_sizze_220495) +\n                                         wave_sizze_235283 - 1,\n                                         wave_sizze_235283))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235318 = skip_waves_235319 * wave_sizze_235283;\n                        if (slt32(local_tid_235281 + offset_235318,\n                                  sext_i64_i32(segred_group_sizze_220495)) &&\n    ",
            "                        ((local_tid_235281 - squot32(local_tid_235281,\n                                                         wave_sizze_235283) *\n                              wave_sizze_235283) == 0 &&\n                             (squot32(local_tid_235281, wave_sizze_235283) &\n                              (2 * skip_waves_235319 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235305 = ((__local\n                                             double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281 +\n                                                                           offset_235318)];\n                                x_235306 = ((__local\n                                             double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281 +\n                                                                           offset_235318)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235307 = x_235303 +\n                                       x_235305;\n                                double defunc_1_op_res_235308 = x_235304 +\n                                       x_235306;\n                                \n                                x_235303 = defunc_1_op_res_235307;\n                                x_235304 = defunc_1_op_res_235308;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235281)] =\n                                    x_235303;\n                                ((__local\n                                  double *) red_arr_mem_235287)[sext_i32_i64(local_tid_235281)] =\n                                    x_235304;\n                            }\n              ",
            "          }\n                        skip_waves_235319 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235281 == 0) {\n                            ((__global double *) mem_230810)[gtid_220500 *\n                                                             l_n_m_203733 +\n                                                             gtid_220501] =\n                                x_235303;\n                            ((__global double *) mem_230814)[gtid_220500 *\n                                                             l_n_m_203733 +\n                                                             gtid_220501] =\n                                x_235304;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220495\n}\n__kernel void mainzisegred_large_221513(__global int *global_failure,\n                                        uint sync_arr_mem_235463_backing_offset_0,\n                                        uint red_arr_mem_235461_backing_offset_1,\n                                        uint red_arr_mem_235459_backing_offset_2,\n                                        uint red_arr_mem_235457_backing_offset_3,\n                                        uint red_arr_mem_235455_backing_offset_4,\n                                        uint red_arr_mem_235453_backing_offset_5,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221503,\n                                        int64_t ctx_param_ext_229596,\n                        ",
            "                int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235431,\n                                        int64_t elements_per_thread_235432,\n                                        int64_t virt_num_groups_235433,\n                                        int64_t threads_per_segment_235435,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230891,\n                                        __global unsigned char *mem_230895,\n                                        __global unsigned char *mem_230899,\n                                        __global unsigned char *mem_230903,\n                                        __global unsigned char *mem_230907,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235436,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235438,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235440,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235442,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235444,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235446)\n{\n    #define segred_group_sizze_221502 (mainzisegred_group_sizze_221099)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block",
            "_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235463_backing_5 =\n                           &shared_mem[sync_arr_mem_235463_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235461_backing_4 =\n                           &shared_mem[red_arr_mem_235461_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235459_backing_3 =\n                           &shared_mem[red_arr_mem_235459_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235457_backing_2 =\n                           &shared_mem[red_arr_mem_235457_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235455_backing_1 =\n                           &shared_mem[red_arr_mem_235455_backing_offset_4];\n    volatile unsigned char *red_arr_mem_235453_backing_0 =\n                           &shared_mem[red_arr_mem_235453_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235448;\n    int32_t local_tid_235449;\n    int64_t group_sizze_235452;\n    int32_t wave_sizze_235451;\n    int32_t group_tid_235450;\n    \n    global_tid_235448 = get_global_id(0);\n    local_tid_235449 = get_local_id(0);\n    group_sizze_235452 = get_local_size(0);\n    wave_sizze_235451 = LOCKSTEP_WIDTH;\n    group_tid_235450 = get_group_id(0);\n    \n    int32_t phys_tid_221513 = global_tid_235448;\n    __local unsigned char *red_arr_mem_235453;\n    \n    red_arr_mem_235453 = (__local unsigned char *) red_arr_mem_235453_backing_0;\n    \n    __local unsigned char *red_arr_mem_235455;\n    \n    red_arr_mem_235455 = (__local unsigned char *) red_arr_mem_235455_backing_1;\n    \n    __local unsigned char *red_arr_mem_235457;\n    \n    red_arr_mem_235457 = (__local unsigned char *) red_arr_mem_235457_backing_2;\n    \n    __local unsigned char *red_arr_mem_235459;\n    \n    red_arr_mem_235459 = (__local unsigned char *) red_arr_mem_235459_backing_3;\n    \n    __local unsigned char *red_arr_mem_235461;\n    \n    red_arr_mem_235461 = (__local unsigned char *) red_arr_mem_235461_backing_4;\n    \n    __",
            "local unsigned char *sync_arr_mem_235463;\n    \n    sync_arr_mem_235463 = (__local\n                           unsigned char *) sync_arr_mem_235463_backing_5;\n    \n    int32_t phys_group_id_235465;\n    \n    phys_group_id_235465 = get_group_id(0);\n    for (int32_t i_235466 = 0; i_235466 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235433) - phys_group_id_235465,\n                   sext_i64_i32(num_groups_221503)); i_235466++) {\n        int32_t virt_group_id_235467 = phys_group_id_235465 + i_235466 *\n                sext_i64_i32(num_groups_221503);\n        int32_t flat_segment_id_235468 = squot32(virt_group_id_235467,\n                                                 sext_i64_i32(groups_per_segment_235431));\n        int64_t global_tid_235469 = srem64(sext_i32_i64(virt_group_id_235467) *\n                                           segred_group_sizze_221502 +\n                                           sext_i32_i64(local_tid_235449),\n                                           segred_group_sizze_221502 *\n                                           groups_per_segment_235431);\n        int64_t slice_235470 = l_n_m_203733;\n        int64_t slice_235471 = partition_sizze_203667 * slice_235470;\n        int64_t gtid_221510 = squot64(sext_i32_i64(flat_segment_id_235468),\n                                      slice_235470);\n        int64_t remnant_235472 = sext_i32_i64(flat_segment_id_235468) -\n                gtid_221510 * slice_235470;\n        int64_t gtid_221511 = remnant_235472;\n        int64_t remnant_235473 = remnant_235472 - gtid_221511;\n        int64_t gtid_221512;\n        double x_acc_235474;\n        double x_acc_235475;\n        double x_acc_235476;\n        double x_acc_235477;\n        double x_acc_235478;\n        int64_t chunk_sizze_235479 = smin64(elements_per_thread_235432,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235469,\n                                                      threa",
            "ds_per_segment_235435));\n        double x_221514;\n        double x_221515;\n        double x_221516;\n        double x_221517;\n        double x_221518;\n        double x_221519;\n        double x_221520;\n        double x_221521;\n        double x_221522;\n        double x_221523;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235474 = 0.0;\n            x_acc_235475 = 0.0;\n            x_acc_235476 = 0.0;\n            x_acc_235477 = 0.0;\n            x_acc_235478 = 0.0;\n        }\n        for (int64_t i_235495 = 0; i_235495 < chunk_sizze_235479; i_235495++) {\n            gtid_221512 = global_tid_235469 + threads_per_segment_235435 *\n                i_235495;\n            // apply map function\n            {\n                int64_t x_221533;\n                \n                x_221533 = ((__global int64_t *) ext_mem_229520)[gtid_221510 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_221511];\n                \n                double x_221534;\n                \n                x_221534 = ((__global double *) ext_mem_229519)[gtid_221510 *\n                                                                l_n_m_203733 +\n                                                                gtid_221511];\n                \n                int64_t binop_y_228800 = mul64(jump_t_203582, gtid_221511);\n                int64_t binop_y_228801 = smin64(i_203760, binop_y_228800);\n                int64_t index_primexp_228802 = add64((int64_t) 1,\n                                                     binop_y_228801);\n                bool cond_221537 = sle64(n_203572, gtid_221512);\n                int64_t defunc_0_f_res_221538;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221538 = (int64_t) 0;\n                } else {\n                    int64_t i_221539 = add64(gtid_221512, x_221533);\n                    int64_t defunc_1_add_res_22154",
            "0 = add64((int64_t) 1,\n                                                            i_221539);\n                    \n                    defunc_0_f_res_221538 = defunc_1_add_res_221540;\n                }\n                \n                double defunc_0_f_res_221541;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221541 = 0.0;\n                } else {\n                    int64_t i_221542 = add64(gtid_221512, x_221533);\n                    double defunc_0_add_arg_221543;\n                    \n                    defunc_0_add_arg_221543 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221510 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221542 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221541 = defunc_0_add_arg_221543;\n                }\n                \n                int64_t binop_p_221544 = sub64(defunc_0_f_res_221538,\n                                               index_primexp_228802);\n                double defunc_0_f_res_221545 = sitofp_i64_f64(binop_p_221544);\n                double abs_res_221546 = fabs(defunc_0_f_res_221545);\n                double tmp1_221547 = abs_res_221546 / x_221534;\n                double x_221548 = tmp1_221547 * tmp1_221547;\n                double y_221549 = tmp1_221547 * x_221548;\n                double tmp2_221550 = 1.0 - y_221549;\n                double x_221551 = tmp2_221550 * tmp2_221550;\n                double tmp3_221552 = tmp2_221550 * x_221551;\n                double w_j_221553 = defunc_0_f_res_221541 * tmp3_221552;\n                double xw_j_221554 = defunc_0_f_res_221545 * w_j_221553;\n                double x2w_j_221555",
            " = defunc_0_f_res_221545 * xw_j_221554;\n                double x3w_j_221556 = defunc_0_f_res_221545 * x2w_j_221555;\n                double x4w_j_221557 = defunc_0_f_res_221545 * x3w_j_221556;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221514 = x_acc_235474;\n                    x_221515 = x_acc_235475;\n                    x_221516 = x_acc_235476;\n                    x_221517 = x_acc_235477;\n                    x_221518 = x_acc_235478;\n                }\n                // load new values\n                {\n                    x_221519 = w_j_221553;\n                    x_221520 = xw_j_221554;\n                    x_221521 = x2w_j_221555;\n                    x_221522 = x3w_j_221556;\n                    x_221523 = x4w_j_221557;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221524 = x_221514 + x_221519;\n                    double defunc_1_op_res_221525 = x_221515 + x_221520;\n                    double defunc_1_op_res_221526 = x_221516 + x_221521;\n                    double defunc_1_op_res_221527 = x_221517 + x_221522;\n                    double defunc_1_op_res_221528 = x_221518 + x_221523;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235474 = defunc_1_op_res_221524;\n                        x_acc_235475 = defunc_1_op_res_221525;\n                        x_acc_235476 = defunc_1_op_res_221526;\n                        x_acc_235477 = defunc_1_op_res_221527;\n                        x_acc_235478 = defunc_1_op_res_221528;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221514 = x_acc_235474;\n            x_221515 = x_acc_235475;\n            x_221516 = x_acc_235476;\n            x_221517 = x_acc_235477;\n            x_221518 ",
            "= x_acc_235478;\n            ((__local\n              double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449)] =\n                x_221514;\n            ((__local\n              double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449)] =\n                x_221515;\n            ((__local\n              double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449)] =\n                x_221516;\n            ((__local\n              double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449)] =\n                x_221517;\n            ((__local\n              double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449)] =\n                x_221518;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235496;\n        int32_t skip_waves_235497 = 1;\n        double x_235480;\n        double x_235481;\n        double x_235482;\n        double x_235483;\n        double x_235484;\n        double x_235485;\n        double x_235486;\n        double x_235487;\n        double x_235488;\n        double x_235489;\n        \n        offset_235496 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235449,\n                      sext_i64_i32(segred_group_sizze_221502))) {\n                x_235480 = ((__local\n                             double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449 +\n                                                           offset_235496)];\n                x_235481 = ((__local\n                             double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449 +\n                                                           offset_235496)];\n                x_235482 = ((__local\n                             double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449 +\n                                                           offset_235496)];\n                x_235483 = ((__local\n                             double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449 +\n                           ",
            "                                offset_235496)];\n                x_235484 = ((__local\n                             double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449 +\n                                                           offset_235496)];\n            }\n        }\n        offset_235496 = 1;\n        while (slt32(offset_235496, wave_sizze_235451)) {\n            if (slt32(local_tid_235449 + offset_235496,\n                      sext_i64_i32(segred_group_sizze_221502)) &&\n                ((local_tid_235449 - squot32(local_tid_235449,\n                                             wave_sizze_235451) *\n                  wave_sizze_235451) & (2 * offset_235496 - 1)) == 0) {\n                // read array element\n                {\n                    x_235485 = ((volatile __local\n                                 double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235486 = ((volatile __local\n                                 double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235487 = ((volatile __local\n                                 double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235488 = ((volatile __local\n                                 double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235489 = ((volatile __local\n                                 double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235490 = x",
            "_235480 + x_235485;\n                    double defunc_1_op_res_235491 = x_235481 + x_235486;\n                    double defunc_1_op_res_235492 = x_235482 + x_235487;\n                    double defunc_1_op_res_235493 = x_235483 + x_235488;\n                    double defunc_1_op_res_235494 = x_235484 + x_235489;\n                    \n                    x_235480 = defunc_1_op_res_235490;\n                    x_235481 = defunc_1_op_res_235491;\n                    x_235482 = defunc_1_op_res_235492;\n                    x_235483 = defunc_1_op_res_235493;\n                    x_235484 = defunc_1_op_res_235494;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449)] =\n                        x_235480;\n                    ((volatile __local\n                      double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449)] =\n                        x_235481;\n                    ((volatile __local\n                      double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449)] =\n                        x_235482;\n                    ((volatile __local\n                      double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449)] =\n                        x_235483;\n                    ((volatile __local\n                      double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449)] =\n                        x_235484;\n                }\n            }\n            offset_235496 *= 2;\n        }\n        while (slt32(skip_waves_235497,\n                     squot32(sext_i64_i32(segred_group_sizze_221502) +\n                             wave_sizze_235451 - 1, wave_sizze_235451))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235496 = skip_waves_235497 * wave_sizze_235451;\n            if (slt32(local_tid_235449 + offset_235496,\n                      sext_i64_i32(segred_group_sizze_221502)) &&\n                ((local_t",
            "id_235449 - squot32(local_tid_235449,\n                                             wave_sizze_235451) *\n                  wave_sizze_235451) == 0 && (squot32(local_tid_235449,\n                                                      wave_sizze_235451) & (2 *\n                                                                            skip_waves_235497 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235485 = ((__local\n                                 double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235486 = ((__local\n                                 double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235487 = ((__local\n                                 double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235488 = ((__local\n                                 double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                    x_235489 = ((__local\n                                 double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449 +\n                                                               offset_235496)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235490 = x_235480 + x_235485;\n                    double defunc_1_op_res_235491 = x_235481 + x_235486;\n                    double defunc_1_op_res_235492 = x_235482 + x_235487;\n                    double defunc_1_op_res_235493 = x_235483 + x_235488;\n                    double defunc",
            "_1_op_res_235494 = x_235484 + x_235489;\n                    \n                    x_235480 = defunc_1_op_res_235490;\n                    x_235481 = defunc_1_op_res_235491;\n                    x_235482 = defunc_1_op_res_235492;\n                    x_235483 = defunc_1_op_res_235493;\n                    x_235484 = defunc_1_op_res_235494;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449)] =\n                        x_235480;\n                    ((__local\n                      double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449)] =\n                        x_235481;\n                    ((__local\n                      double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449)] =\n                        x_235482;\n                    ((__local\n                      double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449)] =\n                        x_235483;\n                    ((__local\n                      double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449)] =\n                        x_235484;\n                }\n            }\n            skip_waves_235497 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235449) == (int64_t) 0) {\n                x_acc_235474 = x_235480;\n                x_acc_235475 = x_235481;\n                x_acc_235476 = x_235482;\n                x_acc_235477 = x_235483;\n                x_acc_235478 = x_235484;\n            }\n        }\n        if (groups_per_segment_235431 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235449 == 0) {\n                    ((__global double *) mem_230891)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                         ",
            "            gtid_221511] =\n                        x_acc_235474;\n                    ((__global double *) mem_230895)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235475;\n                    ((__global double *) mem_230899)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235476;\n                    ((__global double *) mem_230903)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235477;\n                    ((__global double *) mem_230907)[gtid_221510 *\n                                                     l_n_m_203733 +\n                                                     gtid_221511] =\n                        x_acc_235478;\n                }\n            }\n        } else {\n            int32_t old_counter_235498;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235449 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235436)[sext_i32_i64(virt_group_id_235467)] =\n                        x_acc_235474;\n                    ((__global\n                      double *) segred_tmp_mem_235438)[sext_i32_i64(virt_group_id_235467)] =\n                        x_acc_235475;\n                    ((__global\n                      double *) segred_tmp_mem_235440)[sext_i32_i64(virt_group_id_235467)] =\n                        x_acc_235476;\n                    ((__global\n                      double *) segred_tmp_mem_235442)[sext_i32_i64(virt_group_id_235467)] =\n                        x_acc_235477;\n                    ((__global\n                      double *) segred_tmp_mem_235444)[sex",
            "t_i32_i64(virt_group_id_235467)] =\n                        x_acc_235478;\n                    mem_fence_global();\n                    old_counter_235498 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235446)[sext_i32_i64(srem32(flat_segment_id_235468,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235463)[(int64_t) 0] =\n                        old_counter_235498 == groups_per_segment_235431 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235499;\n            \n            is_last_group_235499 = ((__local\n                                     bool *) sync_arr_mem_235463)[(int64_t) 0];\n            if (is_last_group_235499) {\n                if (local_tid_235449 == 0) {\n                    old_counter_235498 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235446)[sext_i32_i64(srem32(flat_segment_id_235468,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235431));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235500 =\n                            sdiv_up64(groups_per_segment_235431,\n                                      segred_group_sizze_221502);\n                    \n                    x_221514 = 0.0;\n                    x_221515 = 0.0;\n                    x_221516 = 0.0;\n                    x_221517 = 0.0;",
            "\n                    x_221518 = 0.0;\n                    for (int64_t i_235501 = 0; i_235501 <\n                         read_per_thread_235500; i_235501++) {\n                        int64_t group_res_id_235502 =\n                                sext_i32_i64(local_tid_235449) *\n                                read_per_thread_235500 + i_235501;\n                        int64_t index_of_group_res_235503 =\n                                sext_i32_i64(flat_segment_id_235468) *\n                                groups_per_segment_235431 + group_res_id_235502;\n                        \n                        if (slt64(group_res_id_235502,\n                                  groups_per_segment_235431)) {\n                            x_221519 = ((__global\n                                         double *) segred_tmp_mem_235436)[index_of_group_res_235503];\n                            x_221520 = ((__global\n                                         double *) segred_tmp_mem_235438)[index_of_group_res_235503];\n                            x_221521 = ((__global\n                                         double *) segred_tmp_mem_235440)[index_of_group_res_235503];\n                            x_221522 = ((__global\n                                         double *) segred_tmp_mem_235442)[index_of_group_res_235503];\n                            x_221523 = ((__global\n                                         double *) segred_tmp_mem_235444)[index_of_group_res_235503];\n                            \n                            double defunc_1_op_res_221524 = x_221514 + x_221519;\n                            double defunc_1_op_res_221525 = x_221515 + x_221520;\n                            double defunc_1_op_res_221526 = x_221516 + x_221521;\n                            double defunc_1_op_res_221527 = x_221517 + x_221522;\n                            double defunc_1_op_res_221528 = x_221518 + x_221523;\n                            \n                            x_221514 = defunc_1_op_res_221524;\n              ",
            "              x_221515 = defunc_1_op_res_221525;\n                            x_221516 = defunc_1_op_res_221526;\n                            x_221517 = defunc_1_op_res_221527;\n                            x_221518 = defunc_1_op_res_221528;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449)] =\n                    x_221514;\n                ((__local\n                  double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449)] =\n                    x_221515;\n                ((__local\n                  double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449)] =\n                    x_221516;\n                ((__local\n                  double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449)] =\n                    x_221517;\n                ((__local\n                  double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449)] =\n                    x_221518;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235504;\n                    int32_t skip_waves_235505 = 1;\n                    double x_235480;\n                    double x_235481;\n                    double x_235482;\n                    double x_235483;\n                    double x_235484;\n                    double x_235485;\n                    double x_235486;\n                    double x_235487;\n                    double x_235488;\n                    double x_235489;\n                    \n                    offset_235504 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235449,\n                                  sext_i64_i32(segred_group_sizze_221502))) {\n                            x_235480 = ((__local\n                                         double *) red_arr_mem_235453)[sext_i32_i64(local_tid_23544",
            "9 +\n                                                                       offset_235504)];\n                            x_235481 = ((__local\n                                         double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449 +\n                                                                       offset_235504)];\n                            x_235482 = ((__local\n                                         double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449 +\n                                                                       offset_235504)];\n                            x_235483 = ((__local\n                                         double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449 +\n                                                                       offset_235504)];\n                            x_235484 = ((__local\n                                         double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449 +\n                                                                       offset_235504)];\n                        }\n                    }\n                    offset_235504 = 1;\n                    while (slt32(offset_235504, wave_sizze_235451)) {\n                        if (slt32(local_tid_235449 + offset_235504,\n                                  sext_i64_i32(segred_group_sizze_221502)) &&\n                            ((local_tid_235449 - squot32(local_tid_235449,\n                                                         wave_sizze_235451) *\n                              wave_sizze_235451) & (2 * offset_235504 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235485 = ((volatile __local\n                                             double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_23548",
            "6 = ((volatile __local\n                                             double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235487 = ((volatile __local\n                                             double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235488 = ((volatile __local\n                                             double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235489 = ((volatile __local\n                                             double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235490 = x_235480 +\n                                       x_235485;\n                                double defunc_1_op_res_235491 = x_235481 +\n                                       x_235486;\n                                double defunc_1_op_res_235492 = x_235482 +\n                                       x_235487;\n                                double defunc_1_op_res_235493 = x_235483 +\n                                       x_235488;\n                                double defunc_1_op_res_235494 = x_235484 +\n                                       x_235489;\n                                \n                                x_235480 = defunc_1_op_res_235490;\n                                x_235481 = defunc_1_op_res_235491;\n                                x_235482 = defunc_1_op_res_235492;\n                        ",
            "        x_235483 = defunc_1_op_res_235493;\n                                x_235484 = defunc_1_op_res_235494;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449)] =\n                                    x_235480;\n                                ((volatile __local\n                                  double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449)] =\n                                    x_235481;\n                                ((volatile __local\n                                  double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449)] =\n                                    x_235482;\n                                ((volatile __local\n                                  double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449)] =\n                                    x_235483;\n                                ((volatile __local\n                                  double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449)] =\n                                    x_235484;\n                            }\n                        }\n                        offset_235504 *= 2;\n                    }\n                    while (slt32(skip_waves_235505,\n                                 squot32(sext_i64_i32(segred_group_sizze_221502) +\n                                         wave_sizze_235451 - 1,\n                                         wave_sizze_235451))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235504 = skip_waves_235505 * wave_sizze_235451;\n                        if (slt32(local_tid_235449 + offset_235504,\n                                  sext_i64_i32(segred_group_sizze_221502)) &&\n                            ((local_tid_235449 - squot32(local_tid_235449,\n                                                         wa",
            "ve_sizze_235451) *\n                              wave_sizze_235451) == 0 &&\n                             (squot32(local_tid_235449, wave_sizze_235451) &\n                              (2 * skip_waves_235505 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235485 = ((__local\n                                             double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235486 = ((__local\n                                             double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235487 = ((__local\n                                             double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235488 = ((__local\n                                             double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                                x_235489 = ((__local\n                                             double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449 +\n                                                                           offset_235504)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235490 = x_235480 +\n                                       x_235485;\n                                double defunc_1_op_res_235491 = x_235481 +\n                                       x_235486;\n                                double defunc_1_op_res_235492 = x_235482 +",
            "\n                                       x_235487;\n                                double defunc_1_op_res_235493 = x_235483 +\n                                       x_235488;\n                                double defunc_1_op_res_235494 = x_235484 +\n                                       x_235489;\n                                \n                                x_235480 = defunc_1_op_res_235490;\n                                x_235481 = defunc_1_op_res_235491;\n                                x_235482 = defunc_1_op_res_235492;\n                                x_235483 = defunc_1_op_res_235493;\n                                x_235484 = defunc_1_op_res_235494;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235453)[sext_i32_i64(local_tid_235449)] =\n                                    x_235480;\n                                ((__local\n                                  double *) red_arr_mem_235455)[sext_i32_i64(local_tid_235449)] =\n                                    x_235481;\n                                ((__local\n                                  double *) red_arr_mem_235457)[sext_i32_i64(local_tid_235449)] =\n                                    x_235482;\n                                ((__local\n                                  double *) red_arr_mem_235459)[sext_i32_i64(local_tid_235449)] =\n                                    x_235483;\n                                ((__local\n                                  double *) red_arr_mem_235461)[sext_i32_i64(local_tid_235449)] =\n                                    x_235484;\n                            }\n                        }\n                        skip_waves_235505 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235449 == 0) {\n                      ",
            "      ((__global double *) mem_230891)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235480;\n                            ((__global double *) mem_230895)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235481;\n                            ((__global double *) mem_230899)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235482;\n                            ((__global double *) mem_230903)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235483;\n                            ((__global double *) mem_230907)[gtid_221510 *\n                                                             l_n_m_203733 +\n                                                             gtid_221511] =\n                                x_235484;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221502\n}\n__kernel void mainzisegred_large_221611(__global int *global_failure,\n                                        uint sync_arr_mem_235571_backing_offset_0,\n                                        uint red_arr_mem_235569_backing_offset_1,\n                                        uint red_arr_mem_235567_backing_offset_2,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203",
            "582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221604,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t groups_per_segment_235551,\n                                        int64_t elements_per_thread_235552,\n                                        int64_t virt_num_groups_235553,\n                                        int64_t threads_per_segment_235555,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230912,\n                                        __global unsigned char *mem_230916,\n                                        __global unsigned char *mem_230920,\n                                        __global unsigned char *mem_230924,\n                                        __global unsigned char *mem_230928,\n                                        __global unsigned char *mem_230933,\n                                        __global unsigned char *mem_230937,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235556,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235558,\n                                        __global\n                                        unsigned char *mainzicounter_mem_2",
            "35560)\n{\n    #define segred_group_sizze_221603 (mainzisegred_group_sizze_220973)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235571_backing_2 =\n                           &shared_mem[sync_arr_mem_235571_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235569_backing_1 =\n                           &shared_mem[red_arr_mem_235569_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235567_backing_0 =\n                           &shared_mem[red_arr_mem_235567_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235562;\n    int32_t local_tid_235563;\n    int64_t group_sizze_235566;\n    int32_t wave_sizze_235565;\n    int32_t group_tid_235564;\n    \n    global_tid_235562 = get_global_id(0);\n    local_tid_235563 = get_local_id(0);\n    group_sizze_235566 = get_local_size(0);\n    wave_sizze_235565 = LOCKSTEP_WIDTH;\n    group_tid_235564 = get_group_id(0);\n    \n    int32_t phys_tid_221611 = global_tid_235562;\n    __local unsigned char *red_arr_mem_235567;\n    \n    red_arr_mem_235567 = (__local unsigned char *) red_arr_mem_235567_backing_0;\n    \n    __local unsigned char *red_arr_mem_235569;\n    \n    red_arr_mem_235569 = (__local unsigned char *) red_arr_mem_235569_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235571;\n    \n    sync_arr_mem_235571 = (__local\n                           unsigned char *) sync_arr_mem_235571_backing_2;\n    \n    int32_t phys_group_id_235573;\n    \n    phys_group_id_235573 = get_group_id(0);\n    for (int32_t i_235574 = 0; i_235574 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235553) - phys_group_id_235573,\n                   sext_i64_i32(num_groups_221604)); i_235574++) {\n        int32_t virt_group_id_235575 = phys_group_id_235573 + i_235574 *\n                sext_i64_i32(num_groups_221604);\n        int32_t flat_segment_id_235576 = squot32(virt_group_id_235575,\n                              ",
            "                   sext_i64_i32(groups_per_segment_235551));\n        int64_t global_tid_235577 = srem64(sext_i32_i64(virt_group_id_235575) *\n                                           segred_group_sizze_221603 +\n                                           sext_i32_i64(local_tid_235563),\n                                           segred_group_sizze_221603 *\n                                           groups_per_segment_235551);\n        int64_t slice_235578 = l_n_m_203733;\n        int64_t slice_235579 = partition_sizze_203667 * slice_235578;\n        int64_t gtid_221608 = squot64(sext_i32_i64(flat_segment_id_235576),\n                                      slice_235578);\n        int64_t remnant_235580 = sext_i32_i64(flat_segment_id_235576) -\n                gtid_221608 * slice_235578;\n        int64_t gtid_221609 = remnant_235580;\n        int64_t remnant_235581 = remnant_235580 - gtid_221609;\n        int64_t gtid_221610;\n        double x_acc_235582;\n        double x_acc_235583;\n        int64_t chunk_sizze_235584 = smin64(elements_per_thread_235552,\n                                            sdiv_up64(q_l_203577 -\n                                                      global_tid_235577,\n                                                      threads_per_segment_235555));\n        double x_221612;\n        double x_221613;\n        double x_221614;\n        double x_221615;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235582 = 0.0;\n            x_acc_235583 = 0.0;\n        }\n        for (int64_t i_235591 = 0; i_235591 < chunk_sizze_235584; i_235591++) {\n            gtid_221610 = global_tid_235577 + threads_per_segment_235555 *\n                i_235591;\n            // apply map function\n            {\n                int64_t x_221628;\n                \n                x_221628 = ((__global int64_t *) ext_mem_229520)[gtid_221608 *\n                                                                 l_n_m_203733 +\n                                        ",
            "                         gtid_221609];\n                \n                double x_221629;\n                \n                x_221629 = ((__global double *) ext_mem_229519)[gtid_221608 *\n                                                                l_n_m_203733 +\n                                                                gtid_221609];\n                \n                int64_t binop_y_228795 = mul64(jump_t_203582, gtid_221609);\n                int64_t binop_y_228796 = smin64(i_203760, binop_y_228795);\n                int64_t index_primexp_228797 = add64((int64_t) 1,\n                                                     binop_y_228796);\n                double a12_221631;\n                \n                a12_221631 = ((__global double *) mem_230912)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b12_221632;\n                \n                b12_221632 = ((__global double *) mem_230916)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double c12_221633;\n                \n                c12_221633 = ((__global double *) mem_230920)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b2_221634;\n                \n                b2_221634 = ((__global double *) mem_230924)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n                \n                double c2_221635;\n                \n                c2_221635 = ((__global double *) mem_230928)[gtid_221608 *\n                                         ",
            "                    l_n_m_203733 +\n                                                             gtid_221609];\n                \n                bool cond_221637 = sle64(n_203572, gtid_221610);\n                int64_t defunc_0_f_res_221638;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221638 = (int64_t) 0;\n                } else {\n                    int64_t i_221639 = add64(gtid_221610, x_221628);\n                    int64_t defunc_1_add_res_221640 = add64((int64_t) 1,\n                                                            i_221639);\n                    \n                    defunc_0_f_res_221638 = defunc_1_add_res_221640;\n                }\n                \n                double defunc_0_f_res_221641;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221641 = 0.0;\n                } else {\n                    int64_t i_221642 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221643;\n                    \n                    defunc_0_add_arg_221643 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221608 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221642 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221641 = defunc_0_add_arg_221643;\n                }\n                \n                int64_t binop_p_221644 = sub64(defunc_0_f_res_221638,\n                                               index_primexp_228797);\n                double defunc_0_f_res_221645 = sitofp_i64_f64(binop_p_221644);\n                double abs_res_221646 = fabs(defunc_0_f_res_221645);\n                double tmp1_221647 = abs_res_22",
            "1646 / x_221629;\n                double x_221648 = tmp1_221647 * tmp1_221647;\n                double y_221649 = tmp1_221647 * x_221648;\n                double tmp2_221650 = 1.0 - y_221649;\n                double x_221651 = tmp2_221650 * tmp2_221650;\n                double tmp3_221652 = tmp2_221650 * x_221651;\n                double tmp4_221653 = defunc_0_f_res_221641 * tmp3_221652;\n                double defunc_1_f_res_221654 = defunc_0_f_res_221645 *\n                       tmp4_221653;\n                double defunc_1_f_res_221655 = defunc_0_f_res_221645 *\n                       defunc_1_f_res_221654;\n                double defunc_0_f_res_221656;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221656 = 0.0;\n                } else {\n                    int64_t i_221657 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221658;\n                    \n                    defunc_0_add_arg_221658 = ((__global\n                                                double *) mem_230659)[gtid_221608 *\n                                                                      n_203572 +\n                                                                      i_221657];\n                    defunc_0_f_res_221656 = defunc_0_add_arg_221658;\n                }\n                \n                double x_221659 = a12_221631 * tmp4_221653;\n                double y_221660 = b12_221632 * defunc_1_f_res_221654;\n                double x_221661 = x_221659 + y_221660;\n                double y_221662 = c12_221633 * defunc_1_f_res_221655;\n                double x_221663 = x_221661 + y_221662;\n                double defunc_9_fit_fun_res_221664 = defunc_0_f_res_221656 *\n                       x_221663;\n                double x_221665 = b12_221632 * tmp4_221653;\n                double y_221666 = b2_221634 * defunc_1_f_res_221654;\n                double x_221667 = x_221665 + y_221666;\n                double y_221668 = c2_221635 * defunc_1_f_res_22165",
            "5;\n                double x_221669 = x_221667 + y_221668;\n                double defunc_9_slope_fun_res_221670 = defunc_0_f_res_221656 *\n                       x_221669;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221612 = x_acc_235582;\n                    x_221613 = x_acc_235583;\n                }\n                // load new values\n                {\n                    x_221614 = defunc_9_fit_fun_res_221664;\n                    x_221615 = defunc_9_slope_fun_res_221670;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221616 = x_221612 + x_221614;\n                    double defunc_1_op_res_221617 = x_221613 + x_221615;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235582 = defunc_1_op_res_221616;\n                        x_acc_235583 = defunc_1_op_res_221617;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221612 = x_acc_235582;\n            x_221613 = x_acc_235583;\n            ((__local\n              double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                x_221612;\n            ((__local\n              double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563)] =\n                x_221613;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235592;\n        int32_t skip_waves_235593 = 1;\n        double x_235585;\n        double x_235586;\n        double x_235587;\n        double x_235588;\n        \n        offset_235592 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235563,\n                      sext_i64_i32(segred_group_sizze_221603))) {\n                x_235585 = ((__local\n                             doubl",
            "e *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                           offset_235592)];\n                x_235586 = ((__local\n                             double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563 +\n                                                           offset_235592)];\n            }\n        }\n        offset_235592 = 1;\n        while (slt32(offset_235592, wave_sizze_235565)) {\n            if (slt32(local_tid_235563 + offset_235592,\n                      sext_i64_i32(segred_group_sizze_221603)) &&\n                ((local_tid_235563 - squot32(local_tid_235563,\n                                             wave_sizze_235565) *\n                  wave_sizze_235565) & (2 * offset_235592 - 1)) == 0) {\n                // read array element\n                {\n                    x_235587 = ((volatile __local\n                                 double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                               offset_235592)];\n                    x_235588 = ((volatile __local\n                                 double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563 +\n                                                               offset_235592)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235589 = x_235585 + x_235587;\n                    double defunc_1_op_res_235590 = x_235586 + x_235588;\n                    \n                    x_235585 = defunc_1_op_res_235589;\n                    x_235586 = defunc_1_op_res_235590;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                        x_235585;\n                    ((volatile __local\n                      double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563)] =\n  ",
            "                      x_235586;\n                }\n            }\n            offset_235592 *= 2;\n        }\n        while (slt32(skip_waves_235593,\n                     squot32(sext_i64_i32(segred_group_sizze_221603) +\n                             wave_sizze_235565 - 1, wave_sizze_235565))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235592 = skip_waves_235593 * wave_sizze_235565;\n            if (slt32(local_tid_235563 + offset_235592,\n                      sext_i64_i32(segred_group_sizze_221603)) &&\n                ((local_tid_235563 - squot32(local_tid_235563,\n                                             wave_sizze_235565) *\n                  wave_sizze_235565) == 0 && (squot32(local_tid_235563,\n                                                      wave_sizze_235565) & (2 *\n                                                                            skip_waves_235593 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235587 = ((__local\n                                 double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                               offset_235592)];\n                    x_235588 = ((__local\n                                 double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563 +\n                                                               offset_235592)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235589 = x_235585 + x_235587;\n                    double defunc_1_op_res_235590 = x_235586 + x_235588;\n                    \n                    x_235585 = defunc_1_op_res_235589;\n                    x_235586 = defunc_1_op_res_235590;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_a",
            "rr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                        x_235585;\n                    ((__local\n                      double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563)] =\n                        x_235586;\n                }\n            }\n            skip_waves_235593 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235563) == (int64_t) 0) {\n                x_acc_235582 = x_235585;\n                x_acc_235583 = x_235586;\n            }\n        }\n        if (groups_per_segment_235551 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235563 == 0) {\n                    ((__global double *) mem_230933)[gtid_221608 *\n                                                     l_n_m_203733 +\n                                                     gtid_221609] =\n                        x_acc_235582;\n                    ((__global double *) mem_230937)[gtid_221608 *\n                                                     l_n_m_203733 +\n                                                     gtid_221609] =\n                        x_acc_235583;\n                }\n            }\n        } else {\n            int32_t old_counter_235594;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235563 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235556)[sext_i32_i64(virt_group_id_235575)] =\n                        x_acc_235582;\n                    ((__global\n                      double *) segred_tmp_mem_235558)[sext_i32_i64(virt_group_id_235575)] =\n                        x_acc_235583;\n                    mem_fence_global();\n                    old_counter_235594 =\n                        atomic_add_i32_global(&((volatile __global\n                                             ",
            "    int *) mainzicounter_mem_235560)[sext_i32_i64(srem32(flat_segment_id_235576,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235571)[(int64_t) 0] =\n                        old_counter_235594 == groups_per_segment_235551 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235595;\n            \n            is_last_group_235595 = ((__local\n                                     bool *) sync_arr_mem_235571)[(int64_t) 0];\n            if (is_last_group_235595) {\n                if (local_tid_235563 == 0) {\n                    old_counter_235594 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235560)[sext_i32_i64(srem32(flat_segment_id_235576,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235551));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235596 =\n                            sdiv_up64(groups_per_segment_235551,\n                                      segred_group_sizze_221603);\n                    \n                    x_221612 = 0.0;\n                    x_221613 = 0.0;\n                    for (int64_t i_235597 = 0; i_235597 <\n                         read_per_thread_235596; i_235597++) {\n                        int64_t group_res_id_235598 =\n                                sext_i32_i64(local_tid_235563) *\n                                read_per_thread_235596 + i_235597;\n                        int64_",
            "t index_of_group_res_235599 =\n                                sext_i32_i64(flat_segment_id_235576) *\n                                groups_per_segment_235551 + group_res_id_235598;\n                        \n                        if (slt64(group_res_id_235598,\n                                  groups_per_segment_235551)) {\n                            x_221614 = ((__global\n                                         double *) segred_tmp_mem_235556)[index_of_group_res_235599];\n                            x_221615 = ((__global\n                                         double *) segred_tmp_mem_235558)[index_of_group_res_235599];\n                            \n                            double defunc_1_op_res_221616 = x_221612 + x_221614;\n                            double defunc_1_op_res_221617 = x_221613 + x_221615;\n                            \n                            x_221612 = defunc_1_op_res_221616;\n                            x_221613 = defunc_1_op_res_221617;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                    x_221612;\n                ((__local\n                  double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563)] =\n                    x_221613;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235600;\n                    int32_t skip_waves_235601 = 1;\n                    double x_235585;\n                    double x_235586;\n                    double x_235587;\n                    double x_235588;\n                    \n                    offset_235600 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235563,\n                                  sext_i64_i32(segred_group_sizze_221603))) {\n                            x_235585 = ((__loc",
            "al\n                                         double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                                       offset_235600)];\n                            x_235586 = ((__local\n                                         double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563 +\n                                                                       offset_235600)];\n                        }\n                    }\n                    offset_235600 = 1;\n                    while (slt32(offset_235600, wave_sizze_235565)) {\n                        if (slt32(local_tid_235563 + offset_235600,\n                                  sext_i64_i32(segred_group_sizze_221603)) &&\n                            ((local_tid_235563 - squot32(local_tid_235563,\n                                                         wave_sizze_235565) *\n                              wave_sizze_235565) & (2 * offset_235600 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235587 = ((volatile __local\n                                             double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                                           offset_235600)];\n                                x_235588 = ((volatile __local\n                                             double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563 +\n                                                                           offset_235600)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235589 = x_235585 +\n                                       x_235587;\n                                double defunc_1_op_res_235590 = x_235586 +\n                                       x_235588;\n                               ",
            " \n                                x_235585 = defunc_1_op_res_235589;\n                                x_235586 = defunc_1_op_res_235590;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                                    x_235585;\n                                ((volatile __local\n                                  double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563)] =\n                                    x_235586;\n                            }\n                        }\n                        offset_235600 *= 2;\n                    }\n                    while (slt32(skip_waves_235601,\n                                 squot32(sext_i64_i32(segred_group_sizze_221603) +\n                                         wave_sizze_235565 - 1,\n                                         wave_sizze_235565))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235600 = skip_waves_235601 * wave_sizze_235565;\n                        if (slt32(local_tid_235563 + offset_235600,\n                                  sext_i64_i32(segred_group_sizze_221603)) &&\n                            ((local_tid_235563 - squot32(local_tid_235563,\n                                                         wave_sizze_235565) *\n                              wave_sizze_235565) == 0 &&\n                             (squot32(local_tid_235563, wave_sizze_235565) &\n                              (2 * skip_waves_235601 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235587 = ((__local\n                                             double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563 +\n                                                                           offset_235600)];\n      ",
            "                          x_235588 = ((__local\n                                             double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563 +\n                                                                           offset_235600)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235589 = x_235585 +\n                                       x_235587;\n                                double defunc_1_op_res_235590 = x_235586 +\n                                       x_235588;\n                                \n                                x_235585 = defunc_1_op_res_235589;\n                                x_235586 = defunc_1_op_res_235590;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235567)[sext_i32_i64(local_tid_235563)] =\n                                    x_235585;\n                                ((__local\n                                  double *) red_arr_mem_235569)[sext_i32_i64(local_tid_235563)] =\n                                    x_235586;\n                            }\n                        }\n                        skip_waves_235601 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235563 == 0) {\n                            ((__global double *) mem_230933)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609] =\n                                x_235585;\n                            ((__global double *) mem_230937)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                ",
            "             gtid_221609] =\n                                x_235586;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221603\n}\n__kernel void mainzisegred_large_223287(__global int *global_failure,\n                                        uint sync_arr_mem_235811_backing_offset_0,\n                                        uint red_arr_mem_235809_backing_offset_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223281,\n                                        int64_t groups_per_segment_235795,\n                                        int64_t elements_per_thread_235796,\n                                        int64_t virt_num_groups_235797,\n                                        int64_t threads_per_segment_235799,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231135,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235800,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235802)\n{\n    #define segred_group_sizze_223280 (mainzisegred_group_sizze_222884)\n    \n    ",
            "const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235811_backing_1 =\n                           &shared_mem[sync_arr_mem_235811_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235809_backing_0 =\n                           &shared_mem[red_arr_mem_235809_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235804;\n    int32_t local_tid_235805;\n    int64_t group_sizze_235808;\n    int32_t wave_sizze_235807;\n    int32_t group_tid_235806;\n    \n    global_tid_235804 = get_global_id(0);\n    local_tid_235805 = get_local_id(0);\n    group_sizze_235808 = get_local_size(0);\n    wave_sizze_235807 = LOCKSTEP_WIDTH;\n    group_tid_235806 = get_group_id(0);\n    \n    int32_t phys_tid_223287 = global_tid_235804;\n    __local unsigned char *red_arr_mem_235809;\n    \n    red_arr_mem_235809 = (__local unsigned char *) red_arr_mem_235809_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235811;\n    \n    sync_arr_mem_235811 = (__local\n                           unsigned char *) sync_arr_mem_235811_backing_1;\n    \n    int32_t phys_group_id_235813;\n    \n    phys_group_id_235813 = get_group_id(0);\n    for (int32_t i_235814 = 0; i_235814 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235797) - phys_group_id_235813,\n                   sext_i64_i32(num_groups_223281)); i_235814++) {\n        int32_t virt_group_id_235815 = phys_group_id_235813 + i_235814 *\n                sext_i64_i32(num_groups_223281);\n        int32_t flat_segment_id_235816 = squot32(virt_group_id_235815,\n                                                 sext_i64_i32(groups_per_segment_235795));\n        int64_t global_tid_235817 = srem64(sext_i32_i64(virt_group_id_235815) *\n                                           segred_group_sizze_223280 +\n                                           sext_i32_i64(local_tid_235805),\n                                           segred_group_sizze_223280 *\n      ",
            "                                     groups_per_segment_235795);\n        int64_t slice_235818 = t_n_m_203740;\n        int64_t slice_235819 = partition_sizze_203667 * slice_235818;\n        int64_t gtid_223284 = squot64(sext_i32_i64(flat_segment_id_235816),\n                                      slice_235818);\n        int64_t remnant_235820 = sext_i32_i64(flat_segment_id_235816) -\n                gtid_223284 * slice_235818;\n        int64_t gtid_223285 = remnant_235820;\n        int64_t remnant_235821 = remnant_235820 - gtid_223285;\n        int64_t gtid_223286;\n        double x_acc_235822;\n        int64_t chunk_sizze_235823 = smin64(elements_per_thread_235796,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_235817,\n                                                      threads_per_segment_235799));\n        double x_223288;\n        double x_223289;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235822 = 0.0;\n        }\n        for (int64_t i_235827 = 0; i_235827 < chunk_sizze_235823; i_235827++) {\n            gtid_223286 = global_tid_235817 + threads_per_segment_235799 *\n                i_235827;\n            // apply map function\n            {\n                int64_t x_223292;\n                \n                x_223292 = ((__global int64_t *) ext_mem_229304)[gtid_223284];\n                \n                int64_t x_223297;\n                \n                x_223297 = ((__global int64_t *) ext_mem_229569)[gtid_223284 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223285];\n                \n                double x_223298;\n                \n                x_223298 = ((__global double *) ext_mem_229568)[gtid_223284 *\n                                                                t_n_m_203740 +\n                                                                g",
            "tid_223285];\n                \n                int64_t binop_y_228750 = mul64(jump_t_203582, gtid_223285);\n                int64_t binop_y_228751 = smin64(i_203760, binop_y_228750);\n                int64_t index_primexp_228752 = add64((int64_t) 1,\n                                                     binop_y_228751);\n                bool cond_223301 = sle64(x_223292, gtid_223286);\n                int64_t defunc_0_f_res_223302;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223302 = (int64_t) 0;\n                } else {\n                    int64_t i_223303 = add64(gtid_223286, x_223297);\n                    int64_t defunc_0_add_arg_223304;\n                    \n                    defunc_0_add_arg_223304 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223284 *\n                                                                           n_203572 +\n                                                                           i_223303];\n                    \n                    int64_t defunc_1_add_res_223305 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223304);\n                    \n                    defunc_0_f_res_223302 = defunc_1_add_res_223305;\n                }\n                \n                double defunc_0_f_res_223306;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223306 = 0.0;\n                } else {\n                    int64_t i_223307 = add64(gtid_223286, x_223297);\n                    double defunc_0_add_arg_223308;\n                    \n                    defunc_0_add_arg_223308 = ((__global\n                                                double *) mem_231121)[gtid_223284 *\n                                                                      n_203572 +\n                                                                      i_223307];\n                    defunc_0_f_res_223306 = defunc_0_a",
            "dd_arg_223308;\n                }\n                \n                int64_t binop_p_223309 = sub64(defunc_0_f_res_223302,\n                                               index_primexp_228752);\n                double defunc_0_f_res_223310 = sitofp_i64_f64(binop_p_223309);\n                double abs_res_223311 = fabs(defunc_0_f_res_223310);\n                double tmp1_223312 = abs_res_223311 / x_223298;\n                double x_223313 = tmp1_223312 * tmp1_223312;\n                double y_223314 = tmp1_223312 * x_223313;\n                double tmp2_223315 = 1.0 - y_223314;\n                double x_223316 = tmp2_223315 * tmp2_223315;\n                double tmp3_223317 = tmp2_223315 * x_223316;\n                double w_j_223318 = defunc_0_f_res_223306 * tmp3_223317;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223288 = x_acc_235822;\n                }\n                // load new values\n                {\n                    x_223289 = w_j_223318;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223290 = x_223288 + x_223289;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235822 = defunc_1_op_res_223290;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223288 = x_acc_235822;\n            ((__local\n              double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805)] =\n                x_223288;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235828;\n        int32_t skip_waves_235829 = 1;\n        double x_235824;\n        double x_235825;\n        \n        offset_235828 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235805,\n           ",
            "           sext_i64_i32(segred_group_sizze_223280))) {\n                x_235824 = ((__local\n                             double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805 +\n                                                           offset_235828)];\n            }\n        }\n        offset_235828 = 1;\n        while (slt32(offset_235828, wave_sizze_235807)) {\n            if (slt32(local_tid_235805 + offset_235828,\n                      sext_i64_i32(segred_group_sizze_223280)) &&\n                ((local_tid_235805 - squot32(local_tid_235805,\n                                             wave_sizze_235807) *\n                  wave_sizze_235807) & (2 * offset_235828 - 1)) == 0) {\n                // read array element\n                {\n                    x_235825 = ((volatile __local\n                                 double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805 +\n                                                               offset_235828)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235826 = x_235824 + x_235825;\n                    \n                    x_235824 = defunc_1_op_res_235826;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805)] =\n                        x_235824;\n                }\n            }\n            offset_235828 *= 2;\n        }\n        while (slt32(skip_waves_235829,\n                     squot32(sext_i64_i32(segred_group_sizze_223280) +\n                             wave_sizze_235807 - 1, wave_sizze_235807))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235828 = skip_waves_235829 * wave_sizze_235807;\n            if (slt32(local_tid_235805 + offset_235828,\n                      sext_i64_i32(segred_group_sizze_223280)) &&\n                ((local_tid_235805 - squot32(local_tid_235805,\n    ",
            "                                         wave_sizze_235807) *\n                  wave_sizze_235807) == 0 && (squot32(local_tid_235805,\n                                                      wave_sizze_235807) & (2 *\n                                                                            skip_waves_235829 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235825 = ((__local\n                                 double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805 +\n                                                               offset_235828)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235826 = x_235824 + x_235825;\n                    \n                    x_235824 = defunc_1_op_res_235826;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805)] =\n                        x_235824;\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_235805) == (int64_t) 0) {\n                x_acc_235822 = x_235824;\n            }\n        }\n        if (groups_per_segment_235795 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235805 == 0) {\n                    ((__global double *) mem_231135)[gtid_223284 *\n                                                     t_n_m_203740 +\n                                                     gtid_223285] =\n                        x_acc_235822;\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_235805 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235800)[sext_i32_i64(virt_group_id_235815)] =\n                        x_acc_235822;\n                    mem_fence_global();\n                    old_counter_235830 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235802)[sext_i32_i64(srem32(flat_segment_id_235816,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235811)[(int64_t) 0] =\n                        old_counter_235830 == groups_per_segment_235795 -\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_235811)[(int64_t) 0];\n            if (is_last_group_235831) {\n                if (local_tid_235805 == 0) {\n                    old_counter_235830 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235802)[sext_i32_i64(srem32(flat_segment_id_235816,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235795));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235832 =\n                            sdiv_up64(groups_per_segment_235795,\n                        ",
            "              segred_group_sizze_223280);\n                    \n                    x_223288 = 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_235805) *\n                                read_per_thread_235832 + i_235833;\n                        int64_t index_of_group_res_235835 =\n                                sext_i32_i64(flat_segment_id_235816) *\n                                groups_per_segment_235795 + group_res_id_235834;\n                        \n                        if (slt64(group_res_id_235834,\n                                  groups_per_segment_235795)) {\n                            x_223289 = ((__global\n                                         double *) segred_tmp_mem_235800)[index_of_group_res_235835];\n                            \n                            double defunc_1_op_res_223290 = x_223288 + x_223289;\n                            \n                            x_223288 = defunc_1_op_res_223290;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805)] =\n                    x_223288;\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_235824;\n                    double x_235825;\n                    \n                    offset_235836 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235805,\n                                  sext_i64_i32(segred_group_sizze_223280))) {\n                            x_235824 = ((__local\n                                         double *) red_arr_mem_235809",
            ")[sext_i32_i64(local_tid_235805 +\n                                                                       offset_235836)];\n                        }\n                    }\n                    offset_235836 = 1;\n                    while (slt32(offset_235836, wave_sizze_235807)) {\n                        if (slt32(local_tid_235805 + offset_235836,\n                                  sext_i64_i32(segred_group_sizze_223280)) &&\n                            ((local_tid_235805 - squot32(local_tid_235805,\n                                                         wave_sizze_235807) *\n                              wave_sizze_235807) & (2 * offset_235836 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235825 = ((volatile __local\n                                             double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805 +\n                                                                           offset_235836)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235826 = x_235824 +\n                                       x_235825;\n                                \n                                x_235824 = defunc_1_op_res_235826;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805)] =\n                                    x_235824;\n                            }\n                        }\n                        offset_235836 *= 2;\n                    }\n                    while (slt32(skip_waves_235837,\n                                 squot32(sext_i64_i32(segred_group_sizze_223280) +\n                                         wave_sizze_235807 ",
            "- 1,\n                                         wave_sizze_235807))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235836 = skip_waves_235837 * wave_sizze_235807;\n                        if (slt32(local_tid_235805 + offset_235836,\n                                  sext_i64_i32(segred_group_sizze_223280)) &&\n                            ((local_tid_235805 - squot32(local_tid_235805,\n                                                         wave_sizze_235807) *\n                              wave_sizze_235807) == 0 &&\n                             (squot32(local_tid_235805, wave_sizze_235807) &\n                              (2 * skip_waves_235837 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235825 = ((__local\n                                             double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805 +\n                                                                           offset_235836)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235826 = x_235824 +\n                                       x_235825;\n                                \n                                x_235824 = defunc_1_op_res_235826;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235809)[sext_i32_i64(local_tid_235805)] =\n                                    x_235824;\n                            }\n                        }\n                        skip_waves_235837 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235805 == 0) {\n                            ((__global double *) mem_231",
            "135)[gtid_223284 *\n                                                             t_n_m_203740 +\n                                                             gtid_223285] =\n                                x_235824;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223280\n}\n__kernel void mainzisegred_large_223339(__global int *global_failure,\n                                        uint sync_arr_mem_235893_backing_offset_0,\n                                        uint red_arr_mem_235891_backing_offset_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223333,\n                                        int64_t groups_per_segment_235877,\n                                        int64_t elements_per_thread_235878,\n                                        int64_t virt_num_groups_235879,\n                                        int64_t threads_per_segment_235881,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231125,\n                                        __global unsigned char *mem_231140,\n                                        __global unsigned char *mem_231145,\n                                        __glo",
            "bal\n                                        unsigned char *segred_tmp_mem_235882,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235884)\n{\n    #define segred_group_sizze_223332 (mainzisegred_group_sizze_222814)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_235893_backing_1 =\n                           &shared_mem[sync_arr_mem_235893_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235891_backing_0 =\n                           &shared_mem[red_arr_mem_235891_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235886;\n    int32_t local_tid_235887;\n    int64_t group_sizze_235890;\n    int32_t wave_sizze_235889;\n    int32_t group_tid_235888;\n    \n    global_tid_235886 = get_global_id(0);\n    local_tid_235887 = get_local_id(0);\n    group_sizze_235890 = get_local_size(0);\n    wave_sizze_235889 = LOCKSTEP_WIDTH;\n    group_tid_235888 = get_group_id(0);\n    \n    int32_t phys_tid_223339 = global_tid_235886;\n    __local unsigned char *red_arr_mem_235891;\n    \n    red_arr_mem_235891 = (__local unsigned char *) red_arr_mem_235891_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235893;\n    \n    sync_arr_mem_235893 = (__local\n                           unsigned char *) sync_arr_mem_235893_backing_1;\n    \n    int32_t phys_group_id_235895;\n    \n    phys_group_id_235895 = get_group_id(0);\n    for (int32_t i_235896 = 0; i_235896 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235879) - phys_group_id_235895,\n                   sext_i64_i32(num_groups_223333)); i_235896++) {\n        int32_t virt_group_id_235897 = phys_group_id_235895 + i_235896 *\n                sext_i64_i32(num_groups_223333);\n        int32_t flat_segment_id_235898 = squot32(virt_group_id_235897,\n                                                 sext_i64_i32(groups_per_segment_235877));\n        ",
            "int64_t global_tid_235899 = srem64(sext_i32_i64(virt_group_id_235897) *\n                                           segred_group_sizze_223332 +\n                                           sext_i32_i64(local_tid_235887),\n                                           segred_group_sizze_223332 *\n                                           groups_per_segment_235877);\n        int64_t slice_235900 = t_n_m_203740;\n        int64_t slice_235901 = partition_sizze_203667 * slice_235900;\n        int64_t gtid_223336 = squot64(sext_i32_i64(flat_segment_id_235898),\n                                      slice_235900);\n        int64_t remnant_235902 = sext_i32_i64(flat_segment_id_235898) -\n                gtid_223336 * slice_235900;\n        int64_t gtid_223337 = remnant_235902;\n        int64_t remnant_235903 = remnant_235902 - gtid_223337;\n        int64_t gtid_223338;\n        double x_acc_235904;\n        int64_t chunk_sizze_235905 = smin64(elements_per_thread_235878,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_235899,\n                                                      threads_per_segment_235881));\n        double x_223340;\n        double x_223341;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235904 = 0.0;\n        }\n        for (int64_t i_235909 = 0; i_235909 < chunk_sizze_235905; i_235909++) {\n            gtid_223338 = global_tid_235899 + threads_per_segment_235881 *\n                i_235909;\n            // apply map function\n            {\n                int64_t x_223344;\n                \n                x_223344 = ((__global int64_t *) ext_mem_229304)[gtid_223336];\n                \n                int64_t x_223351;\n                \n                x_223351 = ((__global int64_t *) ext_mem_229569)[gtid_223336 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223",
            "337];\n                \n                double x_223352;\n                \n                x_223352 = ((__global double *) ext_mem_229568)[gtid_223336 *\n                                                                t_n_m_203740 +\n                                                                gtid_223337];\n                \n                int64_t binop_y_228745 = mul64(jump_t_203582, gtid_223337);\n                int64_t binop_y_228746 = smin64(i_203760, binop_y_228745);\n                int64_t index_primexp_228747 = add64((int64_t) 1,\n                                                     binop_y_228746);\n                double a0_223354;\n                \n                a0_223354 = ((__global double *) mem_231140)[gtid_223336 *\n                                                             t_n_m_203740 +\n                                                             gtid_223337];\n                \n                bool cond_223356 = sle64(x_223344, gtid_223338);\n                int64_t defunc_0_f_res_223357;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223357 = (int64_t) 0;\n                } else {\n                    int64_t i_223358 = add64(gtid_223338, x_223351);\n                    int64_t defunc_0_add_arg_223359;\n                    \n                    defunc_0_add_arg_223359 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223336 *\n                                                                           n_203572 +\n                                                                           i_223358];\n                    \n                    int64_t defunc_1_add_res_223360 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223359);\n                    \n                    defunc_0_f_res_223357 = defunc_1_add_res_223360;\n                }\n                \n                double defunc_0_f_res_223361;\n                \n                if ",
            "(cond_223356) {\n                    defunc_0_f_res_223361 = 0.0;\n                } else {\n                    int64_t i_223362 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223363;\n                    \n                    defunc_0_add_arg_223363 = ((__global\n                                                double *) mem_231121)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223362];\n                    defunc_0_f_res_223361 = defunc_0_add_arg_223363;\n                }\n                \n                int64_t binop_p_223364 = sub64(defunc_0_f_res_223357,\n                                               index_primexp_228747);\n                double defunc_0_f_res_223365 = sitofp_i64_f64(binop_p_223364);\n                double abs_res_223366 = fabs(defunc_0_f_res_223365);\n                double tmp1_223367 = abs_res_223366 / x_223352;\n                double x_223368 = tmp1_223367 * tmp1_223367;\n                double y_223369 = tmp1_223367 * x_223368;\n                double tmp2_223370 = 1.0 - y_223369;\n                double x_223371 = tmp2_223370 * tmp2_223370;\n                double tmp3_223372 = tmp2_223370 * x_223371;\n                double tmp4_223373 = defunc_0_f_res_223361 * tmp3_223372;\n                double defunc_0_f_res_223374;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223374 = 0.0;\n                } else {\n                    int64_t i_223375 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223376;\n                    \n                    defunc_0_add_arg_223376 = ((__global\n                                                double *) mem_231125)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223375];\n                    defu",
            "nc_0_f_res_223374 = defunc_0_add_arg_223376;\n                }\n                \n                double x_223377 = a0_223354 * tmp4_223373;\n                double defunc_9_fit_fun_res_223378 = defunc_0_f_res_223374 *\n                       x_223377;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223340 = x_acc_235904;\n                }\n                // load new values\n                {\n                    x_223341 = defunc_9_fit_fun_res_223378;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223342 = x_223340 + x_223341;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235904 = defunc_1_op_res_223342;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223340 = x_acc_235904;\n            ((__local\n              double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                x_223340;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235910;\n        int32_t skip_waves_235911 = 1;\n        double x_235906;\n        double x_235907;\n        \n        offset_235910 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235887,\n                      sext_i64_i32(segred_group_sizze_223332))) {\n                x_235906 = ((__local\n                             double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887 +\n                                                           offset_235910)];\n            }\n        }\n        offset_235910 = 1;\n        while (slt32(offset_235910, wave_sizze_235889)) {\n            if (slt32(local_tid_235887 + offset_235910,\n                      sext_i64_i32(segred_group_sizze_223332)) &&\n             ",
            "   ((local_tid_235887 - squot32(local_tid_235887,\n                                             wave_sizze_235889) *\n                  wave_sizze_235889) & (2 * offset_235910 - 1)) == 0) {\n                // read array element\n                {\n                    x_235907 = ((volatile __local\n                                 double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887 +\n                                                               offset_235910)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235908 = x_235906 + x_235907;\n                    \n                    x_235906 = defunc_1_op_res_235908;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                        x_235906;\n                }\n            }\n            offset_235910 *= 2;\n        }\n        while (slt32(skip_waves_235911,\n                     squot32(sext_i64_i32(segred_group_sizze_223332) +\n                             wave_sizze_235889 - 1, wave_sizze_235889))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235910 = skip_waves_235911 * wave_sizze_235889;\n            if (slt32(local_tid_235887 + offset_235910,\n                      sext_i64_i32(segred_group_sizze_223332)) &&\n                ((local_tid_235887 - squot32(local_tid_235887,\n                                             wave_sizze_235889) *\n                  wave_sizze_235889) == 0 && (squot32(local_tid_235887,\n                                                      wave_sizze_235889) & (2 *\n                                                                            skip_waves_235911 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235907 = ",
            "((__local\n                                 double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887 +\n                                                               offset_235910)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235908 = x_235906 + x_235907;\n                    \n                    x_235906 = defunc_1_op_res_235908;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                        x_235906;\n                }\n            }\n            skip_waves_235911 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235887) == (int64_t) 0) {\n                x_acc_235904 = x_235906;\n            }\n        }\n        if (groups_per_segment_235877 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235887 == 0) {\n                    ((__global double *) mem_231145)[gtid_223336 *\n                                                     t_n_m_203740 +\n                                                     gtid_223337] =\n                        x_acc_235904;\n                }\n            }\n        } else {\n            int32_t old_counter_235912;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235887 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235882)[sext_i32_i64(virt_group_id_235897)] =\n                        x_acc_235904;\n                    mem_fence_global();\n                    old_counter_235912 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_23",
            "5884)[sext_i32_i64(srem32(flat_segment_id_235898,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235893)[(int64_t) 0] =\n                        old_counter_235912 == groups_per_segment_235877 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235913;\n            \n            is_last_group_235913 = ((__local\n                                     bool *) sync_arr_mem_235893)[(int64_t) 0];\n            if (is_last_group_235913) {\n                if (local_tid_235887 == 0) {\n                    old_counter_235912 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235884)[sext_i32_i64(srem32(flat_segment_id_235898,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235877));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235914 =\n                            sdiv_up64(groups_per_segment_235877,\n                                      segred_group_sizze_223332);\n                    \n                    x_223340 = 0.0;\n                    for (int64_t i_235915 = 0; i_235915 <\n                         read_per_thread_235914; i_235915++) {\n                        int64_t group_res_id_235916 =\n                                sext_i32_i64(local_tid_235887) *\n                                read_per_thread_235914 + i_235915;\n                        int64_t index_of_group_res_235917 =\n                                sext_",
            "i32_i64(flat_segment_id_235898) *\n                                groups_per_segment_235877 + group_res_id_235916;\n                        \n                        if (slt64(group_res_id_235916,\n                                  groups_per_segment_235877)) {\n                            x_223341 = ((__global\n                                         double *) segred_tmp_mem_235882)[index_of_group_res_235917];\n                            \n                            double defunc_1_op_res_223342 = x_223340 + x_223341;\n                            \n                            x_223340 = defunc_1_op_res_223342;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                    x_223340;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235918;\n                    int32_t skip_waves_235919 = 1;\n                    double x_235906;\n                    double x_235907;\n                    \n                    offset_235918 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235887,\n                                  sext_i64_i32(segred_group_sizze_223332))) {\n                            x_235906 = ((__local\n                                         double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887 +\n                                                                       offset_235918)];\n                        }\n                    }\n                    offset_235918 = 1;\n                    while (slt32(offset_235918, wave_sizze_235889)) {\n                        if (slt32(local_tid_235887 + offset_235918,\n                                  sext_i64_i32(segred_group_sizze_223332)) &&\n                            ((local_tid_235887 - squot32(local_tid_235887,\n   ",
            "                                                      wave_sizze_235889) *\n                              wave_sizze_235889) & (2 * offset_235918 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235907 = ((volatile __local\n                                             double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887 +\n                                                                           offset_235918)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235908 = x_235906 +\n                                       x_235907;\n                                \n                                x_235906 = defunc_1_op_res_235908;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                                    x_235906;\n                            }\n                        }\n                        offset_235918 *= 2;\n                    }\n                    while (slt32(skip_waves_235919,\n                                 squot32(sext_i64_i32(segred_group_sizze_223332) +\n                                         wave_sizze_235889 - 1,\n                                         wave_sizze_235889))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235918 = skip_waves_235919 * wave_sizze_235889;\n                        if (slt32(local_tid_235887 + offset_235918,\n                                  sext_i64_i32(segred_group_sizze_223332)) &&\n                            ((local_tid_235887 - squot32(local_tid_235887,\n                                                         wave_sizze_235889) *\n  ",
            "                            wave_sizze_235889) == 0 &&\n                             (squot32(local_tid_235887, wave_sizze_235889) &\n                              (2 * skip_waves_235919 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235907 = ((__local\n                                             double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887 +\n                                                                           offset_235918)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235908 = x_235906 +\n                                       x_235907;\n                                \n                                x_235906 = defunc_1_op_res_235908;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235891)[sext_i32_i64(local_tid_235887)] =\n                                    x_235906;\n                            }\n                        }\n                        skip_waves_235919 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235887 == 0) {\n                            ((__global double *) mem_231145)[gtid_223336 *\n                                                             t_n_m_203740 +\n                                                             gtid_223337] =\n                                x_235906;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223332\n}\n__kernel void mainzisegred_large_224325(__global int *global_failu",
            "re,\n                                        uint sync_arr_mem_236062_backing_offset_0,\n                                        uint red_arr_mem_236060_backing_offset_1,\n                                        uint red_arr_mem_236058_backing_offset_2,\n                                        uint red_arr_mem_236056_backing_offset_3,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224317,\n                                        int64_t groups_per_segment_236038,\n                                        int64_t elements_per_thread_236039,\n                                        int64_t virt_num_groups_236040,\n                                        int64_t threads_per_segment_236042,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231277,\n                                        __global unsigned char *mem_231281,\n                                        __global unsigned char *mem_231285,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236043,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236045,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236047,\n   ",
            "                                     __global\n                                        unsigned char *mainzicounter_mem_236049)\n{\n    #define segred_group_sizze_224316 (mainzisegred_group_sizze_223845)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236062_backing_3 =\n                           &shared_mem[sync_arr_mem_236062_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236060_backing_2 =\n                           &shared_mem[red_arr_mem_236060_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236058_backing_1 =\n                           &shared_mem[red_arr_mem_236058_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236056_backing_0 =\n                           &shared_mem[red_arr_mem_236056_backing_offset_3];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236051;\n    int32_t local_tid_236052;\n    int64_t group_sizze_236055;\n    int32_t wave_sizze_236054;\n    int32_t group_tid_236053;\n    \n    global_tid_236051 = get_global_id(0);\n    local_tid_236052 = get_local_id(0);\n    group_sizze_236055 = get_local_size(0);\n    wave_sizze_236054 = LOCKSTEP_WIDTH;\n    group_tid_236053 = get_group_id(0);\n    \n    int32_t phys_tid_224325 = global_tid_236051;\n    __local unsigned char *red_arr_mem_236056;\n    \n    red_arr_mem_236056 = (__local unsigned char *) red_arr_mem_236056_backing_0;\n    \n    __local unsigned char *red_arr_mem_236058;\n    \n    red_arr_mem_236058 = (__local unsigned char *) red_arr_mem_236058_backing_1;\n    \n    __local unsigned char *red_arr_mem_236060;\n    \n    red_arr_mem_236060 = (__local unsigned char *) red_arr_mem_236060_backing_2;\n    \n    __local unsigned char *sync_arr_mem_236062;\n    \n    sync_arr_mem_236062 = (__local\n                           unsigned char *) sync_arr_mem_236062_backing_3;\n    \n    int32_t phys_group_id_236064;\n    \n    phys_group_id_236064 = get_group_id(0);\n    for (int32_t i",
            "_236065 = 0; i_236065 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236040) - phys_group_id_236064,\n                   sext_i64_i32(num_groups_224317)); i_236065++) {\n        int32_t virt_group_id_236066 = phys_group_id_236064 + i_236065 *\n                sext_i64_i32(num_groups_224317);\n        int32_t flat_segment_id_236067 = squot32(virt_group_id_236066,\n                                                 sext_i64_i32(groups_per_segment_236038));\n        int64_t global_tid_236068 = srem64(sext_i32_i64(virt_group_id_236066) *\n                                           segred_group_sizze_224316 +\n                                           sext_i32_i64(local_tid_236052),\n                                           segred_group_sizze_224316 *\n                                           groups_per_segment_236038);\n        int64_t slice_236069 = t_n_m_203740;\n        int64_t slice_236070 = partition_sizze_203667 * slice_236069;\n        int64_t gtid_224322 = squot64(sext_i32_i64(flat_segment_id_236067),\n                                      slice_236069);\n        int64_t remnant_236071 = sext_i32_i64(flat_segment_id_236067) -\n                gtid_224322 * slice_236069;\n        int64_t gtid_224323 = remnant_236071;\n        int64_t remnant_236072 = remnant_236071 - gtid_224323;\n        int64_t gtid_224324;\n        double x_acc_236073;\n        double x_acc_236074;\n        double x_acc_236075;\n        int64_t chunk_sizze_236076 = smin64(elements_per_thread_236039,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_236068,\n                                                      threads_per_segment_236042));\n        double x_224326;\n        double x_224327;\n        double x_224328;\n        double x_224329;\n        double x_224330;\n        double x_224331;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236073 = 0.0;\n            x_acc_236074 = 0.0;\n            x_ac",
            "c_236075 = 0.0;\n        }\n        for (int64_t i_236086 = 0; i_236086 < chunk_sizze_236076; i_236086++) {\n            gtid_224324 = global_tid_236068 + threads_per_segment_236042 *\n                i_236086;\n            // apply map function\n            {\n                int64_t x_224336;\n                \n                x_224336 = ((__global int64_t *) ext_mem_229304)[gtid_224322];\n                \n                int64_t x_224341;\n                \n                x_224341 = ((__global int64_t *) ext_mem_229569)[gtid_224322 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224323];\n                \n                double x_224342;\n                \n                x_224342 = ((__global double *) ext_mem_229568)[gtid_224322 *\n                                                                t_n_m_203740 +\n                                                                gtid_224323];\n                \n                int64_t binop_y_228760 = mul64(jump_t_203582, gtid_224323);\n                int64_t binop_y_228761 = smin64(i_203760, binop_y_228760);\n                int64_t index_primexp_228762 = add64((int64_t) 1,\n                                                     binop_y_228761);\n                bool cond_224345 = sle64(x_224336, gtid_224324);\n                int64_t defunc_0_f_res_224346;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224346 = (int64_t) 0;\n                } else {\n                    int64_t i_224347 = add64(gtid_224324, x_224341);\n                    int64_t defunc_0_add_arg_224348;\n                    \n                    defunc_0_add_arg_224348 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224322 *\n                                                                           n_203572 +\n                                                                           i_22434",
            "7];\n                    \n                    int64_t defunc_1_add_res_224349 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224348);\n                    \n                    defunc_0_f_res_224346 = defunc_1_add_res_224349;\n                }\n                \n                double defunc_0_f_res_224350;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224324, x_224341);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231259)[gtid_224322 *\n                                                                      n_203572 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                int64_t binop_p_224353 = sub64(defunc_0_f_res_224346,\n                                               index_primexp_228762);\n                double defunc_0_f_res_224354 = sitofp_i64_f64(binop_p_224353);\n                double abs_res_224355 = fabs(defunc_0_f_res_224354);\n                double tmp1_224356 = abs_res_224355 / x_224342;\n                double x_224357 = tmp1_224356 * tmp1_224356;\n                double y_224358 = tmp1_224356 * x_224357;\n                double tmp2_224359 = 1.0 - y_224358;\n                double x_224360 = tmp2_224359 * tmp2_224359;\n                double tmp3_224361 = tmp2_224359 * x_224360;\n                double w_j_224362 = defunc_0_f_res_224350 * tmp3_224361;\n                double xw_j_224363 = defunc_0_f_res_224354 * w_j_224362;\n                double x2w_j_224364 = defunc_0_f_res_224354 * xw_j_224363;\n                \n                // save map-out results\n                { }\n                // load ac",
            "cumulator\n                {\n                    x_224326 = x_acc_236073;\n                    x_224327 = x_acc_236074;\n                    x_224328 = x_acc_236075;\n                }\n                // load new values\n                {\n                    x_224329 = w_j_224362;\n                    x_224330 = xw_j_224363;\n                    x_224331 = x2w_j_224364;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224332 = x_224326 + x_224329;\n                    double defunc_1_op_res_224333 = x_224327 + x_224330;\n                    double defunc_1_op_res_224334 = x_224328 + x_224331;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236073 = defunc_1_op_res_224332;\n                        x_acc_236074 = defunc_1_op_res_224333;\n                        x_acc_236075 = defunc_1_op_res_224334;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224326 = x_acc_236073;\n            x_224327 = x_acc_236074;\n            x_224328 = x_acc_236075;\n            ((__local\n              double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052)] =\n                x_224326;\n            ((__local\n              double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052)] =\n                x_224327;\n            ((__local\n              double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052)] =\n                x_224328;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236087;\n        int32_t skip_waves_236088 = 1;\n        double x_236077;\n        double x_236078;\n        double x_236079;\n        double x_236080;\n        double x_236081;\n        double x_236082;\n        \n        offset_236087 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236052,\n      ",
            "                sext_i64_i32(segred_group_sizze_224316))) {\n                x_236077 = ((__local\n                             double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052 +\n                                                           offset_236087)];\n                x_236078 = ((__local\n                             double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052 +\n                                                           offset_236087)];\n                x_236079 = ((__local\n                             double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052 +\n                                                           offset_236087)];\n            }\n        }\n        offset_236087 = 1;\n        while (slt32(offset_236087, wave_sizze_236054)) {\n            if (slt32(local_tid_236052 + offset_236087,\n                      sext_i64_i32(segred_group_sizze_224316)) &&\n                ((local_tid_236052 - squot32(local_tid_236052,\n                                             wave_sizze_236054) *\n                  wave_sizze_236054) & (2 * offset_236087 - 1)) == 0) {\n                // read array element\n                {\n                    x_236080 = ((volatile __local\n                                 double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052 +\n                                                               offset_236087)];\n                    x_236081 = ((volatile __local\n                                 double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052 +\n                                                               offset_236087)];\n                    x_236082 = ((volatile __local\n                                 double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052 +\n                                                               offset_236087)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236083 = x_236077 + x_236080;\n           ",
            "         double defunc_1_op_res_236084 = x_236078 + x_236081;\n                    double defunc_1_op_res_236085 = x_236079 + x_236082;\n                    \n                    x_236077 = defunc_1_op_res_236083;\n                    x_236078 = defunc_1_op_res_236084;\n                    x_236079 = defunc_1_op_res_236085;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052)] =\n                        x_236077;\n                    ((volatile __local\n                      double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052)] =\n                        x_236078;\n                    ((volatile __local\n                      double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052)] =\n                        x_236079;\n                }\n            }\n            offset_236087 *= 2;\n        }\n        while (slt32(skip_waves_236088,\n                     squot32(sext_i64_i32(segred_group_sizze_224316) +\n                             wave_sizze_236054 - 1, wave_sizze_236054))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236087 = skip_waves_236088 * wave_sizze_236054;\n            if (slt32(local_tid_236052 + offset_236087,\n                      sext_i64_i32(segred_group_sizze_224316)) &&\n                ((local_tid_236052 - squot32(local_tid_236052,\n                                             wave_sizze_236054) *\n                  wave_sizze_236054) == 0 && (squot32(local_tid_236052,\n                                                      wave_sizze_236054) & (2 *\n                                                                            skip_waves_236088 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236080 = ((__local\n                                 double *) red_arr",
            "_mem_236056)[sext_i32_i64(local_tid_236052 +\n                                                               offset_236087)];\n                    x_236081 = ((__local\n                                 double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052 +\n                                                               offset_236087)];\n                    x_236082 = ((__local\n                                 double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052 +\n                                                               offset_236087)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236083 = x_236077 + x_236080;\n                    double defunc_1_op_res_236084 = x_236078 + x_236081;\n                    double defunc_1_op_res_236085 = x_236079 + x_236082;\n                    \n                    x_236077 = defunc_1_op_res_236083;\n                    x_236078 = defunc_1_op_res_236084;\n                    x_236079 = defunc_1_op_res_236085;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052)] =\n                        x_236077;\n                    ((__local\n                      double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052)] =\n                        x_236078;\n                    ((__local\n                      double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052)] =\n                        x_236079;\n                }\n            }\n            skip_waves_236088 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236052) == (int64_t) 0) {\n                x_acc_236073 = x_236077;\n                x_acc_236074 = x_236078;\n                x_acc_236075 = x_236079;\n            }\n        }\n        if (groups_per_segment_2",
            "36038 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236052 == 0) {\n                    ((__global double *) mem_231277)[gtid_224322 *\n                                                     t_n_m_203740 +\n                                                     gtid_224323] =\n                        x_acc_236073;\n                    ((__global double *) mem_231281)[gtid_224322 *\n                                                     t_n_m_203740 +\n                                                     gtid_224323] =\n                        x_acc_236074;\n                    ((__global double *) mem_231285)[gtid_224322 *\n                                                     t_n_m_203740 +\n                                                     gtid_224323] =\n                        x_acc_236075;\n                }\n            }\n        } else {\n            int32_t old_counter_236089;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236052 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236043)[sext_i32_i64(virt_group_id_236066)] =\n                        x_acc_236073;\n                    ((__global\n                      double *) segred_tmp_mem_236045)[sext_i32_i64(virt_group_id_236066)] =\n                        x_acc_236074;\n                    ((__global\n                      double *) segred_tmp_mem_236047)[sext_i32_i64(virt_group_id_236066)] =\n                        x_acc_236075;\n                    mem_fence_global();\n                    old_counter_236089 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236049)[sext_i32_i64(srem32(flat_segment_id_236067,\n                                                                                                      10240))],\n                      ",
            "                        (int) 1);\n                    ((__local bool *) sync_arr_mem_236062)[(int64_t) 0] =\n                        old_counter_236089 == groups_per_segment_236038 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236090;\n            \n            is_last_group_236090 = ((__local\n                                     bool *) sync_arr_mem_236062)[(int64_t) 0];\n            if (is_last_group_236090) {\n                if (local_tid_236052 == 0) {\n                    old_counter_236089 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236049)[sext_i32_i64(srem32(flat_segment_id_236067,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236038));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236091 =\n                            sdiv_up64(groups_per_segment_236038,\n                                      segred_group_sizze_224316);\n                    \n                    x_224326 = 0.0;\n                    x_224327 = 0.0;\n                    x_224328 = 0.0;\n                    for (int64_t i_236092 = 0; i_236092 <\n                         read_per_thread_236091; i_236092++) {\n                        int64_t group_res_id_236093 =\n                                sext_i32_i64(local_tid_236052) *\n                                read_per_thread_236091 + i_236092;\n                        int64_t index_of_group_res_236094 =\n                                sext_i32_i64(flat_segment_id_236067) *\n                                groups_per_segment_236038 + group_res_id_23609",
            "3;\n                        \n                        if (slt64(group_res_id_236093,\n                                  groups_per_segment_236038)) {\n                            x_224329 = ((__global\n                                         double *) segred_tmp_mem_236043)[index_of_group_res_236094];\n                            x_224330 = ((__global\n                                         double *) segred_tmp_mem_236045)[index_of_group_res_236094];\n                            x_224331 = ((__global\n                                         double *) segred_tmp_mem_236047)[index_of_group_res_236094];\n                            \n                            double defunc_1_op_res_224332 = x_224326 + x_224329;\n                            double defunc_1_op_res_224333 = x_224327 + x_224330;\n                            double defunc_1_op_res_224334 = x_224328 + x_224331;\n                            \n                            x_224326 = defunc_1_op_res_224332;\n                            x_224327 = defunc_1_op_res_224333;\n                            x_224328 = defunc_1_op_res_224334;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052)] =\n                    x_224326;\n                ((__local\n                  double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052)] =\n                    x_224327;\n                ((__local\n                  double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052)] =\n                    x_224328;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236095;\n                    int32_t skip_waves_236096 = 1;\n                    double x_236077;\n                    double x_236078;\n                    double x_236079;\n                    double x_236080;\n                    double x_236081;\n                    double x_236082;",
            "\n                    \n                    offset_236095 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236052,\n                                  sext_i64_i32(segred_group_sizze_224316))) {\n                            x_236077 = ((__local\n                                         double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052 +\n                                                                       offset_236095)];\n                            x_236078 = ((__local\n                                         double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052 +\n                                                                       offset_236095)];\n                            x_236079 = ((__local\n                                         double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052 +\n                                                                       offset_236095)];\n                        }\n                    }\n                    offset_236095 = 1;\n                    while (slt32(offset_236095, wave_sizze_236054)) {\n                        if (slt32(local_tid_236052 + offset_236095,\n                                  sext_i64_i32(segred_group_sizze_224316)) &&\n                            ((local_tid_236052 - squot32(local_tid_236052,\n                                                         wave_sizze_236054) *\n                              wave_sizze_236054) & (2 * offset_236095 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236080 = ((volatile __local\n                                             double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052 +\n                                                                           offset_236095)];\n                                x_236081 = ((volatile __local\n                          ",
            "                   double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052 +\n                                                                           offset_236095)];\n                                x_236082 = ((volatile __local\n                                             double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052 +\n                                                                           offset_236095)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236083 = x_236077 +\n                                       x_236080;\n                                double defunc_1_op_res_236084 = x_236078 +\n                                       x_236081;\n                                double defunc_1_op_res_236085 = x_236079 +\n                                       x_236082;\n                                \n                                x_236077 = defunc_1_op_res_236083;\n                                x_236078 = defunc_1_op_res_236084;\n                                x_236079 = defunc_1_op_res_236085;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052)] =\n                                    x_236077;\n                                ((volatile __local\n                                  double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052)] =\n                                    x_236078;\n                                ((volatile __local\n                                  double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052)] =\n                                    x_236079;\n                            }\n                        }\n                        offset_236095 *= 2;\n                    }\n                   ",
            " while (slt32(skip_waves_236096,\n                                 squot32(sext_i64_i32(segred_group_sizze_224316) +\n                                         wave_sizze_236054 - 1,\n                                         wave_sizze_236054))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236095 = skip_waves_236096 * wave_sizze_236054;\n                        if (slt32(local_tid_236052 + offset_236095,\n                                  sext_i64_i32(segred_group_sizze_224316)) &&\n                            ((local_tid_236052 - squot32(local_tid_236052,\n                                                         wave_sizze_236054) *\n                              wave_sizze_236054) == 0 &&\n                             (squot32(local_tid_236052, wave_sizze_236054) &\n                              (2 * skip_waves_236096 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236080 = ((__local\n                                             double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052 +\n                                                                           offset_236095)];\n                                x_236081 = ((__local\n                                             double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052 +\n                                                                           offset_236095)];\n                                x_236082 = ((__local\n                                             double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052 +\n                                                                           offset_236095)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236083 = x_236077 +\n                                       x_236080;\n                                double defunc",
            "_1_op_res_236084 = x_236078 +\n                                       x_236081;\n                                double defunc_1_op_res_236085 = x_236079 +\n                                       x_236082;\n                                \n                                x_236077 = defunc_1_op_res_236083;\n                                x_236078 = defunc_1_op_res_236084;\n                                x_236079 = defunc_1_op_res_236085;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236056)[sext_i32_i64(local_tid_236052)] =\n                                    x_236077;\n                                ((__local\n                                  double *) red_arr_mem_236058)[sext_i32_i64(local_tid_236052)] =\n                                    x_236078;\n                                ((__local\n                                  double *) red_arr_mem_236060)[sext_i32_i64(local_tid_236052)] =\n                                    x_236079;\n                            }\n                        }\n                        skip_waves_236096 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236052 == 0) {\n                            ((__global double *) mem_231277)[gtid_224322 *\n                                                             t_n_m_203740 +\n                                                             gtid_224323] =\n                                x_236077;\n                            ((__global double *) mem_231281)[gtid_224322 *\n                                                             t_n_m_203740 +\n                                                             gtid_224323] =\n                                x_236078;\n                            ((__global double *) mem_231285)[gtid_224322 *\n          ",
            "                                                   t_n_m_203740 +\n                                                             gtid_224323] =\n                                x_236079;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224316\n}\n__kernel void mainzisegred_large_224397(__global int *global_failure,\n                                        uint sync_arr_mem_236162_backing_offset_0,\n                                        uint red_arr_mem_236160_backing_offset_1,\n                                        uint red_arr_mem_236158_backing_offset_2,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224390,\n                                        int64_t groups_per_segment_236142,\n                                        int64_t elements_per_thread_236143,\n                                        int64_t virt_num_groups_236144,\n                                        int64_t threads_per_segment_236146,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231263,\n                                        __global unsigned char *mem_231290,\n                                        __global unsigned char *mem_",
            "231294,\n                                        __global unsigned char *mem_231298,\n                                        __global unsigned char *mem_231303,\n                                        __global unsigned char *mem_231307,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236147,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236149,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236151)\n{\n    #define segred_group_sizze_224389 (mainzisegred_group_sizze_223748)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236162_backing_2 =\n                           &shared_mem[sync_arr_mem_236162_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236160_backing_1 =\n                           &shared_mem[red_arr_mem_236160_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236158_backing_0 =\n                           &shared_mem[red_arr_mem_236158_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236153;\n    int32_t local_tid_236154;\n    int64_t group_sizze_236157;\n    int32_t wave_sizze_236156;\n    int32_t group_tid_236155;\n    \n    global_tid_236153 = get_global_id(0);\n    local_tid_236154 = get_local_id(0);\n    group_sizze_236157 = get_local_size(0);\n    wave_sizze_236156 = LOCKSTEP_WIDTH;\n    group_tid_236155 = get_group_id(0);\n    \n    int32_t phys_tid_224397 = global_tid_236153;\n    __local unsigned char *red_arr_mem_236158;\n    \n    red_arr_mem_236158 = (__local unsigned char *) red_arr_mem_236158_backing_0;\n    \n    __local unsigned char *red_arr_mem_236160;\n    \n    red_arr_mem_236160 = (__local unsigned char *) red_arr_mem_236160_backing_1;\n    \n    __local unsigned char *sync_arr_mem_236162;\n  ",
            "  \n    sync_arr_mem_236162 = (__local\n                           unsigned char *) sync_arr_mem_236162_backing_2;\n    \n    int32_t phys_group_id_236164;\n    \n    phys_group_id_236164 = get_group_id(0);\n    for (int32_t i_236165 = 0; i_236165 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236144) - phys_group_id_236164,\n                   sext_i64_i32(num_groups_224390)); i_236165++) {\n        int32_t virt_group_id_236166 = phys_group_id_236164 + i_236165 *\n                sext_i64_i32(num_groups_224390);\n        int32_t flat_segment_id_236167 = squot32(virt_group_id_236166,\n                                                 sext_i64_i32(groups_per_segment_236142));\n        int64_t global_tid_236168 = srem64(sext_i32_i64(virt_group_id_236166) *\n                                           segred_group_sizze_224389 +\n                                           sext_i32_i64(local_tid_236154),\n                                           segred_group_sizze_224389 *\n                                           groups_per_segment_236142);\n        int64_t slice_236169 = t_n_m_203740;\n        int64_t slice_236170 = partition_sizze_203667 * slice_236169;\n        int64_t gtid_224394 = squot64(sext_i32_i64(flat_segment_id_236167),\n                                      slice_236169);\n        int64_t remnant_236171 = sext_i32_i64(flat_segment_id_236167) -\n                gtid_224394 * slice_236169;\n        int64_t gtid_224395 = remnant_236171;\n        int64_t remnant_236172 = remnant_236171 - gtid_224395;\n        int64_t gtid_224396;\n        double x_acc_236173;\n        double x_acc_236174;\n        int64_t chunk_sizze_236175 = smin64(elements_per_thread_236143,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_236168,\n                                                      threads_per_segment_236146));\n        double x_224398;\n        double x_224399;\n        double x_224400;\n        double x_224401;\n      ",
            "  \n        // neutral-initialise the accumulators\n        {\n            x_acc_236173 = 0.0;\n            x_acc_236174 = 0.0;\n        }\n        for (int64_t i_236182 = 0; i_236182 < chunk_sizze_236175; i_236182++) {\n            gtid_224396 = global_tid_236168 + threads_per_segment_236146 *\n                i_236182;\n            // apply map function\n            {\n                int64_t x_224405;\n                \n                x_224405 = ((__global int64_t *) ext_mem_229304)[gtid_224394];\n                \n                int64_t x_224414;\n                \n                x_224414 = ((__global int64_t *) ext_mem_229569)[gtid_224394 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224395];\n                \n                double x_224415;\n                \n                x_224415 = ((__global double *) ext_mem_229568)[gtid_224394 *\n                                                                t_n_m_203740 +\n                                                                gtid_224395];\n                \n                int64_t binop_y_228755 = mul64(jump_t_203582, gtid_224395);\n                int64_t binop_y_228756 = smin64(i_203760, binop_y_228755);\n                int64_t index_primexp_228757 = add64((int64_t) 1,\n                                                     binop_y_228756);\n                double a11_224417;\n                \n                a11_224417 = ((__global double *) mem_231290)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                double b11_224418;\n                \n                b11_224418 = ((__global double *) mem_231294)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                ",
            "\n                double c11_224419;\n                \n                c11_224419 = ((__global double *) mem_231298)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                bool cond_224421 = sle64(x_224405, gtid_224396);\n                int64_t defunc_0_f_res_224422;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224422 = (int64_t) 0;\n                } else {\n                    int64_t i_224423 = add64(gtid_224396, x_224414);\n                    int64_t defunc_0_add_arg_224424;\n                    \n                    defunc_0_add_arg_224424 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224394 *\n                                                                           n_203572 +\n                                                                           i_224423];\n                    \n                    int64_t defunc_1_add_res_224425 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224424);\n                    \n                    defunc_0_f_res_224422 = defunc_1_add_res_224425;\n                }\n                \n                double defunc_0_f_res_224426;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224426 = 0.0;\n                } else {\n                    int64_t i_224427 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224428;\n                    \n                    defunc_0_add_arg_224428 = ((__global\n                                                double *) mem_231259)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224427];\n                    defunc_0_f_res_224426 = defunc_0_add_arg_224428;\n   ",
            "             }\n                \n                int64_t binop_p_224429 = sub64(defunc_0_f_res_224422,\n                                               index_primexp_228757);\n                double defunc_0_f_res_224430 = sitofp_i64_f64(binop_p_224429);\n                double abs_res_224431 = fabs(defunc_0_f_res_224430);\n                double tmp1_224432 = abs_res_224431 / x_224415;\n                double x_224433 = tmp1_224432 * tmp1_224432;\n                double y_224434 = tmp1_224432 * x_224433;\n                double tmp2_224435 = 1.0 - y_224434;\n                double x_224436 = tmp2_224435 * tmp2_224435;\n                double tmp3_224437 = tmp2_224435 * x_224436;\n                double tmp4_224438 = defunc_0_f_res_224426 * tmp3_224437;\n                double defunc_1_f_res_224439 = defunc_0_f_res_224430 *\n                       tmp4_224438;\n                double defunc_0_f_res_224440;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224440 = 0.0;\n                } else {\n                    int64_t i_224441 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224442;\n                    \n                    defunc_0_add_arg_224442 = ((__global\n                                                double *) mem_231263)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224441];\n                    defunc_0_f_res_224440 = defunc_0_add_arg_224442;\n                }\n                \n                double x_224443 = a11_224417 * tmp4_224438;\n                double y_224444 = b11_224418 * defunc_1_f_res_224439;\n                double x_224445 = x_224443 + y_224444;\n                double defunc_9_fit_fun_res_224446 = defunc_0_f_res_224440 *\n                       x_224445;\n                double x_224447 = b11_224418 * tmp4_224438;\n                double y_224448 = c11_224419 * defunc_1_f_res_224",
            "439;\n                double x_224449 = x_224447 + y_224448;\n                double defunc_9_slope_fun_res_224450 = defunc_0_f_res_224440 *\n                       x_224449;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_224398 = x_acc_236173;\n                    x_224399 = x_acc_236174;\n                }\n                // load new values\n                {\n                    x_224400 = defunc_9_fit_fun_res_224446;\n                    x_224401 = defunc_9_slope_fun_res_224450;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224402 = x_224398 + x_224400;\n                    double defunc_1_op_res_224403 = x_224399 + x_224401;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236173 = defunc_1_op_res_224402;\n                        x_acc_236174 = defunc_1_op_res_224403;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224398 = x_acc_236173;\n            x_224399 = x_acc_236174;\n            ((__local\n              double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154)] =\n                x_224398;\n            ((__local\n              double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154)] =\n                x_224399;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236183;\n        int32_t skip_waves_236184 = 1;\n        double x_236176;\n        double x_236177;\n        double x_236178;\n        double x_236179;\n        \n        offset_236183 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236154,\n                      sext_i64_i32(segred_group_sizze_224389))) {\n                x_236176 = ((__local\n                             dou",
            "ble *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154 +\n                                                           offset_236183)];\n                x_236177 = ((__local\n                             double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154 +\n                                                           offset_236183)];\n            }\n        }\n        offset_236183 = 1;\n        while (slt32(offset_236183, wave_sizze_236156)) {\n            if (slt32(local_tid_236154 + offset_236183,\n                      sext_i64_i32(segred_group_sizze_224389)) &&\n                ((local_tid_236154 - squot32(local_tid_236154,\n                                             wave_sizze_236156) *\n                  wave_sizze_236156) & (2 * offset_236183 - 1)) == 0) {\n                // read array element\n                {\n                    x_236178 = ((volatile __local\n                                 double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154 +\n                                                               offset_236183)];\n                    x_236179 = ((volatile __local\n                                 double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154 +\n                                                               offset_236183)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236180 = x_236176 + x_236178;\n                    double defunc_1_op_res_236181 = x_236177 + x_236179;\n                    \n                    x_236176 = defunc_1_op_res_236180;\n                    x_236177 = defunc_1_op_res_236181;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154)] =\n                        x_236176;\n                    ((volatile __local\n                      double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154)] =\n",
            "                        x_236177;\n                }\n            }\n            offset_236183 *= 2;\n        }\n        while (slt32(skip_waves_236184,\n                     squot32(sext_i64_i32(segred_group_sizze_224389) +\n                             wave_sizze_236156 - 1, wave_sizze_236156))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236183 = skip_waves_236184 * wave_sizze_236156;\n            if (slt32(local_tid_236154 + offset_236183,\n                      sext_i64_i32(segred_group_sizze_224389)) &&\n                ((local_tid_236154 - squot32(local_tid_236154,\n                                             wave_sizze_236156) *\n                  wave_sizze_236156) == 0 && (squot32(local_tid_236154,\n                                                      wave_sizze_236156) & (2 *\n                                                                            skip_waves_236184 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236178 = ((__local\n                                 double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154 +\n                                                               offset_236183)];\n                    x_236179 = ((__local\n                                 double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154 +\n                                                               offset_236183)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236180 = x_236176 + x_236178;\n                    double defunc_1_op_res_236181 = x_236177 + x_236179;\n                    \n                    x_236176 = defunc_1_op_res_236180;\n                    x_236177 = defunc_1_op_res_236181;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red",
            "_arr_mem_236158)[sext_i32_i64(local_tid_236154)] =\n                        x_236176;\n                    ((__local\n                      double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154)] =\n                        x_236177;\n                }\n            }\n            skip_waves_236184 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236154) == (int64_t) 0) {\n                x_acc_236173 = x_236176;\n                x_acc_236174 = x_236177;\n            }\n        }\n        if (groups_per_segment_236142 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236154 == 0) {\n                    ((__global double *) mem_231303)[gtid_224394 *\n                                                     t_n_m_203740 +\n                                                     gtid_224395] =\n                        x_acc_236173;\n                    ((__global double *) mem_231307)[gtid_224394 *\n                                                     t_n_m_203740 +\n                                                     gtid_224395] =\n                        x_acc_236174;\n                }\n            }\n        } else {\n            int32_t old_counter_236185;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236154 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236147)[sext_i32_i64(virt_group_id_236166)] =\n                        x_acc_236173;\n                    ((__global\n                      double *) segred_tmp_mem_236149)[sext_i32_i64(virt_group_id_236166)] =\n                        x_acc_236174;\n                    mem_fence_global();\n                    old_counter_236185 =\n                        atomic_add_i32_global(&((volatile __global\n                                           ",
            "      int *) mainzicounter_mem_236151)[sext_i32_i64(srem32(flat_segment_id_236167,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236162)[(int64_t) 0] =\n                        old_counter_236185 == groups_per_segment_236142 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236186;\n            \n            is_last_group_236186 = ((__local\n                                     bool *) sync_arr_mem_236162)[(int64_t) 0];\n            if (is_last_group_236186) {\n                if (local_tid_236154 == 0) {\n                    old_counter_236185 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236151)[sext_i32_i64(srem32(flat_segment_id_236167,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236142));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236187 =\n                            sdiv_up64(groups_per_segment_236142,\n                                      segred_group_sizze_224389);\n                    \n                    x_224398 = 0.0;\n                    x_224399 = 0.0;\n                    for (int64_t i_236188 = 0; i_236188 <\n                         read_per_thread_236187; i_236188++) {\n                        int64_t group_res_id_236189 =\n                                sext_i32_i64(local_tid_236154) *\n                                read_per_thread_236187 + i_236188;\n                        int6",
            "4_t index_of_group_res_236190 =\n                                sext_i32_i64(flat_segment_id_236167) *\n                                groups_per_segment_236142 + group_res_id_236189;\n                        \n                        if (slt64(group_res_id_236189,\n                                  groups_per_segment_236142)) {\n                            x_224400 = ((__global\n                                         double *) segred_tmp_mem_236147)[index_of_group_res_236190];\n                            x_224401 = ((__global\n                                         double *) segred_tmp_mem_236149)[index_of_group_res_236190];\n                            \n                            double defunc_1_op_res_224402 = x_224398 + x_224400;\n                            double defunc_1_op_res_224403 = x_224399 + x_224401;\n                            \n                            x_224398 = defunc_1_op_res_224402;\n                            x_224399 = defunc_1_op_res_224403;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154)] =\n                    x_224398;\n                ((__local\n                  double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154)] =\n                    x_224399;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236191;\n                    int32_t skip_waves_236192 = 1;\n                    double x_236176;\n                    double x_236177;\n                    double x_236178;\n                    double x_236179;\n                    \n                    offset_236191 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236154,\n                                  sext_i64_i32(segred_group_sizze_224389))) {\n                            x_236176 = ((__l",
            "ocal\n                                         double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154 +\n                                                                       offset_236191)];\n                            x_236177 = ((__local\n                                         double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154 +\n                                                                       offset_236191)];\n                        }\n                    }\n                    offset_236191 = 1;\n                    while (slt32(offset_236191, wave_sizze_236156)) {\n                        if (slt32(local_tid_236154 + offset_236191,\n                                  sext_i64_i32(segred_group_sizze_224389)) &&\n                            ((local_tid_236154 - squot32(local_tid_236154,\n                                                         wave_sizze_236156) *\n                              wave_sizze_236156) & (2 * offset_236191 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236178 = ((volatile __local\n                                             double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154 +\n                                                                           offset_236191)];\n                                x_236179 = ((volatile __local\n                                             double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154 +\n                                                                           offset_236191)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236180 = x_236176 +\n                                       x_236178;\n                                double defunc_1_op_res_236181 = x_236177 +\n                                       x_236179;\n                             ",
            "   \n                                x_236176 = defunc_1_op_res_236180;\n                                x_236177 = defunc_1_op_res_236181;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154)] =\n                                    x_236176;\n                                ((volatile __local\n                                  double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154)] =\n                                    x_236177;\n                            }\n                        }\n                        offset_236191 *= 2;\n                    }\n                    while (slt32(skip_waves_236192,\n                                 squot32(sext_i64_i32(segred_group_sizze_224389) +\n                                         wave_sizze_236156 - 1,\n                                         wave_sizze_236156))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236191 = skip_waves_236192 * wave_sizze_236156;\n                        if (slt32(local_tid_236154 + offset_236191,\n                                  sext_i64_i32(segred_group_sizze_224389)) &&\n                            ((local_tid_236154 - squot32(local_tid_236154,\n                                                         wave_sizze_236156) *\n                              wave_sizze_236156) == 0 &&\n                             (squot32(local_tid_236154, wave_sizze_236156) &\n                              (2 * skip_waves_236192 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236178 = ((__local\n                                             double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154 +\n                                                                           offset_236191)];\n    ",
            "                            x_236179 = ((__local\n                                             double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154 +\n                                                                           offset_236191)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236180 = x_236176 +\n                                       x_236178;\n                                double defunc_1_op_res_236181 = x_236177 +\n                                       x_236179;\n                                \n                                x_236176 = defunc_1_op_res_236180;\n                                x_236177 = defunc_1_op_res_236181;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236158)[sext_i32_i64(local_tid_236154)] =\n                                    x_236176;\n                                ((__local\n                                  double *) red_arr_mem_236160)[sext_i32_i64(local_tid_236154)] =\n                                    x_236177;\n                            }\n                        }\n                        skip_waves_236192 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236154 == 0) {\n                            ((__global double *) mem_231303)[gtid_224394 *\n                                                             t_n_m_203740 +\n                                                             gtid_224395] =\n                                x_236176;\n                            ((__global double *) mem_231307)[gtid_224394 *\n                                                             t_n_m_203740 +\n                                              ",
            "               gtid_224395] =\n                                x_236177;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224389\n}\n__kernel void mainzisegred_large_225613(__global int *global_failure,\n                                        uint sync_arr_mem_236359_backing_offset_0,\n                                        uint red_arr_mem_236357_backing_offset_1,\n                                        uint red_arr_mem_236355_backing_offset_2,\n                                        uint red_arr_mem_236353_backing_offset_3,\n                                        uint red_arr_mem_236351_backing_offset_4,\n                                        uint red_arr_mem_236349_backing_offset_5,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225603,\n                                        int64_t groups_per_segment_236327,\n                                        int64_t elements_per_thread_236328,\n                                        int64_t virt_num_groups_236329,\n                                        int64_t threads_per_segment_236331,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231446,\n          ",
            "                              __global unsigned char *mem_231450,\n                                        __global unsigned char *mem_231454,\n                                        __global unsigned char *mem_231458,\n                                        __global unsigned char *mem_231462,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236332,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236334,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236336,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236338,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236340,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236342)\n{\n    #define segred_group_sizze_225602 (mainzisegred_group_sizze_225051)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236359_backing_5 =\n                           &shared_mem[sync_arr_mem_236359_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236357_backing_4 =\n                           &shared_mem[red_arr_mem_236357_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236355_backing_3 =\n                           &shared_mem[red_arr_mem_236355_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236353_backing_2 =\n                           &shared_mem[red_arr_mem_236353_backing_offset_3];\n    volatile unsigned char *red_arr_mem_236351_backing_1 =\n                           &shared_mem[red_arr_mem_236351_backing_offset_4];\n    volatile unsigned char *red_arr_mem_236349_backing_0 =\n                           &sha",
            "red_mem[red_arr_mem_236349_backing_offset_5];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236344;\n    int32_t local_tid_236345;\n    int64_t group_sizze_236348;\n    int32_t wave_sizze_236347;\n    int32_t group_tid_236346;\n    \n    global_tid_236344 = get_global_id(0);\n    local_tid_236345 = get_local_id(0);\n    group_sizze_236348 = get_local_size(0);\n    wave_sizze_236347 = LOCKSTEP_WIDTH;\n    group_tid_236346 = get_group_id(0);\n    \n    int32_t phys_tid_225613 = global_tid_236344;\n    __local unsigned char *red_arr_mem_236349;\n    \n    red_arr_mem_236349 = (__local unsigned char *) red_arr_mem_236349_backing_0;\n    \n    __local unsigned char *red_arr_mem_236351;\n    \n    red_arr_mem_236351 = (__local unsigned char *) red_arr_mem_236351_backing_1;\n    \n    __local unsigned char *red_arr_mem_236353;\n    \n    red_arr_mem_236353 = (__local unsigned char *) red_arr_mem_236353_backing_2;\n    \n    __local unsigned char *red_arr_mem_236355;\n    \n    red_arr_mem_236355 = (__local unsigned char *) red_arr_mem_236355_backing_3;\n    \n    __local unsigned char *red_arr_mem_236357;\n    \n    red_arr_mem_236357 = (__local unsigned char *) red_arr_mem_236357_backing_4;\n    \n    __local unsigned char *sync_arr_mem_236359;\n    \n    sync_arr_mem_236359 = (__local\n                           unsigned char *) sync_arr_mem_236359_backing_5;\n    \n    int32_t phys_group_id_236361;\n    \n    phys_group_id_236361 = get_group_id(0);\n    for (int32_t i_236362 = 0; i_236362 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236329) - phys_group_id_236361,\n                   sext_i64_i32(num_groups_225603)); i_236362++) {\n        int32_t virt_group_id_236363 = phys_group_id_236361 + i_236362 *\n                sext_i64_i32(num_groups_225603);\n        int32_t flat_segment_id_236364 = squot32(virt_group_id_236363,\n                                                 sext_i64_i32(groups_per_segment_236327));\n        int64_t global_tid_236365 = srem64(sext_i32_i64(virt_grou",
            "p_id_236363) *\n                                           segred_group_sizze_225602 +\n                                           sext_i32_i64(local_tid_236345),\n                                           segred_group_sizze_225602 *\n                                           groups_per_segment_236327);\n        int64_t slice_236366 = t_n_m_203740;\n        int64_t slice_236367 = partition_sizze_203667 * slice_236366;\n        int64_t gtid_225610 = squot64(sext_i32_i64(flat_segment_id_236364),\n                                      slice_236366);\n        int64_t remnant_236368 = sext_i32_i64(flat_segment_id_236364) -\n                gtid_225610 * slice_236366;\n        int64_t gtid_225611 = remnant_236368;\n        int64_t remnant_236369 = remnant_236368 - gtid_225611;\n        int64_t gtid_225612;\n        double x_acc_236370;\n        double x_acc_236371;\n        double x_acc_236372;\n        double x_acc_236373;\n        double x_acc_236374;\n        int64_t chunk_sizze_236375 = smin64(elements_per_thread_236328,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_236365,\n                                                      threads_per_segment_236331));\n        double x_225614;\n        double x_225615;\n        double x_225616;\n        double x_225617;\n        double x_225618;\n        double x_225619;\n        double x_225620;\n        double x_225621;\n        double x_225622;\n        double x_225623;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236370 = 0.0;\n            x_acc_236371 = 0.0;\n            x_acc_236372 = 0.0;\n            x_acc_236373 = 0.0;\n            x_acc_236374 = 0.0;\n        }\n        for (int64_t i_236391 = 0; i_236391 < chunk_sizze_236375; i_236391++) {\n            gtid_225612 = global_tid_236365 + threads_per_segment_236331 *\n                i_236391;\n            // apply map function\n            {\n                int64_t x_225630;\n         ",
            "       \n                x_225630 = ((__global int64_t *) ext_mem_229304)[gtid_225610];\n                \n                int64_t x_225635;\n                \n                x_225635 = ((__global int64_t *) ext_mem_229569)[gtid_225610 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225611];\n                \n                double x_225636;\n                \n                x_225636 = ((__global double *) ext_mem_229568)[gtid_225610 *\n                                                                t_n_m_203740 +\n                                                                gtid_225611];\n                \n                int64_t binop_y_228770 = mul64(jump_t_203582, gtid_225611);\n                int64_t binop_y_228771 = smin64(i_203760, binop_y_228770);\n                int64_t index_primexp_228772 = add64((int64_t) 1,\n                                                     binop_y_228771);\n                bool cond_225639 = sle64(x_225630, gtid_225612);\n                int64_t defunc_0_f_res_225640;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225640 = (int64_t) 0;\n                } else {\n                    int64_t i_225641 = add64(gtid_225612, x_225635);\n                    int64_t defunc_0_add_arg_225642;\n                    \n                    defunc_0_add_arg_225642 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225610 *\n                                                                           n_203572 +\n                                                                           i_225641];\n                    \n                    int64_t defunc_1_add_res_225643 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225642);\n                    \n                    defunc_0_f_res_225640 = defunc_1_add_res_225643;\n                }\n      ",
            "          \n                double defunc_0_f_res_225644;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225644 = 0.0;\n                } else {\n                    int64_t i_225645 = add64(gtid_225612, x_225635);\n                    double defunc_0_add_arg_225646;\n                    \n                    defunc_0_add_arg_225646 = ((__global\n                                                double *) mem_231428)[gtid_225610 *\n                                                                      n_203572 +\n                                                                      i_225645];\n                    defunc_0_f_res_225644 = defunc_0_add_arg_225646;\n                }\n                \n                int64_t binop_p_225647 = sub64(defunc_0_f_res_225640,\n                                               index_primexp_228772);\n                double defunc_0_f_res_225648 = sitofp_i64_f64(binop_p_225647);\n                double abs_res_225649 = fabs(defunc_0_f_res_225648);\n                double tmp1_225650 = abs_res_225649 / x_225636;\n                double x_225651 = tmp1_225650 * tmp1_225650;\n                double y_225652 = tmp1_225650 * x_225651;\n                double tmp2_225653 = 1.0 - y_225652;\n                double x_225654 = tmp2_225653 * tmp2_225653;\n                double tmp3_225655 = tmp2_225653 * x_225654;\n                double w_j_225656 = defunc_0_f_res_225644 * tmp3_225655;\n                double xw_j_225657 = defunc_0_f_res_225648 * w_j_225656;\n                double x2w_j_225658 = defunc_0_f_res_225648 * xw_j_225657;\n                double x3w_j_225659 = defunc_0_f_res_225648 * x2w_j_225658;\n                double x4w_j_225660 = defunc_0_f_res_225648 * x3w_j_225659;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225614 = x_acc_236370;\n                    x_225615 = x_acc_236371;\n                    x_225616",
            " = x_acc_236372;\n                    x_225617 = x_acc_236373;\n                    x_225618 = x_acc_236374;\n                }\n                // load new values\n                {\n                    x_225619 = w_j_225656;\n                    x_225620 = xw_j_225657;\n                    x_225621 = x2w_j_225658;\n                    x_225622 = x3w_j_225659;\n                    x_225623 = x4w_j_225660;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225624 = x_225614 + x_225619;\n                    double defunc_1_op_res_225625 = x_225615 + x_225620;\n                    double defunc_1_op_res_225626 = x_225616 + x_225621;\n                    double defunc_1_op_res_225627 = x_225617 + x_225622;\n                    double defunc_1_op_res_225628 = x_225618 + x_225623;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236370 = defunc_1_op_res_225624;\n                        x_acc_236371 = defunc_1_op_res_225625;\n                        x_acc_236372 = defunc_1_op_res_225626;\n                        x_acc_236373 = defunc_1_op_res_225627;\n                        x_acc_236374 = defunc_1_op_res_225628;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225614 = x_acc_236370;\n            x_225615 = x_acc_236371;\n            x_225616 = x_acc_236372;\n            x_225617 = x_acc_236373;\n            x_225618 = x_acc_236374;\n            ((__local\n              double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345)] =\n                x_225614;\n            ((__local\n              double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345)] =\n                x_225615;\n            ((__local\n              double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345)] =\n                x_225616;\n            ((__local\n              double *) r",
            "ed_arr_mem_236355)[sext_i32_i64(local_tid_236345)] =\n                x_225617;\n            ((__local\n              double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345)] =\n                x_225618;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236392;\n        int32_t skip_waves_236393 = 1;\n        double x_236376;\n        double x_236377;\n        double x_236378;\n        double x_236379;\n        double x_236380;\n        double x_236381;\n        double x_236382;\n        double x_236383;\n        double x_236384;\n        double x_236385;\n        \n        offset_236392 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236345,\n                      sext_i64_i32(segred_group_sizze_225602))) {\n                x_236376 = ((__local\n                             double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345 +\n                                                           offset_236392)];\n                x_236377 = ((__local\n                             double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345 +\n                                                           offset_236392)];\n                x_236378 = ((__local\n                             double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345 +\n                                                           offset_236392)];\n                x_236379 = ((__local\n                             double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345 +\n                                                           offset_236392)];\n                x_236380 = ((__local\n                             double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345 +\n                                                           offset_236392)];\n            }\n        }\n        offset_236392 = 1;\n        while (slt32(offset_236392, wave_sizze_236347)) {\n            if (slt32(local_tid_236345 + offset_236392,\n                      s",
            "ext_i64_i32(segred_group_sizze_225602)) &&\n                ((local_tid_236345 - squot32(local_tid_236345,\n                                             wave_sizze_236347) *\n                  wave_sizze_236347) & (2 * offset_236392 - 1)) == 0) {\n                // read array element\n                {\n                    x_236381 = ((volatile __local\n                                 double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236382 = ((volatile __local\n                                 double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236383 = ((volatile __local\n                                 double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236384 = ((volatile __local\n                                 double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236385 = ((volatile __local\n                                 double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236386 = x_236376 + x_236381;\n                    double defunc_1_op_res_236387 = x_236377 + x_236382;\n                    double defunc_1_op_res_236388 = x_236378 + x_236383;\n                    double defunc_1_op_res_236389 = x_236379 + x_236384;\n                    double defunc_1_op_res_236390 = x_236380 + x_236385;\n                    \n                    x_236376 = defunc_1_op_res_236386;\n                    x_236377 = defunc_1_op_res_236387",
            ";\n                    x_236378 = defunc_1_op_res_236388;\n                    x_236379 = defunc_1_op_res_236389;\n                    x_236380 = defunc_1_op_res_236390;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345)] =\n                        x_236376;\n                    ((volatile __local\n                      double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345)] =\n                        x_236377;\n                    ((volatile __local\n                      double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345)] =\n                        x_236378;\n                    ((volatile __local\n                      double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345)] =\n                        x_236379;\n                    ((volatile __local\n                      double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345)] =\n                        x_236380;\n                }\n            }\n            offset_236392 *= 2;\n        }\n        while (slt32(skip_waves_236393,\n                     squot32(sext_i64_i32(segred_group_sizze_225602) +\n                             wave_sizze_236347 - 1, wave_sizze_236347))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236392 = skip_waves_236393 * wave_sizze_236347;\n            if (slt32(local_tid_236345 + offset_236392,\n                      sext_i64_i32(segred_group_sizze_225602)) &&\n                ((local_tid_236345 - squot32(local_tid_236345,\n                                             wave_sizze_236347) *\n                  wave_sizze_236347) == 0 && (squot32(local_tid_236345,\n                                                      wave_sizze_236347) & (2 *\n                                                                            skip_waves_236393 -\n                                                                            1)) ==\n      ",
            "           0)) {\n                // read array element\n                {\n                    x_236381 = ((__local\n                                 double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236382 = ((__local\n                                 double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236383 = ((__local\n                                 double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236384 = ((__local\n                                 double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                    x_236385 = ((__local\n                                 double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345 +\n                                                               offset_236392)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236386 = x_236376 + x_236381;\n                    double defunc_1_op_res_236387 = x_236377 + x_236382;\n                    double defunc_1_op_res_236388 = x_236378 + x_236383;\n                    double defunc_1_op_res_236389 = x_236379 + x_236384;\n                    double defunc_1_op_res_236390 = x_236380 + x_236385;\n                    \n                    x_236376 = defunc_1_op_res_236386;\n                    x_236377 = defunc_1_op_res_236387;\n                    x_236378 = defunc_1_op_res_236388;\n                    x_236379 = defunc_1_op_res_236389;\n                    x_236380 = defunc_1_op_res_236390;\n                }\n                // write result of operation\n                {\n                    ((__",
            "local\n                      double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345)] =\n                        x_236376;\n                    ((__local\n                      double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345)] =\n                        x_236377;\n                    ((__local\n                      double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345)] =\n                        x_236378;\n                    ((__local\n                      double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345)] =\n                        x_236379;\n                    ((__local\n                      double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345)] =\n                        x_236380;\n                }\n            }\n            skip_waves_236393 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236345) == (int64_t) 0) {\n                x_acc_236370 = x_236376;\n                x_acc_236371 = x_236377;\n                x_acc_236372 = x_236378;\n                x_acc_236373 = x_236379;\n                x_acc_236374 = x_236380;\n            }\n        }\n        if (groups_per_segment_236327 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236345 == 0) {\n                    ((__global double *) mem_231446)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236370;\n                    ((__global double *) mem_231450)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236371;\n                    ((__global double *) mem_231454)[gtid_225610 *\n                                                     t_n_m_203740 +\n",
            "                                                     gtid_225611] =\n                        x_acc_236372;\n                    ((__global double *) mem_231458)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236373;\n                    ((__global double *) mem_231462)[gtid_225610 *\n                                                     t_n_m_203740 +\n                                                     gtid_225611] =\n                        x_acc_236374;\n                }\n            }\n        } else {\n            int32_t old_counter_236394;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236345 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236332)[sext_i32_i64(virt_group_id_236363)] =\n                        x_acc_236370;\n                    ((__global\n                      double *) segred_tmp_mem_236334)[sext_i32_i64(virt_group_id_236363)] =\n                        x_acc_236371;\n                    ((__global\n                      double *) segred_tmp_mem_236336)[sext_i32_i64(virt_group_id_236363)] =\n                        x_acc_236372;\n                    ((__global\n                      double *) segred_tmp_mem_236338)[sext_i32_i64(virt_group_id_236363)] =\n                        x_acc_236373;\n                    ((__global\n                      double *) segred_tmp_mem_236340)[sext_i32_i64(virt_group_id_236363)] =\n                        x_acc_236374;\n                    mem_fence_global();\n                    old_counter_236394 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236342)[sext_i32_i64(srem32(flat_segment_id_236364,\n                                                                                              ",
            "        10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236359)[(int64_t) 0] =\n                        old_counter_236394 == groups_per_segment_236327 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236395;\n            \n            is_last_group_236395 = ((__local\n                                     bool *) sync_arr_mem_236359)[(int64_t) 0];\n            if (is_last_group_236395) {\n                if (local_tid_236345 == 0) {\n                    old_counter_236394 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236342)[sext_i32_i64(srem32(flat_segment_id_236364,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236327));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236396 =\n                            sdiv_up64(groups_per_segment_236327,\n                                      segred_group_sizze_225602);\n                    \n                    x_225614 = 0.0;\n                    x_225615 = 0.0;\n                    x_225616 = 0.0;\n                    x_225617 = 0.0;\n                    x_225618 = 0.0;\n                    for (int64_t i_236397 = 0; i_236397 <\n                         read_per_thread_236396; i_236397++) {\n                        int64_t group_res_id_236398 =\n                                sext_i32_i64(local_tid_236345) *\n                                read_per_thread_236396 + i_236397;\n                        int64_t index_of_group_res_236399 =\n                                sext_",
            "i32_i64(flat_segment_id_236364) *\n                                groups_per_segment_236327 + group_res_id_236398;\n                        \n                        if (slt64(group_res_id_236398,\n                                  groups_per_segment_236327)) {\n                            x_225619 = ((__global\n                                         double *) segred_tmp_mem_236332)[index_of_group_res_236399];\n                            x_225620 = ((__global\n                                         double *) segred_tmp_mem_236334)[index_of_group_res_236399];\n                            x_225621 = ((__global\n                                         double *) segred_tmp_mem_236336)[index_of_group_res_236399];\n                            x_225622 = ((__global\n                                         double *) segred_tmp_mem_236338)[index_of_group_res_236399];\n                            x_225623 = ((__global\n                                         double *) segred_tmp_mem_236340)[index_of_group_res_236399];\n                            \n                            double defunc_1_op_res_225624 = x_225614 + x_225619;\n                            double defunc_1_op_res_225625 = x_225615 + x_225620;\n                            double defunc_1_op_res_225626 = x_225616 + x_225621;\n                            double defunc_1_op_res_225627 = x_225617 + x_225622;\n                            double defunc_1_op_res_225628 = x_225618 + x_225623;\n                            \n                            x_225614 = defunc_1_op_res_225624;\n                            x_225615 = defunc_1_op_res_225625;\n                            x_225616 = defunc_1_op_res_225626;\n                            x_225617 = defunc_1_op_res_225627;\n                            x_225618 = defunc_1_op_res_225628;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345)] =\n                    x_225614;",
            "\n                ((__local\n                  double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345)] =\n                    x_225615;\n                ((__local\n                  double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345)] =\n                    x_225616;\n                ((__local\n                  double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345)] =\n                    x_225617;\n                ((__local\n                  double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345)] =\n                    x_225618;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236400;\n                    int32_t skip_waves_236401 = 1;\n                    double x_236376;\n                    double x_236377;\n                    double x_236378;\n                    double x_236379;\n                    double x_236380;\n                    double x_236381;\n                    double x_236382;\n                    double x_236383;\n                    double x_236384;\n                    double x_236385;\n                    \n                    offset_236400 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236345,\n                                  sext_i64_i32(segred_group_sizze_225602))) {\n                            x_236376 = ((__local\n                                         double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345 +\n                                                                       offset_236400)];\n                            x_236377 = ((__local\n                                         double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345 +\n                                                                       offset_236400)];\n                            x_236378 = ((__local\n                                         double *) red_arr_m",
            "em_236353)[sext_i32_i64(local_tid_236345 +\n                                                                       offset_236400)];\n                            x_236379 = ((__local\n                                         double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345 +\n                                                                       offset_236400)];\n                            x_236380 = ((__local\n                                         double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345 +\n                                                                       offset_236400)];\n                        }\n                    }\n                    offset_236400 = 1;\n                    while (slt32(offset_236400, wave_sizze_236347)) {\n                        if (slt32(local_tid_236345 + offset_236400,\n                                  sext_i64_i32(segred_group_sizze_225602)) &&\n                            ((local_tid_236345 - squot32(local_tid_236345,\n                                                         wave_sizze_236347) *\n                              wave_sizze_236347) & (2 * offset_236400 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236381 = ((volatile __local\n                                             double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236382 = ((volatile __local\n                                             double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236383 = ((volatile __local\n                                             double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345 +\n                                                  ",
            "                         offset_236400)];\n                                x_236384 = ((volatile __local\n                                             double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236385 = ((volatile __local\n                                             double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236386 = x_236376 +\n                                       x_236381;\n                                double defunc_1_op_res_236387 = x_236377 +\n                                       x_236382;\n                                double defunc_1_op_res_236388 = x_236378 +\n                                       x_236383;\n                                double defunc_1_op_res_236389 = x_236379 +\n                                       x_236384;\n                                double defunc_1_op_res_236390 = x_236380 +\n                                       x_236385;\n                                \n                                x_236376 = defunc_1_op_res_236386;\n                                x_236377 = defunc_1_op_res_236387;\n                                x_236378 = defunc_1_op_res_236388;\n                                x_236379 = defunc_1_op_res_236389;\n                                x_236380 = defunc_1_op_res_236390;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345)] =\n                                    x_236376;\n                   ",
            "             ((volatile __local\n                                  double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345)] =\n                                    x_236377;\n                                ((volatile __local\n                                  double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345)] =\n                                    x_236378;\n                                ((volatile __local\n                                  double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345)] =\n                                    x_236379;\n                                ((volatile __local\n                                  double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345)] =\n                                    x_236380;\n                            }\n                        }\n                        offset_236400 *= 2;\n                    }\n                    while (slt32(skip_waves_236401,\n                                 squot32(sext_i64_i32(segred_group_sizze_225602) +\n                                         wave_sizze_236347 - 1,\n                                         wave_sizze_236347))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236400 = skip_waves_236401 * wave_sizze_236347;\n                        if (slt32(local_tid_236345 + offset_236400,\n                                  sext_i64_i32(segred_group_sizze_225602)) &&\n                            ((local_tid_236345 - squot32(local_tid_236345,\n                                                         wave_sizze_236347) *\n                              wave_sizze_236347) == 0 &&\n                             (squot32(local_tid_236345, wave_sizze_236347) &\n                              (2 * skip_waves_236401 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236381 = ((__local\n                                             double *) red_arr_mem_236349)[sext_i32_i64",
            "(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236382 = ((__local\n                                             double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236383 = ((__local\n                                             double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236384 = ((__local\n                                             double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                                x_236385 = ((__local\n                                             double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345 +\n                                                                           offset_236400)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236386 = x_236376 +\n                                       x_236381;\n                                double defunc_1_op_res_236387 = x_236377 +\n                                       x_236382;\n                                double defunc_1_op_res_236388 = x_236378 +\n                                       x_236383;\n                                double defunc_1_op_res_236389 = x_236379 +\n                                       x_236384;\n                                double defunc_1_op_res_236390 = x_236380 +\n                                       x_236385;\n                                \n                                x_236376 = defunc_1_op_res_236386;\n                                x_236377 = ",
            "defunc_1_op_res_236387;\n                                x_236378 = defunc_1_op_res_236388;\n                                x_236379 = defunc_1_op_res_236389;\n                                x_236380 = defunc_1_op_res_236390;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236349)[sext_i32_i64(local_tid_236345)] =\n                                    x_236376;\n                                ((__local\n                                  double *) red_arr_mem_236351)[sext_i32_i64(local_tid_236345)] =\n                                    x_236377;\n                                ((__local\n                                  double *) red_arr_mem_236353)[sext_i32_i64(local_tid_236345)] =\n                                    x_236378;\n                                ((__local\n                                  double *) red_arr_mem_236355)[sext_i32_i64(local_tid_236345)] =\n                                    x_236379;\n                                ((__local\n                                  double *) red_arr_mem_236357)[sext_i32_i64(local_tid_236345)] =\n                                    x_236380;\n                            }\n                        }\n                        skip_waves_236401 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236345 == 0) {\n                            ((__global double *) mem_231446)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236376;\n                            ((__global double *) mem_231450)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                           ",
            "                  gtid_225611] =\n                                x_236377;\n                            ((__global double *) mem_231454)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236378;\n                            ((__global double *) mem_231458)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236379;\n                            ((__global double *) mem_231462)[gtid_225610 *\n                                                             t_n_m_203740 +\n                                                             gtid_225611] =\n                                x_236380;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225602\n}\n__kernel void mainzisegred_large_225714(__global int *global_failure,\n                                        uint sync_arr_mem_236467_backing_offset_0,\n                                        uint red_arr_mem_236465_backing_offset_1,\n                                        uint red_arr_mem_236463_backing_offset_2,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225707,\n                                        int64_t groups_per_segment_236447,\n                                        int64_t elements_per_thread_236448,\n                                        int64_t virt_num_groups_23",
            "6449,\n                                        int64_t threads_per_segment_236451,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231432,\n                                        __global unsigned char *mem_231467,\n                                        __global unsigned char *mem_231471,\n                                        __global unsigned char *mem_231475,\n                                        __global unsigned char *mem_231479,\n                                        __global unsigned char *mem_231483,\n                                        __global unsigned char *mem_231488,\n                                        __global unsigned char *mem_231492,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236452,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236454,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236456)\n{\n    #define segred_group_sizze_225706 (mainzisegred_group_sizze_224922)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_236467_backing_2 =\n                           &shared_mem[sync_arr_mem_236467_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236465_backing_1 =\n                           &shared_mem[red_arr_mem_236465_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236463_backing_0 =\n                           &",
            "shared_mem[red_arr_mem_236463_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236458;\n    int32_t local_tid_236459;\n    int64_t group_sizze_236462;\n    int32_t wave_sizze_236461;\n    int32_t group_tid_236460;\n    \n    global_tid_236458 = get_global_id(0);\n    local_tid_236459 = get_local_id(0);\n    group_sizze_236462 = get_local_size(0);\n    wave_sizze_236461 = LOCKSTEP_WIDTH;\n    group_tid_236460 = get_group_id(0);\n    \n    int32_t phys_tid_225714 = global_tid_236458;\n    __local unsigned char *red_arr_mem_236463;\n    \n    red_arr_mem_236463 = (__local unsigned char *) red_arr_mem_236463_backing_0;\n    \n    __local unsigned char *red_arr_mem_236465;\n    \n    red_arr_mem_236465 = (__local unsigned char *) red_arr_mem_236465_backing_1;\n    \n    __local unsigned char *sync_arr_mem_236467;\n    \n    sync_arr_mem_236467 = (__local\n                           unsigned char *) sync_arr_mem_236467_backing_2;\n    \n    int32_t phys_group_id_236469;\n    \n    phys_group_id_236469 = get_group_id(0);\n    for (int32_t i_236470 = 0; i_236470 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236449) - phys_group_id_236469,\n                   sext_i64_i32(num_groups_225707)); i_236470++) {\n        int32_t virt_group_id_236471 = phys_group_id_236469 + i_236470 *\n                sext_i64_i32(num_groups_225707);\n        int32_t flat_segment_id_236472 = squot32(virt_group_id_236471,\n                                                 sext_i64_i32(groups_per_segment_236447));\n        int64_t global_tid_236473 = srem64(sext_i32_i64(virt_group_id_236471) *\n                                           segred_group_sizze_225706 +\n                                           sext_i32_i64(local_tid_236459),\n                                           segred_group_sizze_225706 *\n                                           groups_per_segment_236447);\n        int64_t slice_236474 = t_n_m_203740;\n        int64_t slice_236475 = partition_sizze_203667 * slice_2",
            "36474;\n        int64_t gtid_225711 = squot64(sext_i32_i64(flat_segment_id_236472),\n                                      slice_236474);\n        int64_t remnant_236476 = sext_i32_i64(flat_segment_id_236472) -\n                gtid_225711 * slice_236474;\n        int64_t gtid_225712 = remnant_236476;\n        int64_t remnant_236477 = remnant_236476 - gtid_225712;\n        int64_t gtid_225713;\n        double x_acc_236478;\n        double x_acc_236479;\n        int64_t chunk_sizze_236480 = smin64(elements_per_thread_236448,\n                                            sdiv_up64(q_t_203576 -\n                                                      global_tid_236473,\n                                                      threads_per_segment_236451));\n        double x_225715;\n        double x_225716;\n        double x_225717;\n        double x_225718;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236478 = 0.0;\n            x_acc_236479 = 0.0;\n        }\n        for (int64_t i_236487 = 0; i_236487 < chunk_sizze_236480; i_236487++) {\n            gtid_225713 = global_tid_236473 + threads_per_segment_236451 *\n                i_236487;\n            // apply map function\n            {\n                int64_t x_225722;\n                \n                x_225722 = ((__global int64_t *) ext_mem_229304)[gtid_225711];\n                \n                int64_t x_225733;\n                \n                x_225733 = ((__global int64_t *) ext_mem_229569)[gtid_225711 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225712];\n                \n                double x_225734;\n                \n                x_225734 = ((__global double *) ext_mem_229568)[gtid_225711 *\n                                                                t_n_m_203740 +\n                                                                gtid_225712];\n                \n                int64_t binop_y_",
            "228765 = mul64(jump_t_203582, gtid_225712);\n                int64_t binop_y_228766 = smin64(i_203760, binop_y_228765);\n                int64_t index_primexp_228767 = add64((int64_t) 1,\n                                                     binop_y_228766);\n                double a12_225736;\n                \n                a12_225736 = ((__global double *) mem_231467)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b12_225737;\n                \n                b12_225737 = ((__global double *) mem_231471)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double c12_225738;\n                \n                c12_225738 = ((__global double *) mem_231475)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b2_225739;\n                \n                b2_225739 = ((__global double *) mem_231479)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                double c2_225740;\n                \n                c2_225740 = ((__global double *) mem_231483)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                bool cond_225742 = sle64(x_225722, gtid_225713);\n                int64_t defunc_0_f_res_225743;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225743 = (int64_t) 0;\n                } else {\n                 ",
            "   int64_t i_225744 = add64(gtid_225713, x_225733);\n                    int64_t defunc_0_add_arg_225745;\n                    \n                    defunc_0_add_arg_225745 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225711 *\n                                                                           n_203572 +\n                                                                           i_225744];\n                    \n                    int64_t defunc_1_add_res_225746 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225745);\n                    \n                    defunc_0_f_res_225743 = defunc_1_add_res_225746;\n                }\n                \n                double defunc_0_f_res_225747;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225747 = 0.0;\n                } else {\n                    int64_t i_225748 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225749;\n                    \n                    defunc_0_add_arg_225749 = ((__global\n                                                double *) mem_231428)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225748];\n                    defunc_0_f_res_225747 = defunc_0_add_arg_225749;\n                }\n                \n                int64_t binop_p_225750 = sub64(defunc_0_f_res_225743,\n                                               index_primexp_228767);\n                double defunc_0_f_res_225751 = sitofp_i64_f64(binop_p_225750);\n                double abs_res_225752 = fabs(defunc_0_f_res_225751);\n                double tmp1_225753 = abs_res_225752 / x_225734;\n                double x_225754 = tmp1_225753 * tmp1_225753;\n                double y_225755 = tmp1_225753 * x_225754;\n                double tmp2_225756 = 1.0 - y_225755;\n      ",
            "          double x_225757 = tmp2_225756 * tmp2_225756;\n                double tmp3_225758 = tmp2_225756 * x_225757;\n                double tmp4_225759 = defunc_0_f_res_225747 * tmp3_225758;\n                double defunc_1_f_res_225760 = defunc_0_f_res_225751 *\n                       tmp4_225759;\n                double defunc_1_f_res_225761 = defunc_0_f_res_225751 *\n                       defunc_1_f_res_225760;\n                double defunc_0_f_res_225762;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225762 = 0.0;\n                } else {\n                    int64_t i_225763 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225764;\n                    \n                    defunc_0_add_arg_225764 = ((__global\n                                                double *) mem_231432)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225763];\n                    defunc_0_f_res_225762 = defunc_0_add_arg_225764;\n                }\n                \n                double x_225765 = a12_225736 * tmp4_225759;\n                double y_225766 = b12_225737 * defunc_1_f_res_225760;\n                double x_225767 = x_225765 + y_225766;\n                double y_225768 = c12_225738 * defunc_1_f_res_225761;\n                double x_225769 = x_225767 + y_225768;\n                double defunc_9_fit_fun_res_225770 = defunc_0_f_res_225762 *\n                       x_225769;\n                double x_225771 = b12_225737 * tmp4_225759;\n                double y_225772 = b2_225739 * defunc_1_f_res_225760;\n                double x_225773 = x_225771 + y_225772;\n                double y_225774 = c2_225740 * defunc_1_f_res_225761;\n                double x_225775 = x_225773 + y_225774;\n                double defunc_9_slope_fun_res_225776 = defunc_0_f_res_225762 *\n                       x_225775;\n                \n        ",
            "        // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225715 = x_acc_236478;\n                    x_225716 = x_acc_236479;\n                }\n                // load new values\n                {\n                    x_225717 = defunc_9_fit_fun_res_225770;\n                    x_225718 = defunc_9_slope_fun_res_225776;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225719 = x_225715 + x_225717;\n                    double defunc_1_op_res_225720 = x_225716 + x_225718;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236478 = defunc_1_op_res_225719;\n                        x_acc_236479 = defunc_1_op_res_225720;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225715 = x_acc_236478;\n            x_225716 = x_acc_236479;\n            ((__local\n              double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459)] =\n                x_225715;\n            ((__local\n              double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459)] =\n                x_225716;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236488;\n        int32_t skip_waves_236489 = 1;\n        double x_236481;\n        double x_236482;\n        double x_236483;\n        double x_236484;\n        \n        offset_236488 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236459,\n                      sext_i64_i32(segred_group_sizze_225706))) {\n                x_236481 = ((__local\n                             double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459 +\n                                                           offset_236488)];\n                x_236482 = ((__local\n                         ",
            "    double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459 +\n                                                           offset_236488)];\n            }\n        }\n        offset_236488 = 1;\n        while (slt32(offset_236488, wave_sizze_236461)) {\n            if (slt32(local_tid_236459 + offset_236488,\n                      sext_i64_i32(segred_group_sizze_225706)) &&\n                ((local_tid_236459 - squot32(local_tid_236459,\n                                             wave_sizze_236461) *\n                  wave_sizze_236461) & (2 * offset_236488 - 1)) == 0) {\n                // read array element\n                {\n                    x_236483 = ((volatile __local\n                                 double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459 +\n                                                               offset_236488)];\n                    x_236484 = ((volatile __local\n                                 double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459 +\n                                                               offset_236488)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236485 = x_236481 + x_236483;\n                    double defunc_1_op_res_236486 = x_236482 + x_236484;\n                    \n                    x_236481 = defunc_1_op_res_236485;\n                    x_236482 = defunc_1_op_res_236486;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459)] =\n                        x_236481;\n                    ((volatile __local\n                      double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459)] =\n                        x_236482;\n                }\n            }\n            offset_236488 *= 2;\n        }\n        while (slt32(skip_waves_236489,\n                     squot32(sext_i64_i32(segred_",
            "group_sizze_225706) +\n                             wave_sizze_236461 - 1, wave_sizze_236461))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236488 = skip_waves_236489 * wave_sizze_236461;\n            if (slt32(local_tid_236459 + offset_236488,\n                      sext_i64_i32(segred_group_sizze_225706)) &&\n                ((local_tid_236459 - squot32(local_tid_236459,\n                                             wave_sizze_236461) *\n                  wave_sizze_236461) == 0 && (squot32(local_tid_236459,\n                                                      wave_sizze_236461) & (2 *\n                                                                            skip_waves_236489 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236483 = ((__local\n                                 double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459 +\n                                                               offset_236488)];\n                    x_236484 = ((__local\n                                 double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459 +\n                                                               offset_236488)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236485 = x_236481 + x_236483;\n                    double defunc_1_op_res_236486 = x_236482 + x_236484;\n                    \n                    x_236481 = defunc_1_op_res_236485;\n                    x_236482 = defunc_1_op_res_236486;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459)] =\n                        x_236481;\n                    ((__local\n                      double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459)",
            "] =\n                        x_236482;\n                }\n            }\n            skip_waves_236489 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236459) == (int64_t) 0) {\n                x_acc_236478 = x_236481;\n                x_acc_236479 = x_236482;\n            }\n        }\n        if (groups_per_segment_236447 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236459 == 0) {\n                    ((__global double *) mem_231488)[gtid_225711 *\n                                                     t_n_m_203740 +\n                                                     gtid_225712] =\n                        x_acc_236478;\n                    ((__global double *) mem_231492)[gtid_225711 *\n                                                     t_n_m_203740 +\n                                                     gtid_225712] =\n                        x_acc_236479;\n                }\n            }\n        } else {\n            int32_t old_counter_236490;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236459 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236452)[sext_i32_i64(virt_group_id_236471)] =\n                        x_acc_236478;\n                    ((__global\n                      double *) segred_tmp_mem_236454)[sext_i32_i64(virt_group_id_236471)] =\n                        x_acc_236479;\n                    mem_fence_global();\n                    old_counter_236490 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236456)[sext_i32_i64(srem32(flat_segment_id_236472,\n                                                                                                      10240))],\n  ",
            "                                            (int) 1);\n                    ((__local bool *) sync_arr_mem_236467)[(int64_t) 0] =\n                        old_counter_236490 == groups_per_segment_236447 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236491;\n            \n            is_last_group_236491 = ((__local\n                                     bool *) sync_arr_mem_236467)[(int64_t) 0];\n            if (is_last_group_236491) {\n                if (local_tid_236459 == 0) {\n                    old_counter_236490 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236456)[sext_i32_i64(srem32(flat_segment_id_236472,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236447));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236492 =\n                            sdiv_up64(groups_per_segment_236447,\n                                      segred_group_sizze_225706);\n                    \n                    x_225715 = 0.0;\n                    x_225716 = 0.0;\n                    for (int64_t i_236493 = 0; i_236493 <\n                         read_per_thread_236492; i_236493++) {\n                        int64_t group_res_id_236494 =\n                                sext_i32_i64(local_tid_236459) *\n                                read_per_thread_236492 + i_236493;\n                        int64_t index_of_group_res_236495 =\n                                sext_i32_i64(flat_segment_id_236472) *\n                                groups_per_segment_236447 + group_res_id_236494;\n             ",
            "           \n                        if (slt64(group_res_id_236494,\n                                  groups_per_segment_236447)) {\n                            x_225717 = ((__global\n                                         double *) segred_tmp_mem_236452)[index_of_group_res_236495];\n                            x_225718 = ((__global\n                                         double *) segred_tmp_mem_236454)[index_of_group_res_236495];\n                            \n                            double defunc_1_op_res_225719 = x_225715 + x_225717;\n                            double defunc_1_op_res_225720 = x_225716 + x_225718;\n                            \n                            x_225715 = defunc_1_op_res_225719;\n                            x_225716 = defunc_1_op_res_225720;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459)] =\n                    x_225715;\n                ((__local\n                  double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459)] =\n                    x_225716;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236496;\n                    int32_t skip_waves_236497 = 1;\n                    double x_236481;\n                    double x_236482;\n                    double x_236483;\n                    double x_236484;\n                    \n                    offset_236496 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236459,\n                                  sext_i64_i32(segred_group_sizze_225706))) {\n                            x_236481 = ((__local\n                                         double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459 +\n                                                                       offset_236496)];\n ",
            "                           x_236482 = ((__local\n                                         double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459 +\n                                                                       offset_236496)];\n                        }\n                    }\n                    offset_236496 = 1;\n                    while (slt32(offset_236496, wave_sizze_236461)) {\n                        if (slt32(local_tid_236459 + offset_236496,\n                                  sext_i64_i32(segred_group_sizze_225706)) &&\n                            ((local_tid_236459 - squot32(local_tid_236459,\n                                                         wave_sizze_236461) *\n                              wave_sizze_236461) & (2 * offset_236496 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236483 = ((volatile __local\n                                             double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459 +\n                                                                           offset_236496)];\n                                x_236484 = ((volatile __local\n                                             double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459 +\n                                                                           offset_236496)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236485 = x_236481 +\n                                       x_236483;\n                                double defunc_1_op_res_236486 = x_236482 +\n                                       x_236484;\n                                \n                                x_236481 = defunc_1_op_res_236485;\n                                x_236482 = defunc_1_op_res_236486;\n                            }\n                            /",
            "/ write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459)] =\n                                    x_236481;\n                                ((volatile __local\n                                  double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459)] =\n                                    x_236482;\n                            }\n                        }\n                        offset_236496 *= 2;\n                    }\n                    while (slt32(skip_waves_236497,\n                                 squot32(sext_i64_i32(segred_group_sizze_225706) +\n                                         wave_sizze_236461 - 1,\n                                         wave_sizze_236461))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236496 = skip_waves_236497 * wave_sizze_236461;\n                        if (slt32(local_tid_236459 + offset_236496,\n                                  sext_i64_i32(segred_group_sizze_225706)) &&\n                            ((local_tid_236459 - squot32(local_tid_236459,\n                                                         wave_sizze_236461) *\n                              wave_sizze_236461) == 0 &&\n                             (squot32(local_tid_236459, wave_sizze_236461) &\n                              (2 * skip_waves_236497 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236483 = ((__local\n                                             double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459 +\n                                                                           offset_236496)];\n                                x_236484 = ((__local\n                                             double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459 +\n                                         ",
            "                                  offset_236496)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236485 = x_236481 +\n                                       x_236483;\n                                double defunc_1_op_res_236486 = x_236482 +\n                                       x_236484;\n                                \n                                x_236481 = defunc_1_op_res_236485;\n                                x_236482 = defunc_1_op_res_236486;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236463)[sext_i32_i64(local_tid_236459)] =\n                                    x_236481;\n                                ((__local\n                                  double *) red_arr_mem_236465)[sext_i32_i64(local_tid_236459)] =\n                                    x_236482;\n                            }\n                        }\n                        skip_waves_236497 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236459 == 0) {\n                            ((__global double *) mem_231488)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712] =\n                                x_236481;\n                            ((__global double *) mem_231492)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712] =\n                                x_236482;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENC",
            "E | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225706\n}\n__kernel void mainzisegred_large_228180(__global int *global_failure,\n                                        uint sync_arr_mem_237122_backing_offset_0,\n                                        uint red_arr_mem_237120_backing_offset_1,\n                                        int64_t n_203572,\n                                        int64_t partition_sizze_203667,\n                                        int64_t stl_res_203754,\n                                        int64_t j_m_i_204223,\n                                        int64_t num_groups_228175,\n                                        int64_t groups_per_segment_237106,\n                                        int64_t elements_per_thread_237107,\n                                        int64_t virt_num_groups_237108,\n                                        int64_t threads_per_segment_237110,\n                                        __global unsigned char *ext_mem_231924,\n                                        __global unsigned char *mem_231941,\n                                        __global\n                                        unsigned char *segred_tmp_mem_237111,\n                                        __global\n                                        unsigned char *mainzicounter_mem_237113)\n{\n    #define segred_group_sizze_228174 (mainzisegred_group_sizze_228157)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *sync_arr_mem_237122_backing_1 =\n                           &shared_mem[sync_arr_mem_237122_backing_offset_0];\n    volatile unsigned char *red_arr_mem_237120_backing_0 =\n                           &shared_mem[red_arr_mem_237120_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237115;\n    int32_t local_tid_237116;\n    int64_t group_sizze_237119;\n    int32_t wave_sizze_237118;\n    int3",
            "2_t group_tid_237117;\n    \n    global_tid_237115 = get_global_id(0);\n    local_tid_237116 = get_local_id(0);\n    group_sizze_237119 = get_local_size(0);\n    wave_sizze_237118 = LOCKSTEP_WIDTH;\n    group_tid_237117 = get_group_id(0);\n    \n    int32_t phys_tid_228180 = global_tid_237115;\n    __local unsigned char *red_arr_mem_237120;\n    \n    red_arr_mem_237120 = (__local unsigned char *) red_arr_mem_237120_backing_0;\n    \n    __local unsigned char *sync_arr_mem_237122;\n    \n    sync_arr_mem_237122 = (__local\n                           unsigned char *) sync_arr_mem_237122_backing_1;\n    \n    int32_t phys_group_id_237124;\n    \n    phys_group_id_237124 = get_group_id(0);\n    for (int32_t i_237125 = 0; i_237125 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_237108) - phys_group_id_237124,\n                   sext_i64_i32(num_groups_228175)); i_237125++) {\n        int32_t virt_group_id_237126 = phys_group_id_237124 + i_237125 *\n                sext_i64_i32(num_groups_228175);\n        int32_t flat_segment_id_237127 = squot32(virt_group_id_237126,\n                                                 sext_i64_i32(groups_per_segment_237106));\n        int64_t global_tid_237128 = srem64(sext_i32_i64(virt_group_id_237126) *\n                                           segred_group_sizze_228174 +\n                                           sext_i32_i64(local_tid_237116),\n                                           segred_group_sizze_228174 *\n                                           groups_per_segment_237106);\n        int64_t slice_237129 = partition_sizze_203667;\n        int64_t gtid_228178 = sext_i32_i64(flat_segment_id_237127);\n        int64_t remnant_237130 = sext_i32_i64(flat_segment_id_237127) -\n                gtid_228178;\n        int64_t gtid_228179;\n        double x_acc_237131;\n        int64_t chunk_sizze_237132 = smin64(elements_per_thread_237107,\n                                            sdiv_up64(j_m_i_204223 -\n                                                      global",
            "_tid_237128,\n                                                      threads_per_segment_237110));\n        double x_228181;\n        double x_228182;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_237131 = 0.0;\n        }\n        for (int64_t i_237136 = 0; i_237136 < chunk_sizze_237132; i_237136++) {\n            gtid_228179 = global_tid_237128 + threads_per_segment_237110 *\n                i_237136;\n            // apply map function\n            {\n                int64_t slice_228309 = stl_res_203754 + gtid_228179;\n                double x_228185;\n                \n                x_228185 = ((__global double *) ext_mem_231924)[gtid_228178 *\n                                                                n_203572 +\n                                                                slice_228309];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_228181 = x_acc_237131;\n                }\n                // load new values\n                {\n                    x_228182 = x_228185;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_228183 = x_228181 + x_228182;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_237131 = defunc_1_op_res_228183;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_228181 = x_acc_237131;\n            ((__local\n              double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116)] =\n                x_228181;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_237137;\n        int32_t skip_waves_237138 = 1;\n        double x_237133;\n        double x_237134;\n        \n        offset_237137 = 0;\n        // participating threads read initial accumulator\n        {\n    ",
            "        if (slt32(local_tid_237116,\n                      sext_i64_i32(segred_group_sizze_228174))) {\n                x_237133 = ((__local\n                             double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116 +\n                                                           offset_237137)];\n            }\n        }\n        offset_237137 = 1;\n        while (slt32(offset_237137, wave_sizze_237118)) {\n            if (slt32(local_tid_237116 + offset_237137,\n                      sext_i64_i32(segred_group_sizze_228174)) &&\n                ((local_tid_237116 - squot32(local_tid_237116,\n                                             wave_sizze_237118) *\n                  wave_sizze_237118) & (2 * offset_237137 - 1)) == 0) {\n                // read array element\n                {\n                    x_237134 = ((volatile __local\n                                 double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116 +\n                                                               offset_237137)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_237135 = x_237133 + x_237134;\n                    \n                    x_237133 = defunc_1_op_res_237135;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116)] =\n                        x_237133;\n                }\n            }\n            offset_237137 *= 2;\n        }\n        while (slt32(skip_waves_237138,\n                     squot32(sext_i64_i32(segred_group_sizze_228174) +\n                             wave_sizze_237118 - 1, wave_sizze_237118))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_237137 = skip_waves_237138 * wave_sizze_237118;\n            if (slt32(local_tid_237116 + offset_237137,\n                      sext_i64_i32(segred_group_sizze_228174)) &&\n                ((lo",
            "cal_tid_237116 - squot32(local_tid_237116,\n                                             wave_sizze_237118) *\n                  wave_sizze_237118) == 0 && (squot32(local_tid_237116,\n                                                      wave_sizze_237118) & (2 *\n                                                                            skip_waves_237138 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_237134 = ((__local\n                                 double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116 +\n                                                               offset_237137)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_237135 = x_237133 + x_237134;\n                    \n                    x_237133 = defunc_1_op_res_237135;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116)] =\n                        x_237133;\n                }\n            }\n            skip_waves_237138 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_237116) == (int64_t) 0) {\n                x_acc_237131 = x_237133;\n            }\n        }\n        if (groups_per_segment_237106 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_237116 == 0) {\n                    ((__global double *) mem_231941)[gtid_228178] =\n                        x_acc_237131;\n                }\n            }\n        } else {\n            int32_t old_counter_237139;\n            \n            // first thread in group saves group result to global memory\n            {\n                ",
            "if (local_tid_237116 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_237111)[sext_i32_i64(virt_group_id_237126)] =\n                        x_acc_237131;\n                    mem_fence_global();\n                    old_counter_237139 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_237113)[sext_i32_i64(srem32(flat_segment_id_237127,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_237122)[(int64_t) 0] =\n                        old_counter_237139 == groups_per_segment_237106 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_237140;\n            \n            is_last_group_237140 = ((__local\n                                     bool *) sync_arr_mem_237122)[(int64_t) 0];\n            if (is_last_group_237140) {\n                if (local_tid_237116 == 0) {\n                    old_counter_237139 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_237113)[sext_i32_i64(srem32(flat_segment_id_237127,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_237106));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_237141 =\n                            sdiv_up64(groups_per_segment_237106,\n                                      segred_group_sizze_228174);\n                    \n                    x_228",
            "181 = 0.0;\n                    for (int64_t i_237142 = 0; i_237142 <\n                         read_per_thread_237141; i_237142++) {\n                        int64_t group_res_id_237143 =\n                                sext_i32_i64(local_tid_237116) *\n                                read_per_thread_237141 + i_237142;\n                        int64_t index_of_group_res_237144 =\n                                sext_i32_i64(flat_segment_id_237127) *\n                                groups_per_segment_237106 + group_res_id_237143;\n                        \n                        if (slt64(group_res_id_237143,\n                                  groups_per_segment_237106)) {\n                            x_228182 = ((__global\n                                         double *) segred_tmp_mem_237111)[index_of_group_res_237144];\n                            \n                            double defunc_1_op_res_228183 = x_228181 + x_228182;\n                            \n                            x_228181 = defunc_1_op_res_228183;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116)] =\n                    x_228181;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_237145;\n                    int32_t skip_waves_237146 = 1;\n                    double x_237133;\n                    double x_237134;\n                    \n                    offset_237145 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_237116,\n                                  sext_i64_i32(segred_group_sizze_228174))) {\n                            x_237133 = ((__local\n                                         double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116 +\n                                                      ",
            "                 offset_237145)];\n                        }\n                    }\n                    offset_237145 = 1;\n                    while (slt32(offset_237145, wave_sizze_237118)) {\n                        if (slt32(local_tid_237116 + offset_237145,\n                                  sext_i64_i32(segred_group_sizze_228174)) &&\n                            ((local_tid_237116 - squot32(local_tid_237116,\n                                                         wave_sizze_237118) *\n                              wave_sizze_237118) & (2 * offset_237145 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_237134 = ((volatile __local\n                                             double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116 +\n                                                                           offset_237145)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_237135 = x_237133 +\n                                       x_237134;\n                                \n                                x_237133 = defunc_1_op_res_237135;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116)] =\n                                    x_237133;\n                            }\n                        }\n                        offset_237145 *= 2;\n                    }\n                    while (slt32(skip_waves_237146,\n                                 squot32(sext_i64_i32(segred_group_sizze_228174) +\n                                         wave_sizze_237118 - 1,\n                                         wave_sizze_237118))) {\n                   ",
            "     barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_237145 = skip_waves_237146 * wave_sizze_237118;\n                        if (slt32(local_tid_237116 + offset_237145,\n                                  sext_i64_i32(segred_group_sizze_228174)) &&\n                            ((local_tid_237116 - squot32(local_tid_237116,\n                                                         wave_sizze_237118) *\n                              wave_sizze_237118) == 0 &&\n                             (squot32(local_tid_237116, wave_sizze_237118) &\n                              (2 * skip_waves_237146 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_237134 = ((__local\n                                             double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116 +\n                                                                           offset_237145)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_237135 = x_237133 +\n                                       x_237134;\n                                \n                                x_237133 = defunc_1_op_res_237135;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_237120)[sext_i32_i64(local_tid_237116)] =\n                                    x_237133;\n                            }\n                        }\n                        skip_waves_237146 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_237116 == 0) {\n                            ((__global double *) mem_231941)[gtid_228178] =\n                                x_237133;\n                        }\n",
            "                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_228174\n}\n__kernel void mainzisegred_small_212093(__global int *global_failure,\n                                        uint red_arr_mem_233265_backing_offset_0,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212086,\n                                        int64_t segment_sizze_nonzzero_233258,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229795,\n                                        __global unsigned char *mem_229805)\n{\n    #define segred_group_sizze_212085 (mainzisegred_group_sizze_211266)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233265_backing_0 =\n                           &shared_mem[red_arr_mem_233265_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233260;\n    int32_t local_tid_233261;\n    int64_t group_sizze_233264;\n    int32_t wave_sizze_233263;\n    int32_t group_tid_233262;\n    \n    global_tid_233260 = get_global_id(0);\n    local_tid_233261 = get_local_id(0);\n    group_sizze_233264 = get_local_size(0);\n    wave_sizze_233263 = L",
            "OCKSTEP_WIDTH;\n    group_tid_233262 = get_group_id(0);\n    \n    int32_t phys_tid_212093 = global_tid_233260;\n    __local unsigned char *red_arr_mem_233265;\n    \n    red_arr_mem_233265 = (__local unsigned char *) red_arr_mem_233265_backing_0;\n    \n    int32_t phys_group_id_233267;\n    \n    phys_group_id_233267 = get_group_id(0);\n    for (int32_t i_233268 = 0; i_233268 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_212085,\n                                                  segment_sizze_nonzzero_233258))) -\n                   phys_group_id_233267, sext_i64_i32(num_groups_212086));\n         i_233268++) {\n        int32_t virt_group_id_233269 = phys_group_id_233267 + i_233268 *\n                sext_i64_i32(num_groups_212086);\n        int64_t slice_233270 = s_n_m_203726;\n        int64_t slice_233271 = n_p_203574 * slice_233270;\n        int64_t slice_233272 = partition_sizze_203667 * slice_233271;\n        int64_t gtid_212089 = squot64(squot64(sext_i32_i64(local_tid_233261),\n                                              segment_sizze_nonzzero_233258) +\n                                      sext_i32_i64(virt_group_id_233269) *\n                                      squot64(segred_group_sizze_212085,\n                                              segment_sizze_nonzzero_233258),\n                                      slice_233271);\n        int64_t remnant_233273 = squot64(sext_i32_i64(local_tid_233261),\n                                         segment_sizze_nonzzero_233258) +\n                sext_i32_i64(virt_group_id_233269) *\n                squot64(segred_group_sizze_212085,\n                        segment_sizze_nonzzero_233258) - gtid_212089 *\n                slice_233271;\n        int64_t gtid_212090 = squot64(remnant_233273, slice_233270);\n        int64_t remnant_233274 = remnant_233273 - gtid_212090 * slice_233270;\n  ",
            "      int64_t gtid_212091 = remnant_233274;\n        int64_t remnant_233275 = remnant_233274 - gtid_212091;\n        int64_t gtid_212092 = srem64(sext_i32_i64(local_tid_233261),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_212089,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_212090,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_212091,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233261),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_212085,\n                                                                 segment_sizze_nonzzero_233258)))) {\n                int64_t x_212105;\n                \n                x_212105 = ((__global int64_t *) ext_mem_229372)[gtid_212089 *\n                                                                 n_p_203574 +\n                                                                 gtid_212090];\n                \n                int64_t x_212109;\n                \n                x_212109 = ((__global int64_t *) ext_mem_229471)[gtid_212089 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212090 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212091];\n                \n                double x_212110;\n                \n        ",
            "        x_212110 = ((__global double *) ext_mem_229470)[gtid_212089 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212090 *\n                                                                s_n_m_203726 +\n                                                                gtid_212091];\n                \n                int64_t defunc_0_m_fun_res_212111;\n                \n                defunc_0_m_fun_res_212111 = ((__global\n                                              int64_t *) mem_229795)[gtid_212089 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212090 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212091];\n                \n                bool cond_212113 = sle64(x_212105, gtid_212092);\n                int64_t defunc_0_f_res_212114;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212114 = (int64_t) 0;\n                } else {\n                    int64_t i_212115 = add64(gtid_212092, x_212109);\n                    int64_t defunc_0_add_arg_212116;\n                    \n                    defunc_0_add_arg_212116 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212089 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212090 *\n                                                               ",
            "            defunc_0_f_res_203721 +\n                                                                           i_212115];\n                    \n                    int64_t defunc_1_add_res_212117 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212116);\n                    \n                    defunc_0_f_res_212114 = defunc_1_add_res_212117;\n                }\n                \n                double defunc_0_f_res_212118;\n                \n                if (cond_212113) {\n                    defunc_0_f_res_212118 = 0.0;\n                } else {\n                    int64_t i_212119 = add64(gtid_212092, x_212109);\n                    double defunc_0_add_arg_212120;\n                    \n                    defunc_0_add_arg_212120 = ((__global\n                                                double *) mem_229639)[gtid_212089 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212090 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212119];\n                    defunc_0_f_res_212118 = defunc_0_add_arg_212120;\n                }\n                \n                int64_t binop_p_212121 = sub64(defunc_0_f_res_212114,\n                                               defunc_0_m_fun_res_212111);\n                double defunc_0_f_res_212122 = sitofp_i64_f64(binop_p_212121);\n                double abs_res_212123 = fabs(defunc_0_f_res_212122);\n                double tmp1_212124 = abs_res_212123 / x_212110;\n                double x_212125 = tmp1_212124 * tmp1_212124;\n                double y_212126 = tmp1_212124 * x_212125;\n                double tmp2_212127 = 1.0 - y_212126;\n                double x_212128 = tmp2_212127 ",
            "* tmp2_212127;\n                double tmp3_212129 = tmp2_212127 * x_212128;\n                double w_j_212130 = defunc_0_f_res_212118 * tmp3_212129;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)] =\n                        w_j_212130;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212094;\n                double x_212095;\n                double x_233276;\n                double x_233277;\n                bool ltid_in_bounds_233279 =\n                     slt64(sext_i32_i64(local_tid_233261), q_s_203575 *\n                           squot64(segred_group_sizze_212085,\n                                   segment_sizze_nonzzero_233258));\n                int32_t skip_threads_233280;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233279) {\n                        x_212095 = ((volatile __local\n                                     double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)];\n                        if ((local_tid_233261 - squot32(local_tid_233261, 32) *\n                             32) == 0) {\n                            x_212094 = x_212095;\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_233261 -\n                                                          squot32(local_tid_233261,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233279;\n                        \n                        if (thread_active_233281) {\n                            // read operands\n                            {\n                                x_212094 = ((volatile __local\n                                             double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261) -\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_233261),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233261) -\n                                       sext_i32_i64(local_tid_233261 -\n                                       skip_threads_233280));\n                            \n                            if (thread_active_233281 && inactive_233282) {\n                                x_212094 = x_212095;\n                            }\n                            if (thread_active_233281) {\n                                if (!inactive_233282) {\n                                    double defunc_1_op_res_212096 = x_212094 +\n                                           x_212095;\n                                    \n                                    x_212094 = defunc_1_op_res_212096;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233263, skip_threads_233280)) {\n                            barrier(CLK_L",
            "OCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233281) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)] =\n                                    x_212094;\n                                x_212095 = x_212094;\n                            }\n                        }\n                        if (sle32(wave_sizze_233263, skip_threads_233280)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233280 *= 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_233261 - squot32(local_tid_233261, 32) *\n                         32) == 31 && ltid_in_bounds_233279) {\n                        ((volatile __local\n                          double *) red_arr_mem_233265)[sext_i32_i64(squot32(local_tid_233261,\n                                                                             32))] =\n                            x_212094;\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_233283;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233261, 32) == 0 &&\n                            ltid_in_bounds_233279) {\n                            x_233277 = ((volatile __local\n                                         double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)];\n                            if ((local_tid_233261 - squot32(local_tid_233261,\n                               ",
            "                             32) * 32) == 0) {\n                                x_233276 = x_233277;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233283 = 1;\n                        while (slt32(skip_threads_233283, 32)) {\n                            bool thread_active_233284 =\n                                 sle32(skip_threads_233283, local_tid_233261 -\n                                       squot32(local_tid_233261, 32) * 32) &&\n                                 (squot32(local_tid_233261, 32) == 0 &&\n                                  ltid_in_bounds_233279);\n                            \n                            if (thread_active_233284) {\n                                // read operands\n                                {\n                                    x_233276 = ((volatile __local\n                                                 double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261) -\n                                                                               sext_i32_i64(skip_threads_233283)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233285 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233261 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233261 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233261 -\n                                                         skip_threads_233283) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233284 && inactive_233285) ",
            "{\n                                    x_233276 = x_233277;\n                                }\n                                if (thread_active_233284) {\n                                    if (!inactive_233285) {\n                                        double defunc_1_op_res_233278 =\n                                               x_233276 + x_233277;\n                                        \n                                        x_233276 = defunc_1_op_res_233278;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233263, skip_threads_233283)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233284) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)] =\n                                        x_233276;\n                                    x_233277 = x_233276;\n                                }\n                            }\n                            if (sle32(wave_sizze_233263, skip_threads_233283)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233283 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233286 = squot32(local_tid_233261, 32) == 0 ||\n                     !ltid_in_bounds_233279;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233286) {\n                            x_212095 = x_212094;\n                            x_212094 = ((__local\n     ",
            "                                    double *) red_arr_mem_233265)[sext_i32_i64(squot32(local_tid_233261,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233287 =\n                             slt64(srem64(sext_i32_i64(local_tid_233261),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233261) -\n                                   sext_i32_i64(squot32(local_tid_233261, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233286) {\n                            if (inactive_233287) {\n                                x_212094 = x_212095;\n                            }\n                        }\n                        if (!no_carry_in_233286) {\n                            if (!inactive_233287) {\n                                double defunc_1_op_res_212096 = x_212094 +\n                                       x_212095;\n                                \n                                x_212094 = defunc_1_op_res_212096;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233286) {\n                            ((__local\n                              double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)] =\n                                x_212094;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233261, 32) == 0 &&\n                        ltid_in_bounds_233279) {\n  ",
            "                      ((__local\n                          double *) red_arr_mem_233265)[sext_i32_i64(local_tid_233261)] =\n                            x_212095;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233269) *\n                      squot64(segred_group_sizze_212085,\n                              segment_sizze_nonzzero_233258) +\n                      sext_i32_i64(local_tid_233261), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233261),\n                      squot64(segred_group_sizze_212085,\n                              segment_sizze_nonzzero_233258))) {\n                double tmp_233288;\n                \n                tmp_233288 = ((__local\n                               double *) red_arr_mem_233265)[(sext_i32_i64(local_tid_233261) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233258 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229805)[squot64(sext_i32_i64(virt_group_id_233269) *\n                                                squot64(segred_group_sizze_212085,\n                                                        segment_sizze_nonzzero_233258) +\n                                                sext_i32_i64(local_tid_233261),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233269) *\n                                                squot64(segred_group_sizze_212085,\n                                             ",
            "           segment_sizze_nonzzero_233258) +\n                                                sext_i32_i64(local_tid_233261) -\n                                                squot64(sext_i32_i64(virt_group_id_233269) *\n                                                        squot64(segred_group_sizze_212085,\n                                                                segment_sizze_nonzzero_233258) +\n                                                        sext_i32_i64(local_tid_233261),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233269) *\n                                         squot64(segred_group_sizze_212085,\n                                                 segment_sizze_nonzzero_233258) +\n                                         sext_i32_i64(local_tid_233261) -\n                                         squot64(sext_i32_i64(virt_group_id_233269) *\n                                                 squot64(segred_group_sizze_212085,\n                                                         segment_sizze_nonzzero_233258) +\n                                                 sext_i32_i64(local_tid_233261),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233269) *\n                                                 squot64(segred_group_sizze_212085,\n                                                         segment_sizze_nonzzero_233258) +\n                                                 sext_i32_i64(local_tid_233261) -\n                                                 squot64(sext_i32_i",
            "64(virt_group_id_233269) *\n                                                         squot64(segred_group_sizze_212085,\n                                                                 segment_sizze_nonzzero_233258) +\n                                                         sext_i32_i64(local_tid_233261),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233288;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_212085\n}\n__kernel void mainzisegred_small_212167(__global int *global_failure,\n                                        uint red_arr_mem_233353_backing_offset_0,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_212160,\n                                        int64_t segment_sizze_nonzzero_233346,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_229811,\n           ",
            "                             __global unsigned char *mem_229816,\n                                        __global unsigned char *mem_229822)\n{\n    #define segred_group_sizze_212159 (mainzisegred_group_sizze_211164)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233353_backing_0 =\n                           &shared_mem[red_arr_mem_233353_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233348;\n    int32_t local_tid_233349;\n    int64_t group_sizze_233352;\n    int32_t wave_sizze_233351;\n    int32_t group_tid_233350;\n    \n    global_tid_233348 = get_global_id(0);\n    local_tid_233349 = get_local_id(0);\n    group_sizze_233352 = get_local_size(0);\n    wave_sizze_233351 = LOCKSTEP_WIDTH;\n    group_tid_233350 = get_group_id(0);\n    \n    int32_t phys_tid_212167 = global_tid_233348;\n    __local unsigned char *red_arr_mem_233353;\n    \n    red_arr_mem_233353 = (__local unsigned char *) red_arr_mem_233353_backing_0;\n    \n    int32_t phys_group_id_233355;\n    \n    phys_group_id_233355 = get_group_id(0);\n    for (int32_t i_233356 = 0; i_233356 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_212159,\n                                                  segment_sizze_nonzzero_233346))) -\n                   phys_group_id_233355, sext_i64_i32(num_groups_212160));\n         i_233356++) {\n        int32_t virt_group_id_233357 = phys_group_id_233355 + i_233356 *\n                sext_i64_i32(num_groups_212160);\n        int64_t slice_233358 = s_n_m_203726;\n        int64_t slice_233359 = n_p_203574 * slice_233358;\n        int64_t slice_233360 = partition_sizze_203667 * slice_233359;\n        int64_t gtid_212163 = squot64(squot64(sext_i32_i64(local_tid_233349),\n                                              s",
            "egment_sizze_nonzzero_233346) +\n                                      sext_i32_i64(virt_group_id_233357) *\n                                      squot64(segred_group_sizze_212159,\n                                              segment_sizze_nonzzero_233346),\n                                      slice_233359);\n        int64_t remnant_233361 = squot64(sext_i32_i64(local_tid_233349),\n                                         segment_sizze_nonzzero_233346) +\n                sext_i32_i64(virt_group_id_233357) *\n                squot64(segred_group_sizze_212159,\n                        segment_sizze_nonzzero_233346) - gtid_212163 *\n                slice_233359;\n        int64_t gtid_212164 = squot64(remnant_233361, slice_233358);\n        int64_t remnant_233362 = remnant_233361 - gtid_212164 * slice_233358;\n        int64_t gtid_212165 = remnant_233362;\n        int64_t remnant_233363 = remnant_233362 - gtid_212165;\n        int64_t gtid_212166 = srem64(sext_i32_i64(local_tid_233349),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_212163,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_212164,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_212165,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233349),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_212159,\n                                                                 segment_sizze_nonzzero_233346)))) {\n                int64_t x_212182;\n                \n                x_212182 = ((__global int64_t",
            " *) ext_mem_229372)[gtid_212163 *\n                                                                 n_p_203574 +\n                                                                 gtid_212164];\n                \n                int64_t x_212187;\n                \n                x_212187 = ((__global int64_t *) ext_mem_229471)[gtid_212163 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_212164 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_212165];\n                \n                double x_212188;\n                \n                x_212188 = ((__global double *) ext_mem_229470)[gtid_212163 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_212164 *\n                                                                s_n_m_203726 +\n                                                                gtid_212165];\n                \n                double a0_212189;\n                \n                a0_212189 = ((__global double *) mem_229811)[gtid_212163 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_212164 *\n                                                             s_n_m_203726 +\n                                                             gtid_212165];\n                \n                int64_t defunc_0_m_fun_res_212190;\n                \n                defunc_0_m_fun_res_212190 = ((__global\n                                              int64_t *) mem_2",
            "29816)[gtid_212163 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_212164 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_212165];\n                \n                bool cond_212192 = sle64(x_212182, gtid_212166);\n                int64_t defunc_0_f_res_212193;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212193 = (int64_t) 0;\n                } else {\n                    int64_t i_212194 = add64(gtid_212166, x_212187);\n                    int64_t defunc_0_add_arg_212195;\n                    \n                    defunc_0_add_arg_212195 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_212163 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_212164 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_212194];\n                    \n                    int64_t defunc_1_add_res_212196 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212195);\n                    \n                    defunc_0_f_res_212193 = defunc_1_add_res_212196;\n                }\n                \n                double defunc_0_f_res_212197;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212197 = 0.0;\n                } else {\n                    int64_t i_212198 = add64(gtid_212166, x_212187)",
            ";\n                    double defunc_0_add_arg_212199;\n                    \n                    defunc_0_add_arg_212199 = ((__global\n                                                double *) mem_229639)[gtid_212163 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212198];\n                    defunc_0_f_res_212197 = defunc_0_add_arg_212199;\n                }\n                \n                int64_t binop_p_212200 = sub64(defunc_0_f_res_212193,\n                                               defunc_0_m_fun_res_212190);\n                double defunc_0_f_res_212201 = sitofp_i64_f64(binop_p_212200);\n                double abs_res_212202 = fabs(defunc_0_f_res_212201);\n                double tmp1_212203 = abs_res_212202 / x_212188;\n                double x_212204 = tmp1_212203 * tmp1_212203;\n                double y_212205 = tmp1_212203 * x_212204;\n                double tmp2_212206 = 1.0 - y_212205;\n                double x_212207 = tmp2_212206 * tmp2_212206;\n                double tmp3_212208 = tmp2_212206 * x_212207;\n                double tmp4_212209 = defunc_0_f_res_212197 * tmp3_212208;\n                double defunc_0_f_res_212210;\n                \n                if (cond_212192) {\n                    defunc_0_f_res_212210 = 0.0;\n                } else {\n                    int64_t i_212211 = add64(gtid_212166, x_212187);\n                    double defunc_0_add_arg_212212;\n                    \n                    defunc_0_add_arg_212212 = ((__global\n                                                double *) mem_229634)[gtid_212163 *\n                                                             ",
            "         (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_212164 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_212211];\n                    defunc_0_f_res_212210 = defunc_0_add_arg_212212;\n                }\n                \n                double x_212213 = a0_212189 * tmp4_212209;\n                double defunc_9_fit_fun_res_212214 = defunc_0_f_res_212210 *\n                       x_212213;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)] =\n                        defunc_9_fit_fun_res_212214;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212168;\n                double x_212169;\n                double x_233364;\n                double x_233365;\n                bool ltid_in_bounds_233367 =\n                     slt64(sext_i32_i64(local_tid_233349), q_s_203575 *\n                           squot64(segred_group_sizze_212159,\n                                   segment_sizze_nonzzero_233346));\n                int32_t skip_threads_233368;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233367) {\n                        x_212169 = ((volatile __local\n                                     double *) red_arr_mem_233353)[sext_i32_",
            "i64(local_tid_233349)];\n                        if ((local_tid_233349 - squot32(local_tid_233349, 32) *\n                             32) == 0) {\n                            x_212168 = x_212169;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233368 = 1;\n                    while (slt32(skip_threads_233368, 32)) {\n                        bool thread_active_233369 = sle32(skip_threads_233368,\n                                                          local_tid_233349 -\n                                                          squot32(local_tid_233349,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233367;\n                        \n                        if (thread_active_233369) {\n                            // read operands\n                            {\n                                x_212168 = ((volatile __local\n                                             double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349) -\n                                                                           sext_i32_i64(skip_threads_233368)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233370 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233349),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233349) -\n                                       sext_i32_i64(local_tid_233349 -\n                                       skip_threads_233368));\n                            \n                            if (thread_active_233369 && inactive_233370) {\n                                x_212168 = x_212169;\n                            }\n                            if (thread_ac",
            "tive_233369) {\n                                if (!inactive_233370) {\n                                    double defunc_1_op_res_212170 = x_212168 +\n                                           x_212169;\n                                    \n                                    x_212168 = defunc_1_op_res_212170;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233351, skip_threads_233368)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233369) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)] =\n                                    x_212168;\n                                x_212169 = x_212168;\n                            }\n                        }\n                        if (sle32(wave_sizze_233351, skip_threads_233368)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233368 *= 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_233349 - squot32(local_tid_233349, 32) *\n                         32) == 31 && ltid_in_bounds_233367) {\n                        ((volatile __local\n                          double *) red_arr_mem_233353)[sext_i32_i64(squot32(local_tid_233349,\n                                                                             32))] =\n                            x_212168;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n               ",
            "     int32_t skip_threads_233371;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233349, 32) == 0 &&\n                            ltid_in_bounds_233367) {\n                            x_233365 = ((volatile __local\n                                         double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)];\n                            if ((local_tid_233349 - squot32(local_tid_233349,\n                                                            32) * 32) == 0) {\n                                x_233364 = x_233365;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233371 = 1;\n                        while (slt32(skip_threads_233371, 32)) {\n                            bool thread_active_233372 =\n                                 sle32(skip_threads_233371, local_tid_233349 -\n                                       squot32(local_tid_233349, 32) * 32) &&\n                                 (squot32(local_tid_233349, 32) == 0 &&\n                                  ltid_in_bounds_233367);\n                            \n                            if (thread_active_233372) {\n                                // read operands\n                                {\n                                    x_233364 = ((volatile __local\n                                                 double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349) -\n                                                                               sext_i32_i64(skip_threads_233371)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233373 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233349 *\n               ",
            "                                   32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233349 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233349 -\n                                                         skip_threads_233371) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233372 && inactive_233373) {\n                                    x_233364 = x_233365;\n                                }\n                                if (thread_active_233372) {\n                                    if (!inactive_233373) {\n                                        double defunc_1_op_res_233366 =\n                                               x_233364 + x_233365;\n                                        \n                                        x_233364 = defunc_1_op_res_233366;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233351, skip_threads_233371)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233372) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)] =\n                                        x_233364;\n                                    x_233365 = x_233364;\n                                }\n                            }\n                            if (sle32(wave_sizze_233351, skip_threads_233371)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233371 *= 2;\n                        }\n                  ",
            "  }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233374 = squot32(local_tid_233349, 32) == 0 ||\n                     !ltid_in_bounds_233367;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233374) {\n                            x_212169 = x_212168;\n                            x_212168 = ((__local\n                                         double *) red_arr_mem_233353)[sext_i32_i64(squot32(local_tid_233349,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233375 =\n                             slt64(srem64(sext_i32_i64(local_tid_233349),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233349) -\n                                   sext_i32_i64(squot32(local_tid_233349, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233374) {\n                            if (inactive_233375) {\n                                x_212168 = x_212169;\n                            }\n                        }\n                        if (!no_carry_in_233374) {\n                            if (!inactive_233375) {\n                                double defunc_1_op_res_212170 = x_212168 +\n                                       x_212169;\n                                \n                                x_212168 = defunc_1_op_res_212170;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n       ",
            "                 if (!no_carry_in_233374) {\n                            ((__local\n                              double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)] =\n                                x_212168;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233349, 32) == 0 &&\n                        ltid_in_bounds_233367) {\n                        ((__local\n                          double *) red_arr_mem_233353)[sext_i32_i64(local_tid_233349)] =\n                            x_212169;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233357) *\n                      squot64(segred_group_sizze_212159,\n                              segment_sizze_nonzzero_233346) +\n                      sext_i32_i64(local_tid_233349), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233349),\n                      squot64(segred_group_sizze_212159,\n                              segment_sizze_nonzzero_233346))) {\n                double tmp_233376;\n                \n                tmp_233376 = ((__local\n                               double *) red_arr_mem_233353)[(sext_i32_i64(local_tid_233349) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233346 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229822)[squot64(sext_i32_i64(virt_group_id_233357) *\n                                                squot64(segred_group_sizze_212159,\n          ",
            "                                              segment_sizze_nonzzero_233346) +\n                                                sext_i32_i64(local_tid_233349),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233357) *\n                                                squot64(segred_group_sizze_212159,\n                                                        segment_sizze_nonzzero_233346) +\n                                                sext_i32_i64(local_tid_233349) -\n                                                squot64(sext_i32_i64(virt_group_id_233357) *\n                                                        squot64(segred_group_sizze_212159,\n                                                                segment_sizze_nonzzero_233346) +\n                                                        sext_i32_i64(local_tid_233349),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233357) *\n                                         squot64(segred_group_sizze_212159,\n                                                 segment_sizze_nonzzero_233346) +\n                                         sext_i32_i64(local_tid_233349) -\n                                         squot64(sext_i32_i64(virt_group_id_233357) *\n                                                 squot64(segred_group_sizze_212159,\n                                                         segment_sizze_nonzzero_233346) +\n                                                 sext_i32_i64(local_tid_233349),\n                                       ",
            "          n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233357) *\n                                                 squot64(segred_group_sizze_212159,\n                                                         segment_sizze_nonzzero_233346) +\n                                                 sext_i32_i64(local_tid_233349) -\n                                                 squot64(sext_i32_i64(virt_group_id_233357) *\n                                                         squot64(segred_group_sizze_212159,\n                                                                 segment_sizze_nonzzero_233346) +\n                                                         sext_i32_i64(local_tid_233349),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233376;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_212159\n}\n__kernel void mainzisegred_small_214227(__global int *global_failure,\n                                        uint red_arr_mem_233602_backing_offset_0,\n                                        uint red_arr_mem_233600_backing_offset_1,\n                                        uint red_arr_mem_233598_backing_offset_2,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                      ",
            "                  int64_t num_groups_214218,\n                                        int64_t segment_sizze_nonzzero_233591,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230081,\n                                        __global unsigned char *mem_230091,\n                                        __global unsigned char *mem_230096,\n                                        __global unsigned char *mem_230101)\n{\n    #define segred_group_sizze_214217 (mainzisegred_group_sizze_213183)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233602_backing_2 =\n                           &shared_mem[red_arr_mem_233602_backing_offset_0];\n    volatile unsigned char *red_arr_mem_233600_backing_1 =\n                           &shared_mem[red_arr_mem_233600_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233598_backing_0 =\n                           &shared_mem[red_arr_mem_233598_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233593;\n    int32_t local_tid_233594;\n    int64_t group_sizze_233597;\n    int32_t wave_sizze_233596;\n    int32_t group_tid_233595;\n    \n    global_tid_233593 = get_global_id(0);\n    local_tid_233594 = get_local_id(0);\n    group_sizze_233597 = get_local_size(0);\n    wave_sizze_233596 = LOCKSTEP_WIDTH;\n    group_tid_233595 = get_group_id(0);\n    \n    int32_t phys_tid_214227 = global_tid_233593;\n    __local unsigned char *red_arr_mem_233598;\n    \n    red_arr_mem_233598 = (__local unsigned char *) red_arr_mem_233598_ba",
            "cking_0;\n    \n    __local unsigned char *red_arr_mem_233600;\n    \n    red_arr_mem_233600 = (__local unsigned char *) red_arr_mem_233600_backing_1;\n    \n    __local unsigned char *red_arr_mem_233602;\n    \n    red_arr_mem_233602 = (__local unsigned char *) red_arr_mem_233602_backing_2;\n    \n    int32_t phys_group_id_233604;\n    \n    phys_group_id_233604 = get_group_id(0);\n    for (int32_t i_233605 = 0; i_233605 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_214217,\n                                                  segment_sizze_nonzzero_233591))) -\n                   phys_group_id_233604, sext_i64_i32(num_groups_214218));\n         i_233605++) {\n        int32_t virt_group_id_233606 = phys_group_id_233604 + i_233605 *\n                sext_i64_i32(num_groups_214218);\n        int64_t slice_233607 = s_n_m_203726;\n        int64_t slice_233608 = n_p_203574 * slice_233607;\n        int64_t slice_233609 = partition_sizze_203667 * slice_233608;\n        int64_t gtid_214223 = squot64(squot64(sext_i32_i64(local_tid_233594),\n                                              segment_sizze_nonzzero_233591) +\n                                      sext_i32_i64(virt_group_id_233606) *\n                                      squot64(segred_group_sizze_214217,\n                                              segment_sizze_nonzzero_233591),\n                                      slice_233608);\n        int64_t remnant_233610 = squot64(sext_i32_i64(local_tid_233594),\n                                         segment_sizze_nonzzero_233591) +\n                sext_i32_i64(virt_group_id_233606) *\n                squot64(segred_group_sizze_214217,\n                        segment_sizze_nonzzero_233591) - gtid_214223 *\n                slice_233608;\n        int64_t gtid_214224 = squot64(remnant_233610, slice_233607);\n        int64_t remnant_233611 = remn",
            "ant_233610 - gtid_214224 * slice_233607;\n        int64_t gtid_214225 = remnant_233611;\n        int64_t remnant_233612 = remnant_233611 - gtid_214225;\n        int64_t gtid_214226 = srem64(sext_i32_i64(local_tid_233594),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_214223,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_214224,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_214225,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233594),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233591)))) {\n                int64_t x_214245;\n                \n                x_214245 = ((__global int64_t *) ext_mem_229372)[gtid_214223 *\n                                                                 n_p_203574 +\n                                                                 gtid_214224];\n                \n                int64_t x_214249;\n                \n                x_214249 = ((__global int64_t *) ext_mem_229471)[gtid_214223 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214224 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_214225];\n                \n               ",
            " double x_214250;\n                \n                x_214250 = ((__global double *) ext_mem_229470)[gtid_214223 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214224 *\n                                                                s_n_m_203726 +\n                                                                gtid_214225];\n                \n                int64_t defunc_0_m_fun_res_214251;\n                \n                defunc_0_m_fun_res_214251 = ((__global\n                                              int64_t *) mem_230081)[gtid_214223 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214224 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214225];\n                \n                bool cond_214253 = sle64(x_214245, gtid_214226);\n                int64_t defunc_0_f_res_214254;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214254 = (int64_t) 0;\n                } else {\n                    int64_t i_214255 = add64(gtid_214226, x_214249);\n                    int64_t defunc_0_add_arg_214256;\n                    \n                    defunc_0_add_arg_214256 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214223 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_214224 *\n                    ",
            "                                                       defunc_0_f_res_203721 +\n                                                                           i_214255];\n                    \n                    int64_t defunc_1_add_res_214257 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214256);\n                    \n                    defunc_0_f_res_214254 = defunc_1_add_res_214257;\n                }\n                \n                double defunc_0_f_res_214258;\n                \n                if (cond_214253) {\n                    defunc_0_f_res_214258 = 0.0;\n                } else {\n                    int64_t i_214259 = add64(gtid_214226, x_214249);\n                    double defunc_0_add_arg_214260;\n                    \n                    defunc_0_add_arg_214260 = ((__global\n                                                double *) mem_229639)[gtid_214223 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214224 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214259];\n                    defunc_0_f_res_214258 = defunc_0_add_arg_214260;\n                }\n                \n                int64_t binop_p_214261 = sub64(defunc_0_f_res_214254,\n                                               defunc_0_m_fun_res_214251);\n                double defunc_0_f_res_214262 = sitofp_i64_f64(binop_p_214261);\n                double abs_res_214263 = fabs(defunc_0_f_res_214262);\n                double tmp1_214264 = abs_res_214263 / x_214250;\n                double x_214265 = tmp1_214264 * tmp1_214264;\n                double y_214266 = tmp1_214264 * x_214265;\n                double tmp2_214267 = 1.0 - y_214266;\n   ",
            "             double x_214268 = tmp2_214267 * tmp2_214267;\n                double tmp3_214269 = tmp2_214267 * x_214268;\n                double w_j_214270 = defunc_0_f_res_214258 * tmp3_214269;\n                double xw_j_214271 = defunc_0_f_res_214262 * w_j_214270;\n                double x2w_j_214272 = defunc_0_f_res_214262 * xw_j_214271;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)] =\n                        w_j_214270;\n                    ((__local\n                      double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)] =\n                        xw_j_214271;\n                    ((__local\n                      double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)] =\n                        x2w_j_214272;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214228;\n                double x_214229;\n                double x_214230;\n                double x_214231;\n                double x_214232;\n                double x_214233;\n                double x_233613;\n                double x_233614;\n                double x_233615;\n                double x_233616;\n                double x_233617;\n                double x_233618;\n                bool ltid_in_bounds_233622 =\n",
            "                     slt64(sext_i32_i64(local_tid_233594), q_s_203575 *\n                           squot64(segred_group_sizze_214217,\n                                   segment_sizze_nonzzero_233591));\n                int32_t skip_threads_233623;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233622) {\n                        x_214231 = ((volatile __local\n                                     double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)];\n                        x_214232 = ((volatile __local\n                                     double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)];\n                        x_214233 = ((volatile __local\n                                     double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)];\n                        if ((local_tid_233594 - squot32(local_tid_233594, 32) *\n                             32) == 0) {\n                            x_214228 = x_214231;\n                            x_214229 = x_214232;\n                            x_214230 = x_214233;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233623 = 1;\n                    while (slt32(skip_threads_233623, 32)) {\n                        bool thread_active_233624 = sle32(skip_threads_233623,\n                                                          local_tid_233594 -\n                                                          squot32(local_tid_233594,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233622;\n                        \n                        if (thread_active_233624) {\n                            // read operands\n                            {\n                                x_214228 = ((volatile __local\n                                             double ",
            "*) red_arr_mem_233598)[sext_i32_i64(local_tid_233594) -\n                                                                           sext_i32_i64(skip_threads_233623)];\n                                x_214229 = ((volatile __local\n                                             double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594) -\n                                                                           sext_i32_i64(skip_threads_233623)];\n                                x_214230 = ((volatile __local\n                                             double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594) -\n                                                                           sext_i32_i64(skip_threads_233623)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233625 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233594),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233594) -\n                                       sext_i32_i64(local_tid_233594 -\n                                       skip_threads_233623));\n                            \n                            if (thread_active_233624 && inactive_233625) {\n                                x_214228 = x_214231;\n                                x_214229 = x_214232;\n                                x_214230 = x_214233;\n                            }\n                            if (thread_active_233624) {\n                                if (!inactive_233625) {\n                                    double defunc_1_op_res_214234 = x_214228 +\n                                           x_214231;\n                                    double defunc_1_op_res_214235 = x_214229 +\n                                           x_214232;\n                                    double defunc_1_op_res_214236 = x_214230 +\n   ",
            "                                        x_214233;\n                                    \n                                    x_214228 = defunc_1_op_res_214234;\n                                    x_214229 = defunc_1_op_res_214235;\n                                    x_214230 = defunc_1_op_res_214236;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233596, skip_threads_233623)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233624) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)] =\n                                    x_214228;\n                                x_214231 = x_214228;\n                                ((volatile __local\n                                  double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)] =\n                                    x_214229;\n                                x_214232 = x_214229;\n                                ((volatile __local\n                                  double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)] =\n                                    x_214230;\n                                x_214233 = x_214230;\n                            }\n                        }\n                        if (sle32(wave_sizze_233596, skip_threads_233623)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233623 *= 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_233594 - squot32(local_tid_233594, 32) *\n                         32) == 31 && ltid_in_bounds_233",
            "622) {\n                        ((volatile __local\n                          double *) red_arr_mem_233598)[sext_i32_i64(squot32(local_tid_233594,\n                                                                             32))] =\n                            x_214228;\n                        ((volatile __local\n                          double *) red_arr_mem_233600)[sext_i32_i64(squot32(local_tid_233594,\n                                                                             32))] =\n                            x_214229;\n                        ((volatile __local\n                          double *) red_arr_mem_233602)[sext_i32_i64(squot32(local_tid_233594,\n                                                                             32))] =\n                            x_214230;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233626;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233594, 32) == 0 &&\n                            ltid_in_bounds_233622) {\n                            x_233616 = ((volatile __local\n                                         double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)];\n                            x_233617 = ((volatile __local\n                                         double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)];\n                            x_233618 = ((volatile __local\n                                         double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)];\n                            if ((local_tid_233594 - squot32(local_tid_233594,\n                                                            32) * 32) == 0) {\n                                x_233613 = x_233616;\n                                x_233614 = x_23361",
            "7;\n                                x_233615 = x_233618;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233626 = 1;\n                        while (slt32(skip_threads_233626, 32)) {\n                            bool thread_active_233627 =\n                                 sle32(skip_threads_233626, local_tid_233594 -\n                                       squot32(local_tid_233594, 32) * 32) &&\n                                 (squot32(local_tid_233594, 32) == 0 &&\n                                  ltid_in_bounds_233622);\n                            \n                            if (thread_active_233627) {\n                                // read operands\n                                {\n                                    x_233613 = ((volatile __local\n                                                 double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594) -\n                                                                               sext_i32_i64(skip_threads_233626)];\n                                    x_233614 = ((volatile __local\n                                                 double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594) -\n                                                                               sext_i32_i64(skip_threads_233626)];\n                                    x_233615 = ((volatile __local\n                                                 double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594) -\n                                                                               sext_i32_i64(skip_threads_233626)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233628 =\n                                     slt64(srem64(sext_i32_i64(local_tid_2",
            "33594 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233594 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233594 -\n                                                         skip_threads_233626) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233627 && inactive_233628) {\n                                    x_233613 = x_233616;\n                                    x_233614 = x_233617;\n                                    x_233615 = x_233618;\n                                }\n                                if (thread_active_233627) {\n                                    if (!inactive_233628) {\n                                        double defunc_1_op_res_233619 =\n                                               x_233613 + x_233616;\n                                        double defunc_1_op_res_233620 =\n                                               x_233614 + x_233617;\n                                        double defunc_1_op_res_233621 =\n                                               x_233615 + x_233618;\n                                        \n                                        x_233613 = defunc_1_op_res_233619;\n                                        x_233614 = defunc_1_op_res_233620;\n                                        x_233615 = defunc_1_op_res_233621;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233596, skip_threads_233626)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233627) {\n                                // write result\n                                {\n                                ",
            "    ((volatile __local\n                                      double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)] =\n                                        x_233613;\n                                    x_233616 = x_233613;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)] =\n                                        x_233614;\n                                    x_233617 = x_233614;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)] =\n                                        x_233615;\n                                    x_233618 = x_233615;\n                                }\n                            }\n                            if (sle32(wave_sizze_233596, skip_threads_233626)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233626 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233629 = squot32(local_tid_233594, 32) == 0 ||\n                     !ltid_in_bounds_233622;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233629) {\n                            x_214231 = x_214228;\n                            x_214232 = x_214229;\n                            x_214233 = x_214230;\n                            x_214228 = ((__local\n                                         double *) red_arr_mem_233598)[sext_i32_i64(squot32(local_tid_233594,\n                                                                                            32)) -\n                                                                       (int64_t) 1];",
            "\n                            x_214229 = ((__local\n                                         double *) red_arr_mem_233600)[sext_i32_i64(squot32(local_tid_233594,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214230 = ((__local\n                                         double *) red_arr_mem_233602)[sext_i32_i64(squot32(local_tid_233594,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233630 =\n                             slt64(srem64(sext_i32_i64(local_tid_233594),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233594) -\n                                   sext_i32_i64(squot32(local_tid_233594, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233629) {\n                            if (inactive_233630) {\n                                x_214228 = x_214231;\n                                x_214229 = x_214232;\n                                x_214230 = x_214233;\n                            }\n                        }\n                        if (!no_carry_in_233629) {\n                            if (!inactive_233630) {\n                                double defunc_1_op_res_214234 = x_214228 +\n                                       x_214231;\n                                double defunc_1_op_res_214235 = x_214229 +\n                                       x_214232;\n                                double defunc_1_op_res_214236 = x_214230 +\n                                       x_214233;\n                ",
            "                \n                                x_214228 = defunc_1_op_res_214234;\n                                x_214229 = defunc_1_op_res_214235;\n                                x_214230 = defunc_1_op_res_214236;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233629) {\n                            ((__local\n                              double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)] =\n                                x_214228;\n                            ((__local\n                              double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)] =\n                                x_214229;\n                            ((__local\n                              double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)] =\n                                x_214230;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233594, 32) == 0 &&\n                        ltid_in_bounds_233622) {\n                        ((__local\n                          double *) red_arr_mem_233598)[sext_i32_i64(local_tid_233594)] =\n                            x_214231;\n                        ((__local\n                          double *) red_arr_mem_233600)[sext_i32_i64(local_tid_233594)] =\n                            x_214232;\n                        ((__local\n                          double *) red_arr_mem_233602)[sext_i32_i64(local_tid_233594)] =\n                            x_214233;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233606) *\n                      sq",
            "uot64(segred_group_sizze_214217,\n                              segment_sizze_nonzzero_233591) +\n                      sext_i32_i64(local_tid_233594), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233594),\n                      squot64(segred_group_sizze_214217,\n                              segment_sizze_nonzzero_233591))) {\n                double tmp_233631;\n                \n                tmp_233631 = ((__local\n                               double *) red_arr_mem_233598)[(sext_i32_i64(local_tid_233594) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233591 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230091)[squot64(sext_i32_i64(virt_group_id_233606) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233591) +\n                                                sext_i32_i64(local_tid_233594),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233606) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233591) +\n                                                sext_i32_i64(local_tid_233594) -\n                                                squot64(sext_i32_i64(virt_group_id_233606) *\n                                                        squot64(segred_group_sizze_214217,\n                                                                segment_sizze_nonzzero_233591) +\n                                    ",
            "                    sext_i32_i64(local_tid_233594),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233606) *\n                                         squot64(segred_group_sizze_214217,\n                                                 segment_sizze_nonzzero_233591) +\n                                         sext_i32_i64(local_tid_233594) -\n                                         squot64(sext_i32_i64(virt_group_id_233606) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233591) +\n                                                 sext_i32_i64(local_tid_233594),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233606) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233591) +\n                                                 sext_i32_i64(local_tid_233594) -\n                                                 squot64(sext_i32_i64(virt_group_id_233606) *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233591) +\n                                                         sext_i32_i64(local_tid_233594),\n                                                         n_p_203574 *\n                                                         s_n_m_203",
            "726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233631;\n                \n                double tmp_233632;\n                \n                tmp_233632 = ((__local\n                               double *) red_arr_mem_233600)[(sext_i32_i64(local_tid_233594) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233591 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230096)[squot64(sext_i32_i64(virt_group_id_233606) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233591) +\n                                                sext_i32_i64(local_tid_233594),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233606) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233591) +\n                                                sext_i32_i64(local_tid_233594) -\n                                                squot64(sext_i32_i64(virt_group_id_233606) *\n                                                        squot64(segred_group_sizze_214217,\n                                                                segment_sizze_nonzzero_233591) +\n                                                        sext_i32_i64(local_tid_233594),\n                                                        n_p_203574 *\n                                             ",
            "           s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233606) *\n                                         squot64(segred_group_sizze_214217,\n                                                 segment_sizze_nonzzero_233591) +\n                                         sext_i32_i64(local_tid_233594) -\n                                         squot64(sext_i32_i64(virt_group_id_233606) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233591) +\n                                                 sext_i32_i64(local_tid_233594),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233606) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233591) +\n                                                 sext_i32_i64(local_tid_233594) -\n                                                 squot64(sext_i32_i64(virt_group_id_233606) *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233591) +\n                                                         sext_i32_i64(local_tid_233594),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                ",
            "                         s_n_m_203726)] = tmp_233632;\n                \n                double tmp_233633;\n                \n                tmp_233633 = ((__local\n                               double *) red_arr_mem_233602)[(sext_i32_i64(local_tid_233594) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233591 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230101)[squot64(sext_i32_i64(virt_group_id_233606) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233591) +\n                                                sext_i32_i64(local_tid_233594),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233606) *\n                                                squot64(segred_group_sizze_214217,\n                                                        segment_sizze_nonzzero_233591) +\n                                                sext_i32_i64(local_tid_233594) -\n                                                squot64(sext_i32_i64(virt_group_id_233606) *\n                                                        squot64(segred_group_sizze_214217,\n                                                                segment_sizze_nonzzero_233591) +\n                                                        sext_i32_i64(local_tid_233594),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) ",
            "* s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233606) *\n                                         squot64(segred_group_sizze_214217,\n                                                 segment_sizze_nonzzero_233591) +\n                                         sext_i32_i64(local_tid_233594) -\n                                         squot64(sext_i32_i64(virt_group_id_233606) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233591) +\n                                                 sext_i32_i64(local_tid_233594),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233606) *\n                                                 squot64(segred_group_sizze_214217,\n                                                         segment_sizze_nonzzero_233591) +\n                                                 sext_i32_i64(local_tid_233594) -\n                                                 squot64(sext_i32_i64(virt_group_id_233606) *\n                                                         squot64(segred_group_sizze_214217,\n                                                                 segment_sizze_nonzzero_233591) +\n                                                         sext_i32_i64(local_tid_233594),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233633;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_M",
            "EM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214217\n}\n__kernel void mainzisegred_small_214321(__global int *global_failure,\n                                        uint red_arr_mem_233716_backing_offset_0,\n                                        uint red_arr_mem_233714_backing_offset_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_214313,\n                                        int64_t segment_sizze_nonzzero_233707,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230107,\n                                        __global unsigned char *mem_230112,\n                                        __global unsigned char *mem_230117,\n                                        __global unsigned char *mem_230122,\n                                        __global unsigned char *mem_230128,\n                                        __global unsigned char *mem_230133)\n{\n    #define segred_group_sizze_214312 (mainzisegred_group_sizze_213050)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_233716_backing_1 =\n                           &shared_mem[red_arr_mem_233716_backing_offset_0];\n    volatile unsig",
            "ned char *red_arr_mem_233714_backing_0 =\n                           &shared_mem[red_arr_mem_233714_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233709;\n    int32_t local_tid_233710;\n    int64_t group_sizze_233713;\n    int32_t wave_sizze_233712;\n    int32_t group_tid_233711;\n    \n    global_tid_233709 = get_global_id(0);\n    local_tid_233710 = get_local_id(0);\n    group_sizze_233713 = get_local_size(0);\n    wave_sizze_233712 = LOCKSTEP_WIDTH;\n    group_tid_233711 = get_group_id(0);\n    \n    int32_t phys_tid_214321 = global_tid_233709;\n    __local unsigned char *red_arr_mem_233714;\n    \n    red_arr_mem_233714 = (__local unsigned char *) red_arr_mem_233714_backing_0;\n    \n    __local unsigned char *red_arr_mem_233716;\n    \n    red_arr_mem_233716 = (__local unsigned char *) red_arr_mem_233716_backing_1;\n    \n    int32_t phys_group_id_233718;\n    \n    phys_group_id_233718 = get_group_id(0);\n    for (int32_t i_233719 = 0; i_233719 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_214312,\n                                                  segment_sizze_nonzzero_233707))) -\n                   phys_group_id_233718, sext_i64_i32(num_groups_214313));\n         i_233719++) {\n        int32_t virt_group_id_233720 = phys_group_id_233718 + i_233719 *\n                sext_i64_i32(num_groups_214313);\n        int64_t slice_233721 = s_n_m_203726;\n        int64_t slice_233722 = n_p_203574 * slice_233721;\n        int64_t slice_233723 = partition_sizze_203667 * slice_233722;\n        int64_t gtid_214317 = squot64(squot64(sext_i32_i64(local_tid_233710),\n                                              segment_sizze_nonzzero_233707) +\n                                      sext_i32_i64(virt_group_id_233720) *\n                                      squot64(segred_group_sizze_214312,\n          ",
            "                                    segment_sizze_nonzzero_233707),\n                                      slice_233722);\n        int64_t remnant_233724 = squot64(sext_i32_i64(local_tid_233710),\n                                         segment_sizze_nonzzero_233707) +\n                sext_i32_i64(virt_group_id_233720) *\n                squot64(segred_group_sizze_214312,\n                        segment_sizze_nonzzero_233707) - gtid_214317 *\n                slice_233722;\n        int64_t gtid_214318 = squot64(remnant_233724, slice_233721);\n        int64_t remnant_233725 = remnant_233724 - gtid_214318 * slice_233721;\n        int64_t gtid_214319 = remnant_233725;\n        int64_t remnant_233726 = remnant_233725 - gtid_214319;\n        int64_t gtid_214320 = srem64(sext_i32_i64(local_tid_233710),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_214317,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_214318,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_214319,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233710),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_214312,\n                                                                 segment_sizze_nonzzero_233707)))) {\n                int64_t x_214341;\n                \n                x_214341 = ((__global int64_t *) ext_mem_229372)[gtid_214317 *\n                                                                 n_p_203574 +\n                                                                 gtid_214318];",
            "\n                \n                int64_t x_214348;\n                \n                x_214348 = ((__global int64_t *) ext_mem_229471)[gtid_214317 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_214318 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_214319];\n                \n                double x_214349;\n                \n                x_214349 = ((__global double *) ext_mem_229470)[gtid_214317 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n                                                                gtid_214318 *\n                                                                s_n_m_203726 +\n                                                                gtid_214319];\n                \n                double a11_214350;\n                \n                a11_214350 = ((__global double *) mem_230107)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double b11_214351;\n                \n                b11_214351 = ((__global double *) mem_230112)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n         ",
            "                                                     s_n_m_203726 +\n                                                              gtid_214319];\n                \n                double c11_214352;\n                \n                c11_214352 = ((__global double *) mem_230117)[gtid_214317 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_214318 *\n                                                              s_n_m_203726 +\n                                                              gtid_214319];\n                \n                int64_t defunc_0_m_fun_res_214353;\n                \n                defunc_0_m_fun_res_214353 = ((__global\n                                              int64_t *) mem_230122)[gtid_214317 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_214318 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_214319];\n                \n                bool cond_214355 = sle64(x_214341, gtid_214320);\n                int64_t defunc_0_f_res_214356;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214356 = (int64_t) 0;\n                } else {\n                    int64_t i_214357 = add64(gtid_214320, x_214348);\n                    int64_t defunc_0_add_arg_214358;\n                    \n                    defunc_0_add_arg_214358 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_214317 *\n                                                                           (defunc_0_f_res_203721 *\n                                 ",
            "                                           n_p_203574) +\n                                                                           gtid_214318 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_214357];\n                    \n                    int64_t defunc_1_add_res_214359 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214358);\n                    \n                    defunc_0_f_res_214356 = defunc_1_add_res_214359;\n                }\n                \n                double defunc_0_f_res_214360;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214360 = 0.0;\n                } else {\n                    int64_t i_214361 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_214362;\n                    \n                    defunc_0_add_arg_214362 = ((__global\n                                                double *) mem_229639)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214361];\n                    defunc_0_f_res_214360 = defunc_0_add_arg_214362;\n                }\n                \n                int64_t binop_p_214363 = sub64(defunc_0_f_res_214356,\n                                               defunc_0_m_fun_res_214353);\n                double defunc_0_f_res_214364 = sitofp_i64_f64(binop_p_214363);\n                double abs_res_214365 = fabs(defunc_0_f_res_214364);\n                double tmp1_214366 = abs_res_214365 / x_214349;\n         ",
            "       double x_214367 = tmp1_214366 * tmp1_214366;\n                double y_214368 = tmp1_214366 * x_214367;\n                double tmp2_214369 = 1.0 - y_214368;\n                double x_214370 = tmp2_214369 * tmp2_214369;\n                double tmp3_214371 = tmp2_214369 * x_214370;\n                double tmp4_214372 = defunc_0_f_res_214360 * tmp3_214371;\n                double defunc_1_f_res_214373 = defunc_0_f_res_214364 *\n                       tmp4_214372;\n                double defunc_0_f_res_214374;\n                \n                if (cond_214355) {\n                    defunc_0_f_res_214374 = 0.0;\n                } else {\n                    int64_t i_214375 = add64(gtid_214320, x_214348);\n                    double defunc_0_add_arg_214376;\n                    \n                    defunc_0_add_arg_214376 = ((__global\n                                                double *) mem_229634)[gtid_214317 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_214318 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_214375];\n                    defunc_0_f_res_214374 = defunc_0_add_arg_214376;\n                }\n                \n                double x_214377 = a11_214350 * tmp4_214372;\n                double y_214378 = b11_214351 * defunc_1_f_res_214373;\n                double x_214379 = x_214377 + y_214378;\n                double defunc_9_fit_fun_res_214380 = defunc_0_f_res_214374 *\n                       x_214379;\n                double x_214381 = b11_214351 * tmp4_214372;\n                double y_214382 = c11_214352 * defunc_1_f_res_214373;\n                double x_214383 = x_214381 + y_214382;\n                double defunc_9_slope_fun_res_214384 = d",
            "efunc_0_f_res_214374 *\n                       x_214383;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)] =\n                        defunc_9_fit_fun_res_214380;\n                    ((__local\n                      double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)] =\n                        defunc_9_slope_fun_res_214384;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214322;\n                double x_214323;\n                double x_214324;\n                double x_214325;\n                double x_233727;\n                double x_233728;\n                double x_233729;\n                double x_233730;\n                bool ltid_in_bounds_233733 =\n                     slt64(sext_i32_i64(local_tid_233710), q_s_203575 *\n                           squot64(segred_group_sizze_214312,\n                                   segment_sizze_nonzzero_233707));\n                int32_t skip_threads_233734;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233733) {\n                        x_214324 = ((volatile __local\n                                     double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)];\n                        x_214325 = ((volatile __local\n                                     double *) red_arr_mem_233716)[sext_i32_i64(l",
            "ocal_tid_233710)];\n                        if ((local_tid_233710 - squot32(local_tid_233710, 32) *\n                             32) == 0) {\n                            x_214322 = x_214324;\n                            x_214323 = x_214325;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233734 = 1;\n                    while (slt32(skip_threads_233734, 32)) {\n                        bool thread_active_233735 = sle32(skip_threads_233734,\n                                                          local_tid_233710 -\n                                                          squot32(local_tid_233710,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233733;\n                        \n                        if (thread_active_233735) {\n                            // read operands\n                            {\n                                x_214322 = ((volatile __local\n                                             double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710) -\n                                                                           sext_i32_i64(skip_threads_233734)];\n                                x_214323 = ((volatile __local\n                                             double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710) -\n                                                                           sext_i32_i64(skip_threads_233734)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233736 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233710),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233710) -\n                                    ",
            "   sext_i32_i64(local_tid_233710 -\n                                       skip_threads_233734));\n                            \n                            if (thread_active_233735 && inactive_233736) {\n                                x_214322 = x_214324;\n                                x_214323 = x_214325;\n                            }\n                            if (thread_active_233735) {\n                                if (!inactive_233736) {\n                                    double defunc_1_op_res_214326 = x_214322 +\n                                           x_214324;\n                                    double defunc_1_op_res_214327 = x_214323 +\n                                           x_214325;\n                                    \n                                    x_214322 = defunc_1_op_res_214326;\n                                    x_214323 = defunc_1_op_res_214327;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233712, skip_threads_233734)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233735) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)] =\n                                    x_214322;\n                                x_214324 = x_214322;\n                                ((volatile __local\n                                  double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)] =\n                                    x_214323;\n                                x_214325 = x_214323;\n                            }\n                        }\n                        if (sle32(wave_sizze_233712, skip_threads_233734)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                  ",
            "      skip_threads_233734 *= 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_233710 - squot32(local_tid_233710, 32) *\n                         32) == 31 && ltid_in_bounds_233733) {\n                        ((volatile __local\n                          double *) red_arr_mem_233714)[sext_i32_i64(squot32(local_tid_233710,\n                                                                             32))] =\n                            x_214322;\n                        ((volatile __local\n                          double *) red_arr_mem_233716)[sext_i32_i64(squot32(local_tid_233710,\n                                                                             32))] =\n                            x_214323;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_233737;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233710, 32) == 0 &&\n                            ltid_in_bounds_233733) {\n                            x_233729 = ((volatile __local\n                                         double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)];\n                            x_233730 = ((volatile __local\n                                         double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)];\n                            if ((local_tid_233710 - squot32(local_tid_233710,\n                                                            32) * 32) == 0) {\n                                x_233727 = x_233729;\n                                x_233728 = x_233730;\n                            }\n                        }\n                    ",
            "}\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233737 = 1;\n                        while (slt32(skip_threads_233737, 32)) {\n                            bool thread_active_233738 =\n                                 sle32(skip_threads_233737, local_tid_233710 -\n                                       squot32(local_tid_233710, 32) * 32) &&\n                                 (squot32(local_tid_233710, 32) == 0 &&\n                                  ltid_in_bounds_233733);\n                            \n                            if (thread_active_233738) {\n                                // read operands\n                                {\n                                    x_233727 = ((volatile __local\n                                                 double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710) -\n                                                                               sext_i32_i64(skip_threads_233737)];\n                                    x_233728 = ((volatile __local\n                                                 double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710) -\n                                                                               sext_i32_i64(skip_threads_233737)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233739 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233710 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233710 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233710 -\n                                                         skip_threads_233737) *\n                                           32 + 32 ",
            "- 1));\n                                \n                                if (thread_active_233738 && inactive_233739) {\n                                    x_233727 = x_233729;\n                                    x_233728 = x_233730;\n                                }\n                                if (thread_active_233738) {\n                                    if (!inactive_233739) {\n                                        double defunc_1_op_res_233731 =\n                                               x_233727 + x_233729;\n                                        double defunc_1_op_res_233732 =\n                                               x_233728 + x_233730;\n                                        \n                                        x_233727 = defunc_1_op_res_233731;\n                                        x_233728 = defunc_1_op_res_233732;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233712, skip_threads_233737)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233738) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)] =\n                                        x_233727;\n                                    x_233729 = x_233727;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)] =\n                                        x_233728;\n                                    x_233730 = x_233728;\n                                }\n                            }\n                            if (sle32(wave_sizze_233712, skip_threads_233737)) {\n                                barrier(CLK_LOCAL_MEM_FE",
            "NCE);\n                            }\n                            skip_threads_233737 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233740 = squot32(local_tid_233710, 32) == 0 ||\n                     !ltid_in_bounds_233733;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233740) {\n                            x_214324 = x_214322;\n                            x_214325 = x_214323;\n                            x_214322 = ((__local\n                                         double *) red_arr_mem_233714)[sext_i32_i64(squot32(local_tid_233710,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214323 = ((__local\n                                         double *) red_arr_mem_233716)[sext_i32_i64(squot32(local_tid_233710,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233741 =\n                             slt64(srem64(sext_i32_i64(local_tid_233710),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233710) -\n                                   sext_i32_i64(squot32(local_tid_233710, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233740) {\n                            if (inactive_233741) {\n                                x_214322 = x_214324;\n      ",
            "                          x_214323 = x_214325;\n                            }\n                        }\n                        if (!no_carry_in_233740) {\n                            if (!inactive_233741) {\n                                double defunc_1_op_res_214326 = x_214322 +\n                                       x_214324;\n                                double defunc_1_op_res_214327 = x_214323 +\n                                       x_214325;\n                                \n                                x_214322 = defunc_1_op_res_214326;\n                                x_214323 = defunc_1_op_res_214327;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233740) {\n                            ((__local\n                              double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)] =\n                                x_214322;\n                            ((__local\n                              double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)] =\n                                x_214323;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233710, 32) == 0 &&\n                        ltid_in_bounds_233733) {\n                        ((__local\n                          double *) red_arr_mem_233714)[sext_i32_i64(local_tid_233710)] =\n                            x_214324;\n                        ((__local\n                          double *) red_arr_mem_233716)[sext_i32_i64(local_tid_233710)] =\n                            x_214325;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (",
            "slt64(sext_i32_i64(virt_group_id_233720) *\n                      squot64(segred_group_sizze_214312,\n                              segment_sizze_nonzzero_233707) +\n                      sext_i32_i64(local_tid_233710), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233710),\n                      squot64(segred_group_sizze_214312,\n                              segment_sizze_nonzzero_233707))) {\n                double tmp_233742;\n                \n                tmp_233742 = ((__local\n                               double *) red_arr_mem_233714)[(sext_i32_i64(local_tid_233710) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233707 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230128)[squot64(sext_i32_i64(virt_group_id_233720) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233707) +\n                                                sext_i32_i64(local_tid_233710),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233720) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233707) +\n                                                sext_i32_i64(local_tid_233710) -\n                                                squot64(sext_i32_i64(virt_group_id_233720) *\n                                                        squot64(segred_group_sizze_214312,\n                                                                se",
            "gment_sizze_nonzzero_233707) +\n                                                        sext_i32_i64(local_tid_233710),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233720) *\n                                         squot64(segred_group_sizze_214312,\n                                                 segment_sizze_nonzzero_233707) +\n                                         sext_i32_i64(local_tid_233710) -\n                                         squot64(sext_i32_i64(virt_group_id_233720) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233707) +\n                                                 sext_i32_i64(local_tid_233710),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233720) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233707) +\n                                                 sext_i32_i64(local_tid_233710) -\n                                                 squot64(sext_i32_i64(virt_group_id_233720) *\n                                                         squot64(segred_group_sizze_214312,\n                                                                 segment_sizze_nonzzero_233707) +\n                                                         sext_i32_i64(local_tid_233710),\n                                                         n_p_203574 *",
            "\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233742;\n                \n                double tmp_233743;\n                \n                tmp_233743 = ((__local\n                               double *) red_arr_mem_233716)[(sext_i32_i64(local_tid_233710) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233707 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230133)[squot64(sext_i32_i64(virt_group_id_233720) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233707) +\n                                                sext_i32_i64(local_tid_233710),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_233720) *\n                                                squot64(segred_group_sizze_214312,\n                                                        segment_sizze_nonzzero_233707) +\n                                                sext_i32_i64(local_tid_233710) -\n                                                squot64(sext_i32_i64(virt_group_id_233720) *\n                                                        squot64(segred_group_sizze_214312,\n                                                                segment_sizze_nonzzero_233707) +\n                                                        sext_i32_i64(local_tid_233710),\n                                               ",
            "         n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_233720) *\n                                         squot64(segred_group_sizze_214312,\n                                                 segment_sizze_nonzzero_233707) +\n                                         sext_i32_i64(local_tid_233710) -\n                                         squot64(sext_i32_i64(virt_group_id_233720) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233707) +\n                                                 sext_i32_i64(local_tid_233710),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_233720) *\n                                                 squot64(segred_group_sizze_214312,\n                                                         segment_sizze_nonzzero_233707) +\n                                                 sext_i32_i64(local_tid_233710) -\n                                                 squot64(sext_i32_i64(virt_group_id_233720) *\n                                                         squot64(segred_group_sizze_214312,\n                                                                 segment_sizze_nonzzero_233707) +\n                                                         sext_i32_i64(local_tid_233710),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n              ",
            "                                   s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_233743;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_214312\n}\n__kernel void mainzisegred_small_216874(__global int *global_failure,\n                                        uint red_arr_mem_234003_backing_offset_0,\n                                        uint red_arr_mem_234001_backing_offset_1,\n                                        uint red_arr_mem_233999_backing_offset_2,\n                                        uint red_arr_mem_233997_backing_offset_3,\n                                        uint red_arr_mem_233995_backing_offset_4,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216863,\n                                        int64_t segment_sizze_nonzzero_233988,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                                        __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230420,\n                                        __global unsigned char *mem_230430,\n                                        __global unsigned char *mem_230435,\n                                        __global unsigned char *mem_230440,\n                                        __global unsigned char *mem_2304",
            "45,\n                                        __global unsigned char *mem_230450)\n{\n    #define segred_group_sizze_216862 (mainzisegred_group_sizze_215602)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234003_backing_4 =\n                           &shared_mem[red_arr_mem_234003_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234001_backing_3 =\n                           &shared_mem[red_arr_mem_234001_backing_offset_1];\n    volatile unsigned char *red_arr_mem_233999_backing_2 =\n                           &shared_mem[red_arr_mem_233999_backing_offset_2];\n    volatile unsigned char *red_arr_mem_233997_backing_1 =\n                           &shared_mem[red_arr_mem_233997_backing_offset_3];\n    volatile unsigned char *red_arr_mem_233995_backing_0 =\n                           &shared_mem[red_arr_mem_233995_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233990;\n    int32_t local_tid_233991;\n    int64_t group_sizze_233994;\n    int32_t wave_sizze_233993;\n    int32_t group_tid_233992;\n    \n    global_tid_233990 = get_global_id(0);\n    local_tid_233991 = get_local_id(0);\n    group_sizze_233994 = get_local_size(0);\n    wave_sizze_233993 = LOCKSTEP_WIDTH;\n    group_tid_233992 = get_group_id(0);\n    \n    int32_t phys_tid_216874 = global_tid_233990;\n    __local unsigned char *red_arr_mem_233995;\n    \n    red_arr_mem_233995 = (__local unsigned char *) red_arr_mem_233995_backing_0;\n    \n    __local unsigned char *red_arr_mem_233997;\n    \n    red_arr_mem_233997 = (__local unsigned char *) red_arr_mem_233997_backing_1;\n    \n    __local unsigned char *red_arr_mem_233999;\n    \n    red_arr_mem_233999 = (__local unsigned char *) red_arr_mem_233999_backing_2;\n    \n    __local unsigned char *red_arr_mem_234001;\n    \n    red_arr_mem_234001 = (__local unsigned char *) red_arr_mem_234001_backing_3;\n    \n    __local unsigned char *red_arr_mem_23400",
            "3;\n    \n    red_arr_mem_234003 = (__local unsigned char *) red_arr_mem_234003_backing_4;\n    \n    int32_t phys_group_id_234005;\n    \n    phys_group_id_234005 = get_group_id(0);\n    for (int32_t i_234006 = 0; i_234006 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_216862,\n                                                  segment_sizze_nonzzero_233988))) -\n                   phys_group_id_234005, sext_i64_i32(num_groups_216863));\n         i_234006++) {\n        int32_t virt_group_id_234007 = phys_group_id_234005 + i_234006 *\n                sext_i64_i32(num_groups_216863);\n        int64_t slice_234008 = s_n_m_203726;\n        int64_t slice_234009 = n_p_203574 * slice_234008;\n        int64_t slice_234010 = partition_sizze_203667 * slice_234009;\n        int64_t gtid_216870 = squot64(squot64(sext_i32_i64(local_tid_233991),\n                                              segment_sizze_nonzzero_233988) +\n                                      sext_i32_i64(virt_group_id_234007) *\n                                      squot64(segred_group_sizze_216862,\n                                              segment_sizze_nonzzero_233988),\n                                      slice_234009);\n        int64_t remnant_234011 = squot64(sext_i32_i64(local_tid_233991),\n                                         segment_sizze_nonzzero_233988) +\n                sext_i32_i64(virt_group_id_234007) *\n                squot64(segred_group_sizze_216862,\n                        segment_sizze_nonzzero_233988) - gtid_216870 *\n                slice_234009;\n        int64_t gtid_216871 = squot64(remnant_234011, slice_234008);\n        int64_t remnant_234012 = remnant_234011 - gtid_216871 * slice_234008;\n        int64_t gtid_216872 = remnant_234012;\n        int64_t remnant_234013 = remnant_234012 - gtid_216872;\n        int64_t gtid_216873 = srem64(sext_i32_",
            "i64(local_tid_233991),\n                                     q_s_203575);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_216870,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_216871,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_216872,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_233991),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233988)))) {\n                int64_t x_216898;\n                \n                x_216898 = ((__global int64_t *) ext_mem_229372)[gtid_216870 *\n                                                                 n_p_203574 +\n                                                                 gtid_216871];\n                \n                int64_t x_216902;\n                \n                x_216902 = ((__global int64_t *) ext_mem_229471)[gtid_216870 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_216871 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216872];\n                \n                double x_216903;\n                \n                x_216903 = ((__global double *) ext_mem_229470)[gtid_216870 *\n                                                                (s_n_m_203726 *\n   ",
            "                                                              n_p_203574) +\n                                                                gtid_216871 *\n                                                                s_n_m_203726 +\n                                                                gtid_216872];\n                \n                int64_t defunc_0_m_fun_res_216904;\n                \n                defunc_0_m_fun_res_216904 = ((__global\n                                              int64_t *) mem_230420)[gtid_216870 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216871 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216872];\n                \n                bool cond_216906 = sle64(x_216898, gtid_216873);\n                int64_t defunc_0_f_res_216907;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216907 = (int64_t) 0;\n                } else {\n                    int64_t i_216908 = add64(gtid_216873, x_216902);\n                    int64_t defunc_0_add_arg_216909;\n                    \n                    defunc_0_add_arg_216909 = ((__global\n                                                int64_t *) ext_mem_229373)[gtid_216870 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216871 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_216908];\n                    \n          ",
            "          int64_t defunc_1_add_res_216910 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216909);\n                    \n                    defunc_0_f_res_216907 = defunc_1_add_res_216910;\n                }\n                \n                double defunc_0_f_res_216911;\n                \n                if (cond_216906) {\n                    defunc_0_f_res_216911 = 0.0;\n                } else {\n                    int64_t i_216912 = add64(gtid_216873, x_216902);\n                    double defunc_0_add_arg_216913;\n                    \n                    defunc_0_add_arg_216913 = ((__global\n                                                double *) mem_229639)[gtid_216870 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216871 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_216912];\n                    defunc_0_f_res_216911 = defunc_0_add_arg_216913;\n                }\n                \n                int64_t binop_p_216914 = sub64(defunc_0_f_res_216907,\n                                               defunc_0_m_fun_res_216904);\n                double defunc_0_f_res_216915 = sitofp_i64_f64(binop_p_216914);\n                double abs_res_216916 = fabs(defunc_0_f_res_216915);\n                double tmp1_216917 = abs_res_216916 / x_216903;\n                double x_216918 = tmp1_216917 * tmp1_216917;\n                double y_216919 = tmp1_216917 * x_216918;\n                double tmp2_216920 = 1.0 - y_216919;\n                double x_216921 = tmp2_216920 * tmp2_216920;\n                double tmp3_216922 = tmp2_216920 * x_216921;\n                double w_j_216923 = defunc_0_f_res_216911 * tmp3_216922;\n    ",
            "            double xw_j_216924 = defunc_0_f_res_216915 * w_j_216923;\n                double x2w_j_216925 = defunc_0_f_res_216915 * xw_j_216924;\n                double x3w_j_216926 = defunc_0_f_res_216915 * x2w_j_216925;\n                double x4w_j_216927 = defunc_0_f_res_216915 * x3w_j_216926;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)] =\n                        w_j_216923;\n                    ((__local\n                      double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)] =\n                        xw_j_216924;\n                    ((__local\n                      double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)] =\n                        x2w_j_216925;\n                    ((__local\n                      double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)] =\n                        x3w_j_216926;\n                    ((__local\n                      double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)] =\n                        x4w_j_216927;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0,",
            " q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216875;\n                double x_216876;\n                double x_216877;\n                double x_216878;\n                double x_216879;\n                double x_216880;\n                double x_216881;\n                double x_216882;\n                double x_216883;\n                double x_216884;\n                double x_234014;\n                double x_234015;\n                double x_234016;\n                double x_234017;\n                double x_234018;\n                double x_234019;\n                double x_234020;\n                double x_234021;\n                double x_234022;\n                double x_234023;\n                bool ltid_in_bounds_234029 =\n                     slt64(sext_i32_i64(local_tid_233991), q_s_203575 *\n                           squot64(segred_group_sizze_216862,\n                                   segment_sizze_nonzzero_233988));\n                int32_t skip_threads_234030;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234029) {\n                        x_216880 = ((volatile __local\n                                     double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)];\n                        x_216881 = ((volatile __local\n                                     double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)];\n                        x_216882 = ((volatile __local\n                                     double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)];\n                        x_216883 = ((volatile __local\n                                     double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)];\n                        x_216884 = ((volatile __local\n                                     double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)];\n                        if ((local_tid_233991 - squot32(l",
            "ocal_tid_233991, 32) *\n                             32) == 0) {\n                            x_216875 = x_216880;\n                            x_216876 = x_216881;\n                            x_216877 = x_216882;\n                            x_216878 = x_216883;\n                            x_216879 = x_216884;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234030 = 1;\n                    while (slt32(skip_threads_234030, 32)) {\n                        bool thread_active_234031 = sle32(skip_threads_234030,\n                                                          local_tid_233991 -\n                                                          squot32(local_tid_233991,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234029;\n                        \n                        if (thread_active_234031) {\n                            // read operands\n                            {\n                                x_216875 = ((volatile __local\n                                             double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991) -\n                                                                           sext_i32_i64(skip_threads_234030)];\n                                x_216876 = ((volatile __local\n                                             double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991) -\n                                                                           sext_i32_i64(skip_threads_234030)];\n                                x_216877 = ((volatile __local\n                                             double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991) -\n                                                                           sext_i32_i64(skip_threads_234030)];\n                                x_216878 = ((volatile __local\n         ",
            "                                    double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991) -\n                                                                           sext_i32_i64(skip_threads_234030)];\n                                x_216879 = ((volatile __local\n                                             double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991) -\n                                                                           sext_i32_i64(skip_threads_234030)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234032 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233991),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_233991) -\n                                       sext_i32_i64(local_tid_233991 -\n                                       skip_threads_234030));\n                            \n                            if (thread_active_234031 && inactive_234032) {\n                                x_216875 = x_216880;\n                                x_216876 = x_216881;\n                                x_216877 = x_216882;\n                                x_216878 = x_216883;\n                                x_216879 = x_216884;\n                            }\n                            if (thread_active_234031) {\n                                if (!inactive_234032) {\n                                    double defunc_1_op_res_216885 = x_216875 +\n                                           x_216880;\n                                    double defunc_1_op_res_216886 = x_216876 +\n                                           x_216881;\n                                    double defunc_1_op_res_216887 = x_216877 +\n                                           x_216882;\n                                    double defunc_1_op_res_216888 = x_216878 +\n   ",
            "                                        x_216883;\n                                    double defunc_1_op_res_216889 = x_216879 +\n                                           x_216884;\n                                    \n                                    x_216875 = defunc_1_op_res_216885;\n                                    x_216876 = defunc_1_op_res_216886;\n                                    x_216877 = defunc_1_op_res_216887;\n                                    x_216878 = defunc_1_op_res_216888;\n                                    x_216879 = defunc_1_op_res_216889;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233993, skip_threads_234030)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234031) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)] =\n                                    x_216875;\n                                x_216880 = x_216875;\n                                ((volatile __local\n                                  double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)] =\n                                    x_216876;\n                                x_216881 = x_216876;\n                                ((volatile __local\n                                  double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)] =\n                                    x_216877;\n                                x_216882 = x_216877;\n                                ((volatile __local\n                                  double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)] =\n                                    x_216878;\n                                x_216883 = x_216878;\n                                ((volatile __local\n      ",
            "                            double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)] =\n                                    x_216879;\n                                x_216884 = x_216879;\n                            }\n                        }\n                        if (sle32(wave_sizze_233993, skip_threads_234030)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234030 *= 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_233991 - squot32(local_tid_233991, 32) *\n                         32) == 31 && ltid_in_bounds_234029) {\n                        ((volatile __local\n                          double *) red_arr_mem_233995)[sext_i32_i64(squot32(local_tid_233991,\n                                                                             32))] =\n                            x_216875;\n                        ((volatile __local\n                          double *) red_arr_mem_233997)[sext_i32_i64(squot32(local_tid_233991,\n                                                                             32))] =\n                            x_216876;\n                        ((volatile __local\n                          double *) red_arr_mem_233999)[sext_i32_i64(squot32(local_tid_233991,\n                                                                             32))] =\n                            x_216877;\n                        ((volatile __local\n                          double *) red_arr_mem_234001)[sext_i32_i64(squot32(local_tid_233991,\n                                                                             32))] =\n                            x_216878;\n                        ((volatile __local\n                          double *) red_arr_mem_234003)[sext_i32_i64(squot32(local_tid_233991,\n                                         ",
            "                                    32))] =\n                            x_216879;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234033;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233991, 32) == 0 &&\n                            ltid_in_bounds_234029) {\n                            x_234019 = ((volatile __local\n                                         double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)];\n                            x_234020 = ((volatile __local\n                                         double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)];\n                            x_234021 = ((volatile __local\n                                         double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)];\n                            x_234022 = ((volatile __local\n                                         double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)];\n                            x_234023 = ((volatile __local\n                                         double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)];\n                            if ((local_tid_233991 - squot32(local_tid_233991,\n                                                            32) * 32) == 0) {\n                                x_234014 = x_234019;\n                                x_234015 = x_234020;\n                                x_234016 = x_234021;\n                                x_234017 = x_234022;\n                                x_234018 = x_234023;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234033 = 1;\n     ",
            "                   while (slt32(skip_threads_234033, 32)) {\n                            bool thread_active_234034 =\n                                 sle32(skip_threads_234033, local_tid_233991 -\n                                       squot32(local_tid_233991, 32) * 32) &&\n                                 (squot32(local_tid_233991, 32) == 0 &&\n                                  ltid_in_bounds_234029);\n                            \n                            if (thread_active_234034) {\n                                // read operands\n                                {\n                                    x_234014 = ((volatile __local\n                                                 double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991) -\n                                                                               sext_i32_i64(skip_threads_234033)];\n                                    x_234015 = ((volatile __local\n                                                 double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991) -\n                                                                               sext_i32_i64(skip_threads_234033)];\n                                    x_234016 = ((volatile __local\n                                                 double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991) -\n                                                                               sext_i32_i64(skip_threads_234033)];\n                                    x_234017 = ((volatile __local\n                                                 double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991) -\n                                                                               sext_i32_i64(skip_threads_234033)];\n                                    x_234018 = ((volatile __local\n                                                 double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991) -\n                                                                               ",
            "sext_i32_i64(skip_threads_234033)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234035 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233991 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_233991 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233991 -\n                                                         skip_threads_234033) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234034 && inactive_234035) {\n                                    x_234014 = x_234019;\n                                    x_234015 = x_234020;\n                                    x_234016 = x_234021;\n                                    x_234017 = x_234022;\n                                    x_234018 = x_234023;\n                                }\n                                if (thread_active_234034) {\n                                    if (!inactive_234035) {\n                                        double defunc_1_op_res_234024 =\n                                               x_234014 + x_234019;\n                                        double defunc_1_op_res_234025 =\n                                               x_234015 + x_234020;\n                                        double defunc_1_op_res_234026 =\n                                               x_234016 + x_234021;\n                                        double defunc_1_op_res_234027 =\n                                               x_234017 + x_234022;\n                                        double defunc_1_op_res_234028 =\n                                               x_234018 + x_234023;\n         ",
            "                               \n                                        x_234014 = defunc_1_op_res_234024;\n                                        x_234015 = defunc_1_op_res_234025;\n                                        x_234016 = defunc_1_op_res_234026;\n                                        x_234017 = defunc_1_op_res_234027;\n                                        x_234018 = defunc_1_op_res_234028;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233993, skip_threads_234033)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234034) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)] =\n                                        x_234014;\n                                    x_234019 = x_234014;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)] =\n                                        x_234015;\n                                    x_234020 = x_234015;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)] =\n                                        x_234016;\n                                    x_234021 = x_234016;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)] =\n                                        x_234017;\n                                    x_234022 = x_234017;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234003)[s",
            "ext_i32_i64(local_tid_233991)] =\n                                        x_234018;\n                                    x_234023 = x_234018;\n                                }\n                            }\n                            if (sle32(wave_sizze_233993, skip_threads_234033)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234033 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234036 = squot32(local_tid_233991, 32) == 0 ||\n                     !ltid_in_bounds_234029;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234036) {\n                            x_216880 = x_216875;\n                            x_216881 = x_216876;\n                            x_216882 = x_216877;\n                            x_216883 = x_216878;\n                            x_216884 = x_216879;\n                            x_216875 = ((__local\n                                         double *) red_arr_mem_233995)[sext_i32_i64(squot32(local_tid_233991,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216876 = ((__local\n                                         double *) red_arr_mem_233997)[sext_i32_i64(squot32(local_tid_233991,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216877 = ((__local\n                                         double *) red_arr_mem_233999)[sext_i32_i64(squot32(local_tid_233991,\n                   ",
            "                                                                         32)) -\n                                                                       (int64_t) 1];\n                            x_216878 = ((__local\n                                         double *) red_arr_mem_234001)[sext_i32_i64(squot32(local_tid_233991,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216879 = ((__local\n                                         double *) red_arr_mem_234003)[sext_i32_i64(squot32(local_tid_233991,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234037 =\n                             slt64(srem64(sext_i32_i64(local_tid_233991),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_233991) -\n                                   sext_i32_i64(squot32(local_tid_233991, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234036) {\n                            if (inactive_234037) {\n                                x_216875 = x_216880;\n                                x_216876 = x_216881;\n                                x_216877 = x_216882;\n                                x_216878 = x_216883;\n                                x_216879 = x_216884;\n                            }\n                        }\n                        if (!no_carry_in_234036) {\n                            if (!inactive_234037) {\n                                double defunc_1_op_res_216885 = x_216875 +\n                                       x_21",
            "6880;\n                                double defunc_1_op_res_216886 = x_216876 +\n                                       x_216881;\n                                double defunc_1_op_res_216887 = x_216877 +\n                                       x_216882;\n                                double defunc_1_op_res_216888 = x_216878 +\n                                       x_216883;\n                                double defunc_1_op_res_216889 = x_216879 +\n                                       x_216884;\n                                \n                                x_216875 = defunc_1_op_res_216885;\n                                x_216876 = defunc_1_op_res_216886;\n                                x_216877 = defunc_1_op_res_216887;\n                                x_216878 = defunc_1_op_res_216888;\n                                x_216879 = defunc_1_op_res_216889;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234036) {\n                            ((__local\n                              double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)] =\n                                x_216875;\n                            ((__local\n                              double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)] =\n                                x_216876;\n                            ((__local\n                              double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)] =\n                                x_216877;\n                            ((__local\n                              double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)] =\n                                x_216878;\n                            ((__local\n                              double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)] =\n                                x_216879;\n                        }\n                    }\n                }\n ",
            "               barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233991, 32) == 0 &&\n                        ltid_in_bounds_234029) {\n                        ((__local\n                          double *) red_arr_mem_233995)[sext_i32_i64(local_tid_233991)] =\n                            x_216880;\n                        ((__local\n                          double *) red_arr_mem_233997)[sext_i32_i64(local_tid_233991)] =\n                            x_216881;\n                        ((__local\n                          double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233991)] =\n                            x_216882;\n                        ((__local\n                          double *) red_arr_mem_234001)[sext_i32_i64(local_tid_233991)] =\n                            x_216883;\n                        ((__local\n                          double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233991)] =\n                            x_216884;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234007) *\n                      squot64(segred_group_sizze_216862,\n                              segment_sizze_nonzzero_233988) +\n                      sext_i32_i64(local_tid_233991), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_233991),\n                      squot64(segred_group_sizze_216862,\n                              segment_sizze_nonzzero_233988))) {\n                double tmp_234038;\n                \n                tmp_234038 = ((__local\n                               double *) red_arr_mem_233995)[(sext_i32_i64(local_tid_233991) +\n                                                              (int64_t) 1) *\n          ",
            "                                                   segment_sizze_nonzzero_233988 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230430)[squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991) -\n                                                squot64(sext_i32_i64(virt_group_id_234007) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233988) +\n                                                        sext_i32_i64(local_tid_233991),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234007) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233988) +\n                                         sext_i32_i64(local_tid_233991) -\n                 ",
            "                        squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991) -\n                                                 squot64(sext_i32_i64(virt_group_id_234007) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233988) +\n                                                         sext_i32_i64(local_tid_233991),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234038;\n                \n                double tmp_234039;\n                \n                tmp_234039 = ((__local\n                               double *) red_arr_mem_233997)[(sext_i32_i64(local_tid_233991) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233988 -\n                                                             (int64_t) 1];\n        ",
            "        ((__global\n                  double *) mem_230435)[squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991) -\n                                                squot64(sext_i32_i64(virt_group_id_234007) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233988) +\n                                                        sext_i32_i64(local_tid_233991),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234007) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233988) +\n                                         sext_i32_i64(local_tid_233991) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n             ",
            "                                            segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991) -\n                                                 squot64(sext_i32_i64(virt_group_id_234007) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233988) +\n                                                         sext_i32_i64(local_tid_233991),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234039;\n                \n                double tmp_234040;\n                \n                tmp_234040 = ((__local\n                               double *) red_arr_mem_233999)[(sext_i32_i64(local_tid_233991) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233988 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230440)[squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred",
            "_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991) -\n                                                squot64(sext_i32_i64(virt_group_id_234007) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233988) +\n                                                        sext_i32_i64(local_tid_233991),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234007) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233988) +\n                                         sext_i32_i64(local_tid_233991) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991),\n        ",
            "                                         n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991) -\n                                                 squot64(sext_i32_i64(virt_group_id_234007) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233988) +\n                                                         sext_i32_i64(local_tid_233991),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234040;\n                \n                double tmp_234041;\n                \n                tmp_234041 = ((__local\n                               double *) red_arr_mem_234001)[(sext_i32_i64(local_tid_233991) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233988 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230445)[squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32",
            "_i64(local_tid_233991),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991) -\n                                                squot64(sext_i32_i64(virt_group_id_234007) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233988) +\n                                                        sext_i32_i64(local_tid_233991),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234007) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233988) +\n                                         sext_i32_i64(local_tid_233991) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                         ",
            "                squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991) -\n                                                 squot64(sext_i32_i64(virt_group_id_234007) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233988) +\n                                                         sext_i32_i64(local_tid_233991),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234041;\n                \n                double tmp_234042;\n                \n                tmp_234042 = ((__local\n                               double *) red_arr_mem_234003)[(sext_i32_i64(local_tid_233991) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233988 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230450)[squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_20357",
            "4) +\n                                        squot64(sext_i32_i64(virt_group_id_234007) *\n                                                squot64(segred_group_sizze_216862,\n                                                        segment_sizze_nonzzero_233988) +\n                                                sext_i32_i64(local_tid_233991) -\n                                                squot64(sext_i32_i64(virt_group_id_234007) *\n                                                        squot64(segred_group_sizze_216862,\n                                                                segment_sizze_nonzzero_233988) +\n                                                        sext_i32_i64(local_tid_233991),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234007) *\n                                         squot64(segred_group_sizze_216862,\n                                                 segment_sizze_nonzzero_233988) +\n                                         sext_i32_i64(local_tid_233991) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                                                         segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234007) *\n                                                 squot64(segred_group_sizze_216862,\n                     ",
            "                                    segment_sizze_nonzzero_233988) +\n                                                 sext_i32_i64(local_tid_233991) -\n                                                 squot64(sext_i32_i64(virt_group_id_234007) *\n                                                         squot64(segred_group_sizze_216862,\n                                                                 segment_sizze_nonzzero_233988) +\n                                                         sext_i32_i64(local_tid_233991),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234042;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216862\n}\n__kernel void mainzisegred_small_216997(__global int *global_failure,\n                                        uint red_arr_mem_234141_backing_offset_0,\n                                        uint red_arr_mem_234139_backing_offset_1,\n                                        int64_t n_p_203574, int64_t q_s_203575,\n                                        int64_t partition_sizze_203667,\n                                        int64_t defunc_0_f_res_203721,\n                                        int64_t s_n_m_203726,\n                                        int64_t num_groups_216989,\n                                        int64_t segment_sizze_nonzzero_234132,\n                                        __global unsigned char *ext_mem_229372,\n                                        __global unsigned char *ext_mem_229373,\n                                        __global unsigned char *ext_mem_229470,\n                   ",
            "                     __global unsigned char *ext_mem_229471,\n                                        __global unsigned char *mem_229634,\n                                        __global unsigned char *mem_229639,\n                                        __global unsigned char *mem_230456,\n                                        __global unsigned char *mem_230461,\n                                        __global unsigned char *mem_230466,\n                                        __global unsigned char *mem_230471,\n                                        __global unsigned char *mem_230476,\n                                        __global unsigned char *mem_230481,\n                                        __global unsigned char *mem_230487,\n                                        __global unsigned char *mem_230492)\n{\n    #define segred_group_sizze_216988 (mainzisegred_group_sizze_215433)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234141_backing_1 =\n                           &shared_mem[red_arr_mem_234141_backing_offset_0];\n    volatile unsigned char *red_arr_mem_234139_backing_0 =\n                           &shared_mem[red_arr_mem_234139_backing_offset_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_216997 = 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 *red_arr_mem_234141;\n    \n    red_arr_mem_234141 = (__local unsigned char *) red_arr_mem_234141_bac",
            "king_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(sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                          s_n_m_203726,\n                                          squot64(segred_group_sizze_216988,\n                                                  segment_sizze_nonzzero_234132))) -\n                   phys_group_id_234143, sext_i64_i32(num_groups_216989));\n         i_234144++) {\n        int32_t virt_group_id_234145 = phys_group_id_234143 + i_234144 *\n                sext_i64_i32(num_groups_216989);\n        int64_t slice_234146 = s_n_m_203726;\n        int64_t slice_234147 = n_p_203574 * slice_234146;\n        int64_t slice_234148 = partition_sizze_203667 * slice_234147;\n        int64_t gtid_216993 = squot64(squot64(sext_i32_i64(local_tid_234135),\n                                              segment_sizze_nonzzero_234132) +\n                                      sext_i32_i64(virt_group_id_234145) *\n                                      squot64(segred_group_sizze_216988,\n                                              segment_sizze_nonzzero_234132),\n                                      slice_234147);\n        int64_t remnant_234149 = squot64(sext_i32_i64(local_tid_234135),\n                                         segment_sizze_nonzzero_234132) +\n                sext_i32_i64(virt_group_id_234145) *\n                squot64(segred_group_sizze_216988,\n                        segment_sizze_nonzzero_234132) - gtid_216993 *\n                slice_234147;\n        int64_t gtid_216994 = squot64(remnant_234149, slice_234146);\n        int64_t remnant_234150 = remnant_234149 - gtid_216994 * slice_234146;\n        int64_t gtid_216995 = remnant_234150;\n        int64_t remnant_234151 = remnant_234150 - gtid_216995;\n        int64_t gtid_216996 = srem64(sext_i32_i64(local_tid_234135),\n                                     q_s_203575);\n        ",
            "\n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203575) && (((slt64(gtid_216993,\n                                                           partition_sizze_203667) &&\n                                                     slt64(gtid_216994,\n                                                           n_p_203574)) &&\n                                                    slt64(gtid_216995,\n                                                          s_n_m_203726)) &&\n                                                   slt64(sext_i32_i64(local_tid_234135),\n                                                         q_s_203575 *\n                                                         squot64(segred_group_sizze_216988,\n                                                                 segment_sizze_nonzzero_234132)))) {\n                int64_t x_217019;\n                \n                x_217019 = ((__global int64_t *) ext_mem_229372)[gtid_216993 *\n                                                                 n_p_203574 +\n                                                                 gtid_216994];\n                \n                int64_t x_217028;\n                \n                x_217028 = ((__global int64_t *) ext_mem_229471)[gtid_216993 *\n                                                                 (s_n_m_203726 *\n                                                                  n_p_203574) +\n                                                                 gtid_216994 *\n                                                                 s_n_m_203726 +\n                                                                 gtid_216995];\n                \n                double x_217029;\n                \n                x_217029 = ((__global double *) ext_mem_229470)[gtid_216993 *\n                                                                (s_n_m_203726 *\n                                                                 n_p_203574) +\n     ",
            "                                                           gtid_216994 *\n                                                                s_n_m_203726 +\n                                                                gtid_216995];\n                \n                double a12_217030;\n                \n                a12_217030 = ((__global double *) mem_230456)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b12_217031;\n                \n                b12_217031 = ((__global double *) mem_230461)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double c12_217032;\n                \n                c12_217032 = ((__global double *) mem_230466)[gtid_216993 *\n                                                              (s_n_m_203726 *\n                                                               n_p_203574) +\n                                                              gtid_216994 *\n                                                              s_n_m_203726 +\n                                                              gtid_216995];\n                \n                double b2_217033;\n                \n                b2_217033 = ((__global double *) mem_230471)[gtid_216993 *\n                                        ",
            "                     (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                double c2_217034;\n                \n                c2_217034 = ((__global double *) mem_230476)[gtid_216993 *\n                                                             (s_n_m_203726 *\n                                                              n_p_203574) +\n                                                             gtid_216994 *\n                                                             s_n_m_203726 +\n                                                             gtid_216995];\n                \n                int64_t defunc_0_m_fun_res_217035;\n                \n                defunc_0_m_fun_res_217035 = ((__global\n                                              int64_t *) mem_230481)[gtid_216993 *\n                                                                     (s_n_m_203726 *\n                                                                      n_p_203574) +\n                                                                     gtid_216994 *\n                                                                     s_n_m_203726 +\n                                                                     gtid_216995];\n                \n                bool cond_217037 = sle64(x_217019, gtid_216996);\n                int64_t defunc_0_f_res_217038;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217038 = (int64_t) 0;\n                } else {\n                    int64_t i_217039 = add64(gtid_216996, x_217028);\n                    int64_t defunc_0_add_arg_217040;\n                    \n                    defunc_0_add_arg_217040 = ((__global\n                                  ",
            "              int64_t *) ext_mem_229373)[gtid_216993 *\n                                                                           (defunc_0_f_res_203721 *\n                                                                            n_p_203574) +\n                                                                           gtid_216994 *\n                                                                           defunc_0_f_res_203721 +\n                                                                           i_217039];\n                    \n                    int64_t defunc_1_add_res_217041 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_217040);\n                    \n                    defunc_0_f_res_217038 = defunc_1_add_res_217041;\n                }\n                \n                double defunc_0_f_res_217042;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217042 = 0.0;\n                } else {\n                    int64_t i_217043 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217044;\n                    \n                    defunc_0_add_arg_217044 = ((__global\n                                                double *) mem_229639)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216994 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_217043];\n                    defunc_0_f_res_217042 = defunc_0_add_arg_217044;\n                }\n                \n                int64_t binop_p_217045 = sub64(defunc_0_f_res_217038,\n                                               defunc_0_m_fun_res_217035);\n                double defunc_0_f",
            "_res_217046 = sitofp_i64_f64(binop_p_217045);\n                double abs_res_217047 = fabs(defunc_0_f_res_217046);\n                double tmp1_217048 = abs_res_217047 / x_217029;\n                double x_217049 = tmp1_217048 * tmp1_217048;\n                double y_217050 = tmp1_217048 * x_217049;\n                double tmp2_217051 = 1.0 - y_217050;\n                double x_217052 = tmp2_217051 * tmp2_217051;\n                double tmp3_217053 = tmp2_217051 * x_217052;\n                double tmp4_217054 = defunc_0_f_res_217042 * tmp3_217053;\n                double defunc_1_f_res_217055 = defunc_0_f_res_217046 *\n                       tmp4_217054;\n                double defunc_1_f_res_217056 = defunc_0_f_res_217046 *\n                       defunc_1_f_res_217055;\n                double defunc_0_f_res_217057;\n                \n                if (cond_217037) {\n                    defunc_0_f_res_217057 = 0.0;\n                } else {\n                    int64_t i_217058 = add64(gtid_216996, x_217028);\n                    double defunc_0_add_arg_217059;\n                    \n                    defunc_0_add_arg_217059 = ((__global\n                                                double *) mem_229634)[gtid_216993 *\n                                                                      (defunc_0_f_res_203721 *\n                                                                       n_p_203574) +\n                                                                      gtid_216994 *\n                                                                      defunc_0_f_res_203721 +\n                                                                      i_217058];\n                    defunc_0_f_res_217057 = defunc_0_add_arg_217059;\n                }\n                \n                double x_217060 = a12_217030 * tmp4_217054;\n                double y_217061 = b12_217031 * defunc_1_f_res_217055;\n                double x_217062 = x_217060 + y_217061;\n                double y_217063 = c12_217032 *",
            " defunc_1_f_res_217056;\n                double x_217064 = x_217062 + y_217063;\n                double defunc_9_fit_fun_res_217065 = defunc_0_f_res_217057 *\n                       x_217064;\n                double x_217066 = b12_217031 * tmp4_217054;\n                double y_217067 = b2_217033 * defunc_1_f_res_217055;\n                double x_217068 = x_217066 + y_217067;\n                double y_217069 = c2_217034 * defunc_1_f_res_217056;\n                double x_217070 = x_217068 + y_217069;\n                double defunc_9_slope_fun_res_217071 = defunc_0_f_res_217057 *\n                       x_217070;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                        defunc_9_fit_fun_res_217065;\n                    ((__local\n                      double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)] =\n                        defunc_9_slope_fun_res_217071;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203575)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216998;\n                double x_216999;\n                double x_217000;\n                double x_217001;\n                double x_234152;\n                double x_234153;\n                double x_234154;\n                double x_234155;\n                bool ltid_in_bounds_234158 =\n                     slt64(sext_i32_i64(local_tid_234135), q_s_203575 *\n                           squot64(segred_g",
            "roup_sizze_216988,\n                                   segment_sizze_nonzzero_234132));\n                int32_t skip_threads_234159;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234158) {\n                        x_217000 = ((volatile __local\n                                     double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)];\n                        x_217001 = ((volatile __local\n                                     double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)];\n                        if ((local_tid_234135 - squot32(local_tid_234135, 32) *\n                             32) == 0) {\n                            x_216998 = x_217000;\n                            x_216999 = x_217001;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234159 = 1;\n                    while (slt32(skip_threads_234159, 32)) {\n                        bool thread_active_234160 = sle32(skip_threads_234159,\n                                                          local_tid_234135 -\n                                                          squot32(local_tid_234135,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234158;\n                        \n                        if (thread_active_234160) {\n                            // read operands\n                            {\n                                x_216998 = ((volatile __local\n                                             double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135) -\n                                                                           sext_i32_i64(skip_threads_234159)];\n                                x_216999 = ((volatile __local\n                                             double *) red_arr_mem_234141)[sext_i32_i64(l",
            "ocal_tid_234135) -\n                                                                           sext_i32_i64(skip_threads_234159)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234161 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234135),\n                                              q_s_203575),\n                                       sext_i32_i64(local_tid_234135) -\n                                       sext_i32_i64(local_tid_234135 -\n                                       skip_threads_234159));\n                            \n                            if (thread_active_234160 && inactive_234161) {\n                                x_216998 = x_217000;\n                                x_216999 = x_217001;\n                            }\n                            if (thread_active_234160) {\n                                if (!inactive_234161) {\n                                    double defunc_1_op_res_217002 = x_216998 +\n                                           x_217000;\n                                    double defunc_1_op_res_217003 = x_216999 +\n                                           x_217001;\n                                    \n                                    x_216998 = defunc_1_op_res_217002;\n                                    x_216999 = defunc_1_op_res_217003;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234137, skip_threads_234159)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234160) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                             ",
            "       x_216998;\n                                x_217000 = x_216998;\n                                ((volatile __local\n                                  double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)] =\n                                    x_216999;\n                                x_217001 = x_216999;\n                            }\n                        }\n                        if (sle32(wave_sizze_234137, skip_threads_234159)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234159 *= 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_234135 - squot32(local_tid_234135, 32) *\n                         32) == 31 && ltid_in_bounds_234158) {\n                        ((volatile __local\n                          double *) red_arr_mem_234139)[sext_i32_i64(squot32(local_tid_234135,\n                                                                             32))] =\n                            x_216998;\n                        ((volatile __local\n                          double *) red_arr_mem_234141)[sext_i32_i64(squot32(local_tid_234135,\n                                                                             32))] =\n                            x_216999;\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_234162;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234135, 32) == 0 &&\n                            ltid_in_bounds_234158) {\n                            x_234154 = ((volatile __local\n                                         double *) ",
            "red_arr_mem_234139)[sext_i32_i64(local_tid_234135)];\n                            x_234155 = ((volatile __local\n                                         double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)];\n                            if ((local_tid_234135 - squot32(local_tid_234135,\n                                                            32) * 32) == 0) {\n                                x_234152 = x_234154;\n                                x_234153 = x_234155;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234162 = 1;\n                        while (slt32(skip_threads_234162, 32)) {\n                            bool thread_active_234163 =\n                                 sle32(skip_threads_234162, local_tid_234135 -\n                                       squot32(local_tid_234135, 32) * 32) &&\n                                 (squot32(local_tid_234135, 32) == 0 &&\n                                  ltid_in_bounds_234158);\n                            \n                            if (thread_active_234163) {\n                                // read operands\n                                {\n                                    x_234152 = ((volatile __local\n                                                 double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135) -\n                                                                               sext_i32_i64(skip_threads_234162)];\n                                    x_234153 = ((volatile __local\n                                                 double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135) -\n                                                                               sext_i32_i64(skip_threads_234162)];\n                                }\n                            }\n                            // perform operation\n                            {\n ",
            "                               bool inactive_234164 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234135 *\n                                                  32 + 32 - 1), q_s_203575),\n                                           sext_i32_i64(local_tid_234135 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234135 -\n                                                         skip_threads_234162) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234163 && inactive_234164) {\n                                    x_234152 = x_234154;\n                                    x_234153 = x_234155;\n                                }\n                                if (thread_active_234163) {\n                                    if (!inactive_234164) {\n                                        double defunc_1_op_res_234156 =\n                                               x_234152 + x_234154;\n                                        double defunc_1_op_res_234157 =\n                                               x_234153 + x_234155;\n                                        \n                                        x_234152 = defunc_1_op_res_234156;\n                                        x_234153 = defunc_1_op_res_234157;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234137, skip_threads_234162)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234163) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                   ",
            "                     x_234152;\n                                    x_234154 = x_234152;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)] =\n                                        x_234153;\n                                    x_234155 = x_234153;\n                                }\n                            }\n                            if (sle32(wave_sizze_234137, skip_threads_234162)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234162 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234165 = squot32(local_tid_234135, 32) == 0 ||\n                     !ltid_in_bounds_234158;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234165) {\n                            x_217000 = x_216998;\n                            x_217001 = x_216999;\n                            x_216998 = ((__local\n                                         double *) red_arr_mem_234139)[sext_i32_i64(squot32(local_tid_234135,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216999 = ((__local\n                                         double *) red_arr_mem_234141)[sext_i32_i64(squot32(local_tid_234135,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n  ",
            "                      bool inactive_234166 =\n                             slt64(srem64(sext_i32_i64(local_tid_234135),\n                                          q_s_203575),\n                                   sext_i32_i64(local_tid_234135) -\n                                   sext_i32_i64(squot32(local_tid_234135, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234165) {\n                            if (inactive_234166) {\n                                x_216998 = x_217000;\n                                x_216999 = x_217001;\n                            }\n                        }\n                        if (!no_carry_in_234165) {\n                            if (!inactive_234166) {\n                                double defunc_1_op_res_217002 = x_216998 +\n                                       x_217000;\n                                double defunc_1_op_res_217003 = x_216999 +\n                                       x_217001;\n                                \n                                x_216998 = defunc_1_op_res_217002;\n                                x_216999 = defunc_1_op_res_217003;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234165) {\n                            ((__local\n                              double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                                x_216998;\n                            ((__local\n                              double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)] =\n                                x_216999;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234135, 32) == 0 &&\n                        ltid_in_bou",
            "nds_234158) {\n                        ((__local\n                          double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                            x_217000;\n                        ((__local\n                          double *) red_arr_mem_234141)[sext_i32_i64(local_tid_234135)] =\n                            x_217001;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234145) *\n                      squot64(segred_group_sizze_216988,\n                              segment_sizze_nonzzero_234132) +\n                      sext_i32_i64(local_tid_234135), partition_sizze_203667 *\n                      n_p_203574 * s_n_m_203726) &&\n                slt64(sext_i32_i64(local_tid_234135),\n                      squot64(segred_group_sizze_216988,\n                              segment_sizze_nonzzero_234132))) {\n                double tmp_234167;\n                \n                tmp_234167 = ((__local\n                               double *) red_arr_mem_234139)[(sext_i32_i64(local_tid_234135) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234132 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230487)[squot64(sext_i32_i64(virt_group_id_234145) *\n                                                squot64(segred_group_sizze_216988,\n                                                        segment_sizze_nonzzero_234132) +\n                                                sext_i32_i64(local_tid_234135),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                   ",
            "     squot64(sext_i32_i64(virt_group_id_234145) *\n                                                squot64(segred_group_sizze_216988,\n                                                        segment_sizze_nonzzero_234132) +\n                                                sext_i32_i64(local_tid_234135) -\n                                                squot64(sext_i32_i64(virt_group_id_234145) *\n                                                        squot64(segred_group_sizze_216988,\n                                                                segment_sizze_nonzzero_234132) +\n                                                        sext_i32_i64(local_tid_234135),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234145) *\n                                         squot64(segred_group_sizze_216988,\n                                                 segment_sizze_nonzzero_234132) +\n                                         sext_i32_i64(local_tid_234135) -\n                                         squot64(sext_i32_i64(virt_group_id_234145) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segment_sizze_nonzzero_234132) +\n                                                 sext_i32_i64(local_tid_234135),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234145) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segm",
            "ent_sizze_nonzzero_234132) +\n                                                 sext_i32_i64(local_tid_234135) -\n                                                 squot64(sext_i32_i64(virt_group_id_234145) *\n                                                         squot64(segred_group_sizze_216988,\n                                                                 segment_sizze_nonzzero_234132) +\n                                                         sext_i32_i64(local_tid_234135),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234167;\n                \n                double tmp_234168;\n                \n                tmp_234168 = ((__local\n                               double *) red_arr_mem_234141)[(sext_i32_i64(local_tid_234135) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234132 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230492)[squot64(sext_i32_i64(virt_group_id_234145) *\n                                                squot64(segred_group_sizze_216988,\n                                                        segment_sizze_nonzzero_234132) +\n                                                sext_i32_i64(local_tid_234135),\n                                                n_p_203574 * s_n_m_203726) *\n                                        (s_n_m_203726 * n_p_203574) +\n                                        squot64(sext_i32_i64(virt_group_id_234145) *\n                                                squot64(segred_group_sizze_216988,\n                                 ",
            "                       segment_sizze_nonzzero_234132) +\n                                                sext_i32_i64(local_tid_234135) -\n                                                squot64(sext_i32_i64(virt_group_id_234145) *\n                                                        squot64(segred_group_sizze_216988,\n                                                                segment_sizze_nonzzero_234132) +\n                                                        sext_i32_i64(local_tid_234135),\n                                                        n_p_203574 *\n                                                        s_n_m_203726) *\n                                                (n_p_203574 * s_n_m_203726),\n                                                s_n_m_203726) * s_n_m_203726 +\n                                        (sext_i32_i64(virt_group_id_234145) *\n                                         squot64(segred_group_sizze_216988,\n                                                 segment_sizze_nonzzero_234132) +\n                                         sext_i32_i64(local_tid_234135) -\n                                         squot64(sext_i32_i64(virt_group_id_234145) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segment_sizze_nonzzero_234132) +\n                                                 sext_i32_i64(local_tid_234135),\n                                                 n_p_203574 * s_n_m_203726) *\n                                         (n_p_203574 * s_n_m_203726) -\n                                         squot64(sext_i32_i64(virt_group_id_234145) *\n                                                 squot64(segred_group_sizze_216988,\n                                                         segment_sizze_nonzzero_234132) +\n                                                 sext_i32_i64(local_tid_234135) -\n                                                 squot6",
            "4(sext_i32_i64(virt_group_id_234145) *\n                                                         squot64(segred_group_sizze_216988,\n                                                                 segment_sizze_nonzzero_234132) +\n                                                         sext_i32_i64(local_tid_234135),\n                                                         n_p_203574 *\n                                                         s_n_m_203726) *\n                                                 (n_p_203574 * s_n_m_203726),\n                                                 s_n_m_203726) *\n                                         s_n_m_203726)] = tmp_234168;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_216988\n}\n__kernel void mainzisegred_small_218721(__global int *global_failure,\n                                        uint red_arr_mem_234346_backing_offset_0,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t C_len_203724,\n                                        int64_t num_groups_218716,\n                                        int64_t segment_sizze_nonzzero_234339,\n                                        __global unsigned char *mem_230608,\n                                        __global unsigned char *mem_230619)\n{\n    #define segred_group_sizze_218715 (mainzisegred_group_sizze_218698)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234346_backing_0 =\n                           &shared_mem[red_arr_mem_234346_backing_offset_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_218721 = global_tid_234341;\n    __local unsigned char *red_arr_mem_234346;\n    \n    red_arr_mem_234346 = (__local unsigned char *) red_arr_mem_234346_backing_0;\n    \n    int32_t phys_group_id_234348;\n    \n    phys_group_id_234348 = get_group_id(0);\n    for (int32_t i_234349 = 0; i_234349 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_218715,\n                                                  segment_sizze_nonzzero_234339))) -\n                   phys_group_id_234348, sext_i64_i32(num_groups_218716));\n         i_234349++) {\n        int32_t virt_group_id_234350 = phys_group_id_234348 + i_234349 *\n                sext_i64_i32(num_groups_218716);\n        int64_t slice_234351 = partition_sizze_203667;\n        int64_t gtid_218719 = squot64(sext_i32_i64(local_tid_234342),\n                                      segment_sizze_nonzzero_234339) +\n                sext_i32_i64(virt_group_id_234350) *\n                squot64(segred_group_sizze_218715,\n                        segment_sizze_nonzzero_234339);\n        int64_t remnant_234352 = squot64(sext_i32_i64(local_tid_234342),\n                                         segment_sizze_nonzzero_234339) +\n                sext_i32_i64(virt_group_id_234350) *\n                squot64(segred_group_sizze_218715,\n                        segment_sizze_nonzzero_234339) - gtid_218719;\n        int64_t gtid_218720 = srem64(sext_i32_i64(local_tid_234342),\n                                     n_p_203574);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203574) && (slt64(gtid_218719,\n                                                         partition_",
            "sizze_203667) &&\n                                                   slt64(sext_i32_i64(local_tid_234342),\n                                                         n_p_203574 *\n                                                         squot64(segred_group_sizze_218715,\n                                                                 segment_sizze_nonzzero_234339)))) {\n                double x_218726;\n                \n                x_218726 = ((__global double *) mem_230608)[gtid_218719 *\n                                                            C_len_203724 +\n                                                            gtid_218720];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                        x_218726;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203574)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218722;\n                double x_218723;\n                double x_234353;\n                double x_234354;\n                bool ltid_in_bounds_234356 =\n                     slt64(sext_i32_i64(local_tid_234342), n_p_203574 *\n                           squot64(segred_group_sizze_218715,\n                                   segment_sizze_nonzzero_234339));\n                int32_t skip_threads_234357;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234356) {\n                        x_218723 = ((volatile __local\n                                     double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)];\n                     ",
            "   if ((local_tid_234342 - squot32(local_tid_234342, 32) *\n                             32) == 0) {\n                            x_218722 = x_218723;\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                             ltid_in_bounds_234356;\n                        \n                        if (thread_active_234358) {\n                            // read operands\n                            {\n                                x_218722 = ((volatile __local\n                                             double *) red_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),\n                                              n_p_203574),\n                                       sext_i32_i64(local_tid_234342) -\n                                       sext_i32_i64(local_tid_234342 -\n                                       skip_threads_234357));\n                            \n                            if (thread_active_234358 && inactive_234359) {\n                                x_218722 = x_218723;\n                            }\n                            if (thread_active_234358) {\n                              ",
            "  if (!inactive_234359) {\n                                    double defunc_1_op_res_218724 = x_218722 +\n                                           x_218723;\n                                    \n                                    x_218722 = defunc_1_op_res_218724;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_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 *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                                    x_218722;\n                                x_218723 = x_218722;\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                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) *\n                         32) == 31 && ltid_in_bounds_234356) {\n                        ((volatile __local\n                          double *) red_arr_mem_234346)[sext_i32_i64(squot32(local_tid_234342,\n                                                                             32))] =\n                            x_218722;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234360;\n           ",
            "         \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234342, 32) == 0 &&\n                            ltid_in_bounds_234356) {\n                            x_234354 = ((volatile __local\n                                         double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)];\n                            if ((local_tid_234342 - squot32(local_tid_234342,\n                                                            32) * 32) == 0) {\n                                x_234353 = x_234354;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234360 = 1;\n                        while (slt32(skip_threads_234360, 32)) {\n                            bool thread_active_234361 =\n                                 sle32(skip_threads_234360, local_tid_234342 -\n                                       squot32(local_tid_234342, 32) * 32) &&\n                                 (squot32(local_tid_234342, 32) == 0 &&\n                                  ltid_in_bounds_234356);\n                            \n                            if (thread_active_234361) {\n                                // read operands\n                                {\n                                    x_234353 = ((volatile __local\n                                                 double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342) -\n                                                                               sext_i32_i64(skip_threads_234360)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234362 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234342 *\n                                                  32 + 32 - ",
            "1), n_p_203574),\n                                           sext_i32_i64(local_tid_234342 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234342 -\n                                                         skip_threads_234360) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234361 && inactive_234362) {\n                                    x_234353 = x_234354;\n                                }\n                                if (thread_active_234361) {\n                                    if (!inactive_234362) {\n                                        double defunc_1_op_res_234355 =\n                                               x_234353 + x_234354;\n                                        \n                                        x_234353 = defunc_1_op_res_234355;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234344, skip_threads_234360)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234361) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                                        x_234353;\n                                    x_234354 = x_234353;\n                                }\n                            }\n                            if (sle32(wave_sizze_234344, skip_threads_234360)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234360 *= 2;\n                        }\n                    }\n                }\n                barrier",
            "(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234363 = squot32(local_tid_234342, 32) == 0 ||\n                     !ltid_in_bounds_234356;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234363) {\n                            x_218723 = x_218722;\n                            x_218722 = ((__local\n                                         double *) red_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_234364 =\n                             slt64(srem64(sext_i32_i64(local_tid_234342),\n                                          n_p_203574),\n                                   sext_i32_i64(local_tid_234342) -\n                                   sext_i32_i64(squot32(local_tid_234342, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234363) {\n                            if (inactive_234364) {\n                                x_218722 = x_218723;\n                            }\n                        }\n                        if (!no_carry_in_234363) {\n                            if (!inactive_234364) {\n                                double defunc_1_op_res_218724 = x_218722 +\n                                       x_218723;\n                                \n                                x_218722 = defunc_1_op_res_218724;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234363) {\n ",
            "                           ((__local\n                              double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                                x_218722;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234342, 32) == 0 &&\n                        ltid_in_bounds_234356) {\n                        ((__local\n                          double *) red_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                            x_218723;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234350) *\n                      squot64(segred_group_sizze_218715,\n                              segment_sizze_nonzzero_234339) +\n                      sext_i32_i64(local_tid_234342), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_234342),\n                      squot64(segred_group_sizze_218715,\n                              segment_sizze_nonzzero_234339))) {\n                double tmp_234365;\n                \n                tmp_234365 = ((__local\n                               double *) red_arr_mem_234346)[(sext_i32_i64(local_tid_234342) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234339 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230619)[sext_i32_i64(virt_group_id_234350) *\n                                        squot64(segred_group_sizze_218715,\n                                                segment_sizze_nonzzero_234339) +\n                                        ",
            "sext_i32_i64(local_tid_234342)] =\n                    tmp_234365;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218715\n}\n__kernel void mainzisegred_small_218852(__global int *global_failure,\n                                        uint red_arr_mem_234527_backing_offset_0,\n                                        int64_t n_p_203574,\n                                        int64_t partition_sizze_203667,\n                                        int64_t lifted_single_ma_l_arg_204224,\n                                        int64_t num_groups_218847,\n                                        int64_t segment_sizze_nonzzero_234520,\n                                        __global unsigned char *mem_230625,\n                                        __global unsigned char *mem_230636)\n{\n    #define segred_group_sizze_218846 (mainzisegred_group_sizze_218829)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234527_backing_0 =\n                           &shared_mem[red_arr_mem_234527_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234522;\n    int32_t local_tid_234523;\n    int64_t group_sizze_234526;\n    int32_t wave_sizze_234525;\n    int32_t group_tid_234524;\n    \n    global_tid_234522 = get_global_id(0);\n    local_tid_234523 = get_local_id(0);\n    group_sizze_234526 = get_local_size(0);\n    wave_sizze_234525 = LOCKSTEP_WIDTH;\n    group_tid_234524 = get_group_id(0);\n    \n    int32_t phys_tid_218852 = global_tid_234522;\n    __local unsigned char *red_arr_mem_234527;\n    \n    red_arr_mem_234527 = (__local unsigned char *) red_arr_mem_234527_backing_0;\n    \n    int32_t phys_group_id_234529;\n    \n    phys_group_id_234529 = get_group_id(0);\n    for (int32_t i_234530 = 0; i_234530 <\n         sdiv_up32(sext_i64_i32(sd",
            "iv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_218846,\n                                                  segment_sizze_nonzzero_234520))) -\n                   phys_group_id_234529, sext_i64_i32(num_groups_218847));\n         i_234530++) {\n        int32_t virt_group_id_234531 = phys_group_id_234529 + i_234530 *\n                sext_i64_i32(num_groups_218847);\n        int64_t slice_234532 = partition_sizze_203667;\n        int64_t gtid_218850 = squot64(sext_i32_i64(local_tid_234523),\n                                      segment_sizze_nonzzero_234520) +\n                sext_i32_i64(virt_group_id_234531) *\n                squot64(segred_group_sizze_218846,\n                        segment_sizze_nonzzero_234520);\n        int64_t remnant_234533 = squot64(sext_i32_i64(local_tid_234523),\n                                         segment_sizze_nonzzero_234520) +\n                sext_i32_i64(virt_group_id_234531) *\n                squot64(segred_group_sizze_218846,\n                        segment_sizze_nonzzero_234520) - gtid_218850;\n        int64_t gtid_218851 = srem64(sext_i32_i64(local_tid_234523),\n                                     n_p_203574);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203574) && (slt64(gtid_218850,\n                                                         partition_sizze_203667) &&\n                                                   slt64(sext_i32_i64(local_tid_234523),\n                                                         n_p_203574 *\n                                                         squot64(segred_group_sizze_218846,\n                                                                 segment_sizze_nonzzero_234520)))) {\n                double x_218857;\n                \n                x_218857 = ((__global double *) mem_230625)[gtid_218850 *\n                                                            lifted_single_ma_l_arg_204224 +\n      ",
            "                                                      gtid_218851];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)] =\n                        x_218857;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203574)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218853;\n                double x_218854;\n                double x_234534;\n                double x_234535;\n                bool ltid_in_bounds_234537 =\n                     slt64(sext_i32_i64(local_tid_234523), n_p_203574 *\n                           squot64(segred_group_sizze_218846,\n                                   segment_sizze_nonzzero_234520));\n                int32_t skip_threads_234538;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234537) {\n                        x_218854 = ((volatile __local\n                                     double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)];\n                        if ((local_tid_234523 - squot32(local_tid_234523, 32) *\n                             32) == 0) {\n                            x_218853 = x_218854;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234538 = 1;\n                    while (slt32(skip_threads_234538, 32)) {\n                        bool thread_active_234539 = sle32(skip_threads_234538,\n                                                          local_tid_234523 -\n               ",
            "                                           squot32(local_tid_234523,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234537;\n                        \n                        if (thread_active_234539) {\n                            // read operands\n                            {\n                                x_218853 = ((volatile __local\n                                             double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523) -\n                                                                           sext_i32_i64(skip_threads_234538)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234540 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234523),\n                                              n_p_203574),\n                                       sext_i32_i64(local_tid_234523) -\n                                       sext_i32_i64(local_tid_234523 -\n                                       skip_threads_234538));\n                            \n                            if (thread_active_234539 && inactive_234540) {\n                                x_218853 = x_218854;\n                            }\n                            if (thread_active_234539) {\n                                if (!inactive_234540) {\n                                    double defunc_1_op_res_218855 = x_218853 +\n                                           x_218854;\n                                    \n                                    x_218853 = defunc_1_op_res_218855;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234525, skip_threads_234538)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234539) {\n     ",
            "                       // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)] =\n                                    x_218853;\n                                x_218854 = x_218853;\n                            }\n                        }\n                        if (sle32(wave_sizze_234525, skip_threads_234538)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234538 *= 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_234523 - squot32(local_tid_234523, 32) *\n                         32) == 31 && ltid_in_bounds_234537) {\n                        ((volatile __local\n                          double *) red_arr_mem_234527)[sext_i32_i64(squot32(local_tid_234523,\n                                                                             32))] =\n                            x_218853;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234541;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234523, 32) == 0 &&\n                            ltid_in_bounds_234537) {\n                            x_234535 = ((volatile __local\n                                         double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)];\n                            if ((local_tid_234523 - squot32(local_tid_234523,\n                                                            32) * 32) == 0) {\n                                x_234534 = x_234535;\n",
            "                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234541 = 1;\n                        while (slt32(skip_threads_234541, 32)) {\n                            bool thread_active_234542 =\n                                 sle32(skip_threads_234541, local_tid_234523 -\n                                       squot32(local_tid_234523, 32) * 32) &&\n                                 (squot32(local_tid_234523, 32) == 0 &&\n                                  ltid_in_bounds_234537);\n                            \n                            if (thread_active_234542) {\n                                // read operands\n                                {\n                                    x_234534 = ((volatile __local\n                                                 double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523) -\n                                                                               sext_i32_i64(skip_threads_234541)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234543 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234523 *\n                                                  32 + 32 - 1), n_p_203574),\n                                           sext_i32_i64(local_tid_234523 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234523 -\n                                                         skip_threads_234541) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234542 && inactive_234543) {\n                                    x_234534 = x_234535;\n                                }\n       ",
            "                         if (thread_active_234542) {\n                                    if (!inactive_234543) {\n                                        double defunc_1_op_res_234536 =\n                                               x_234534 + x_234535;\n                                        \n                                        x_234534 = defunc_1_op_res_234536;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234525, skip_threads_234541)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234542) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)] =\n                                        x_234534;\n                                    x_234535 = x_234534;\n                                }\n                            }\n                            if (sle32(wave_sizze_234525, skip_threads_234541)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234541 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234544 = squot32(local_tid_234523, 32) == 0 ||\n                     !ltid_in_bounds_234537;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234544) {\n                            x_218854 = x_218853;\n                            x_218853 = ((__local\n                                         double *) red_arr_mem_234527)[sext_i32_i64(squot32(local_tid_234",
            "523,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234545 =\n                             slt64(srem64(sext_i32_i64(local_tid_234523),\n                                          n_p_203574),\n                                   sext_i32_i64(local_tid_234523) -\n                                   sext_i32_i64(squot32(local_tid_234523, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234544) {\n                            if (inactive_234545) {\n                                x_218853 = x_218854;\n                            }\n                        }\n                        if (!no_carry_in_234544) {\n                            if (!inactive_234545) {\n                                double defunc_1_op_res_218855 = x_218853 +\n                                       x_218854;\n                                \n                                x_218853 = defunc_1_op_res_218855;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234544) {\n                            ((__local\n                              double *) red_arr_mem_234527)[sext_i32_i64(local_tid_234523)] =\n                                x_218853;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234523, 32) == 0 &&\n                        ltid_in_bounds_234537) {\n                        ((__local\n                          double *) red_arr_mem_234527)[sext_i32_i64",
            "(local_tid_234523)] =\n                            x_218854;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234531) *\n                      squot64(segred_group_sizze_218846,\n                              segment_sizze_nonzzero_234520) +\n                      sext_i32_i64(local_tid_234523), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_234523),\n                      squot64(segred_group_sizze_218846,\n                              segment_sizze_nonzzero_234520))) {\n                double tmp_234546;\n                \n                tmp_234546 = ((__local\n                               double *) red_arr_mem_234527)[(sext_i32_i64(local_tid_234523) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234520 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230636)[sext_i32_i64(virt_group_id_234531) *\n                                        squot64(segred_group_sizze_218846,\n                                                segment_sizze_nonzzero_234520) +\n                                        sext_i32_i64(local_tid_234523)] =\n                    tmp_234546;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_218846\n}\n__kernel void mainzisegred_small_218983(__global int *global_failure,\n                                        uint red_arr_mem_234708_backing_offset_0,\n                                        int64_t partition_sizze_203667,\n                                        int64_t dyn_lifted_single_ma_l_arg_204234,\n     ",
            "                                   int64_t num_groups_218978,\n                                        int64_t segment_sizze_nonzzero_234701,\n                                        __global unsigned char *mem_230642,\n                                        __global unsigned char *mem_230653)\n{\n    #define segred_group_sizze_218977 (mainzisegred_group_sizze_218960)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234708_backing_0 =\n                           &shared_mem[red_arr_mem_234708_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234703;\n    int32_t local_tid_234704;\n    int64_t group_sizze_234707;\n    int32_t wave_sizze_234706;\n    int32_t group_tid_234705;\n    \n    global_tid_234703 = get_global_id(0);\n    local_tid_234704 = get_local_id(0);\n    group_sizze_234707 = get_local_size(0);\n    wave_sizze_234706 = LOCKSTEP_WIDTH;\n    group_tid_234705 = get_group_id(0);\n    \n    int32_t phys_tid_218983 = global_tid_234703;\n    __local unsigned char *red_arr_mem_234708;\n    \n    red_arr_mem_234708 = (__local unsigned char *) red_arr_mem_234708_backing_0;\n    \n    int32_t phys_group_id_234710;\n    \n    phys_group_id_234710 = get_group_id(0);\n    for (int32_t i_234711 = 0; i_234711 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_218977,\n                                                  segment_sizze_nonzzero_234701))) -\n                   phys_group_id_234710, sext_i64_i32(num_groups_218978));\n         i_234711++) {\n        int32_t virt_group_id_234712 = phys_group_id_234710 + i_234711 *\n                sext_i64_i32(num_groups_218978);\n        int64_t slice_234713 = partition_sizze_203667;\n        int64_t gtid_218981 = squot64(sext_i32_i64(local_tid_234704),\n                                      segment_sizze_nonzzero_234701) +\n                sext",
            "_i32_i64(virt_group_id_234712) *\n                squot64(segred_group_sizze_218977,\n                        segment_sizze_nonzzero_234701);\n        int64_t remnant_234714 = squot64(sext_i32_i64(local_tid_234704),\n                                         segment_sizze_nonzzero_234701) +\n                sext_i32_i64(virt_group_id_234712) *\n                squot64(segred_group_sizze_218977,\n                        segment_sizze_nonzzero_234701) - gtid_218981;\n        int64_t gtid_218982 = srem64(sext_i32_i64(local_tid_234704),\n                                     (int64_t) 3);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, (int64_t) 3) && (slt64(gtid_218981,\n                                                          partition_sizze_203667) &&\n                                                    slt64(sext_i32_i64(local_tid_234704),\n                                                          (int64_t) 3 *\n                                                          squot64(segred_group_sizze_218977,\n                                                                  segment_sizze_nonzzero_234701)))) {\n                double x_218988;\n                \n                x_218988 = ((__global double *) mem_230642)[gtid_218981 *\n                                                            dyn_lifted_single_ma_l_arg_204234 +\n                                                            gtid_218982];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)] =\n                        x_218988;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, (int64_t) 3",
            ")) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218984;\n                double x_218985;\n                double x_234715;\n                double x_234716;\n                bool ltid_in_bounds_234718 =\n                     slt64(sext_i32_i64(local_tid_234704), (int64_t) 3 *\n                           squot64(segred_group_sizze_218977,\n                                   segment_sizze_nonzzero_234701));\n                int32_t skip_threads_234719;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234718) {\n                        x_218985 = ((volatile __local\n                                     double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)];\n                        if ((local_tid_234704 - squot32(local_tid_234704, 32) *\n                             32) == 0) {\n                            x_218984 = x_218985;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234719 = 1;\n                    while (slt32(skip_threads_234719, 32)) {\n                        bool thread_active_234720 = sle32(skip_threads_234719,\n                                                          local_tid_234704 -\n                                                          squot32(local_tid_234704,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234718;\n                        \n                        if (thread_active_234720) {\n                            // read operands\n                            {\n                                x_218984 = ((volatile __local\n                                             double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704) -\n                                                                           sext_i32_i64(skip_t",
            "hreads_234719)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234721 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234704),\n                                              (int64_t) 3),\n                                       sext_i32_i64(local_tid_234704) -\n                                       sext_i32_i64(local_tid_234704 -\n                                       skip_threads_234719));\n                            \n                            if (thread_active_234720 && inactive_234721) {\n                                x_218984 = x_218985;\n                            }\n                            if (thread_active_234720) {\n                                if (!inactive_234721) {\n                                    double defunc_1_op_res_218986 = x_218984 +\n                                           x_218985;\n                                    \n                                    x_218984 = defunc_1_op_res_218986;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234706, skip_threads_234719)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234720) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)] =\n                                    x_218984;\n                                x_218985 = x_218984;\n                            }\n                        }\n                        if (sle32(wave_sizze_234706, skip_threads_234719)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234719 *= 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_234704 - squot32(local_tid_234704, 32) *\n                         32) == 31 && ltid_in_bounds_234718) {\n                        ((volatile __local\n                          double *) red_arr_mem_234708)[sext_i32_i64(squot32(local_tid_234704,\n                                                                             32))] =\n                            x_218984;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234722;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234704, 32) == 0 &&\n                            ltid_in_bounds_234718) {\n                            x_234716 = ((volatile __local\n                                         double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)];\n                            if ((local_tid_234704 - squot32(local_tid_234704,\n                                                            32) * 32) == 0) {\n                                x_234715 = x_234716;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234722 = 1;\n                        while (slt32(skip_threads_234722, 32)) {\n                            bool thread_active_234723 =\n                                 sle32(skip_threads_234722, local_tid_234704 -\n                                       squot32(local_tid_234704, 32) * 32) &&\n                                 (squot32(local_tid_234704, 32) == 0 &&\n                                  ltid_in_bounds",
            "_234718);\n                            \n                            if (thread_active_234723) {\n                                // read operands\n                                {\n                                    x_234715 = ((volatile __local\n                                                 double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704) -\n                                                                               sext_i32_i64(skip_threads_234722)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234724 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234704 *\n                                                  32 + 32 - 1), (int64_t) 3),\n                                           sext_i32_i64(local_tid_234704 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234704 -\n                                                         skip_threads_234722) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234723 && inactive_234724) {\n                                    x_234715 = x_234716;\n                                }\n                                if (thread_active_234723) {\n                                    if (!inactive_234724) {\n                                        double defunc_1_op_res_234717 =\n                                               x_234715 + x_234716;\n                                        \n                                        x_234715 = defunc_1_op_res_234717;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234706, skip_threads_234722)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n",
            "                            }\n                            if (thread_active_234723) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)] =\n                                        x_234715;\n                                    x_234716 = x_234715;\n                                }\n                            }\n                            if (sle32(wave_sizze_234706, skip_threads_234722)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234722 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234725 = squot32(local_tid_234704, 32) == 0 ||\n                     !ltid_in_bounds_234718;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234725) {\n                            x_218985 = x_218984;\n                            x_218984 = ((__local\n                                         double *) red_arr_mem_234708)[sext_i32_i64(squot32(local_tid_234704,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234726 =\n                             slt64(srem64(sext_i32_i64(local_tid_234704),\n                                          (int64_t) 3),\n                                   sext_i32_i64(local_tid_234704) -\n                                   sext_i32_i64(squot32(local_tid_234",
            "704, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234725) {\n                            if (inactive_234726) {\n                                x_218984 = x_218985;\n                            }\n                        }\n                        if (!no_carry_in_234725) {\n                            if (!inactive_234726) {\n                                double defunc_1_op_res_218986 = x_218984 +\n                                       x_218985;\n                                \n                                x_218984 = defunc_1_op_res_218986;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234725) {\n                            ((__local\n                              double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)] =\n                                x_218984;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234704, 32) == 0 &&\n                        ltid_in_bounds_234718) {\n                        ((__local\n                          double *) red_arr_mem_234708)[sext_i32_i64(local_tid_234704)] =\n                            x_218985;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_234712) *\n                      squot64(segred_group_sizze_218977,\n                              segment_sizze_nonzzero_234701) +\n                      sext_i32_i64(local_tid_234704), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_234704),\n                      squot64(segred_gro",
            "up_sizze_218977,\n                              segment_sizze_nonzzero_234701))) {\n                double tmp_234727;\n                \n                tmp_234727 = ((__local\n                               double *) red_arr_mem_234708)[(sext_i32_i64(local_tid_234704) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234701 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230653)[sext_i32_i64(virt_group_id_234712) *\n                                        squot64(segred_group_sizze_218977,\n                                                segment_sizze_nonzzero_234701) +\n                                        sext_i32_i64(local_tid_234704)] =\n                    tmp_234727;\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_218977\n}\n__kernel void mainzisegred_small_219605(__global int *global_failure,\n                                        uint red_arr_mem_234923_backing_offset_0,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219599,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_234916,\n                                        __global unsigned char *ext_mem_229519,\n                                        __gl",
            "obal unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230704)\n{\n    #define segred_group_sizze_219598 (mainzisegred_group_sizze_219350)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_234923_backing_0 =\n                           &shared_mem[red_arr_mem_234923_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234918;\n    int32_t local_tid_234919;\n    int64_t group_sizze_234922;\n    int32_t wave_sizze_234921;\n    int32_t group_tid_234920;\n    \n    global_tid_234918 = get_global_id(0);\n    local_tid_234919 = get_local_id(0);\n    group_sizze_234922 = get_local_size(0);\n    wave_sizze_234921 = LOCKSTEP_WIDTH;\n    group_tid_234920 = get_group_id(0);\n    \n    int32_t phys_tid_219605 = global_tid_234918;\n    __local unsigned char *red_arr_mem_234923;\n    \n    red_arr_mem_234923 = (__local unsigned char *) red_arr_mem_234923_backing_0;\n    \n    int32_t phys_group_id_234925;\n    \n    phys_group_id_234925 = get_group_id(0);\n    for (int32_t i_234926 = 0; i_234926 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_219598,\n                                                  segment_sizze_nonzzero_234916))) -\n                   phys_group_id_234925, sext_i64_i32(num_groups_219599));\n         i_234926++) {\n        int32_t virt_group_id_234927 = phys_group_id_234925 + i_234926 *\n                sext_i64_i32(num_groups_219599);\n        int64_t slice_234928 = l_n_m_203733;\n        int64_t slice_234929 = partition_sizze_203667 * slice_234928;\n        int64_t gtid_219602 = squot64(squot64(sext_i32_i64(local_tid_234919),\n                                              segment_sizze_nonzzer",
            "o_234916) +\n                                      sext_i32_i64(virt_group_id_234927) *\n                                      squot64(segred_group_sizze_219598,\n                                              segment_sizze_nonzzero_234916),\n                                      slice_234928);\n        int64_t remnant_234930 = squot64(sext_i32_i64(local_tid_234919),\n                                         segment_sizze_nonzzero_234916) +\n                sext_i32_i64(virt_group_id_234927) *\n                squot64(segred_group_sizze_219598,\n                        segment_sizze_nonzzero_234916) - gtid_219602 *\n                slice_234928;\n        int64_t gtid_219603 = remnant_234930;\n        int64_t remnant_234931 = remnant_234930 - gtid_219603;\n        int64_t gtid_219604 = srem64(sext_i32_i64(local_tid_234919),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_219602,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_219603,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_234919),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_219598,\n                                                                 segment_sizze_nonzzero_234916)))) {\n                int64_t x_219613;\n                \n                x_219613 = ((__global int64_t *) ext_mem_229520)[gtid_219602 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219603];\n                \n                double x_219614;\n                \n                x_219614 = ((__global double *) ext_mem_",
            "229519)[gtid_219602 *\n                                                                l_n_m_203733 +\n                                                                gtid_219603];\n                \n                int64_t binop_y_228780 = mul64(jump_t_203582, gtid_219603);\n                int64_t binop_y_228781 = smin64(i_203760, binop_y_228780);\n                int64_t index_primexp_228782 = add64((int64_t) 1,\n                                                     binop_y_228781);\n                bool cond_219617 = sle64(n_203572, gtid_219604);\n                int64_t defunc_0_f_res_219618;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219618 = (int64_t) 0;\n                } else {\n                    int64_t i_219619 = add64(gtid_219604, x_219613);\n                    int64_t defunc_1_add_res_219620 = add64((int64_t) 1,\n                                                            i_219619);\n                    \n                    defunc_0_f_res_219618 = defunc_1_add_res_219620;\n                }\n                \n                double defunc_0_f_res_219621;\n                \n                if (cond_219617) {\n                    defunc_0_f_res_219621 = 0.0;\n                } else {\n                    int64_t i_219622 = add64(gtid_219604, x_219613);\n                    double defunc_0_add_arg_219623;\n                    \n                    defunc_0_add_arg_219623 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219602 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219622 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219621 = defunc_0_add_arg_219623;\n              ",
            "  }\n                \n                int64_t binop_p_219624 = sub64(defunc_0_f_res_219618,\n                                               index_primexp_228782);\n                double defunc_0_f_res_219625 = sitofp_i64_f64(binop_p_219624);\n                double abs_res_219626 = fabs(defunc_0_f_res_219625);\n                double tmp1_219627 = abs_res_219626 / x_219614;\n                double x_219628 = tmp1_219627 * tmp1_219627;\n                double y_219629 = tmp1_219627 * x_219628;\n                double tmp2_219630 = 1.0 - y_219629;\n                double x_219631 = tmp2_219630 * tmp2_219630;\n                double tmp3_219632 = tmp2_219630 * x_219631;\n                double w_j_219633 = defunc_0_f_res_219621 * tmp3_219632;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)] =\n                        w_j_219633;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219606;\n                double x_219607;\n                double x_234932;\n                double x_234933;\n                bool ltid_in_bounds_234935 =\n                     slt64(sext_i32_i64(local_tid_234919), q_l_203577 *\n                           squot64(segred_group_sizze_219598,\n                                   segment_sizze_nonzzero_234916));\n                int32_t skip_threads_234936;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234935) {\n                        x_219607 = ((volatile __local\n    ",
            "                                 double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)];\n                        if ((local_tid_234919 - squot32(local_tid_234919, 32) *\n                             32) == 0) {\n                            x_219606 = x_219607;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234936 = 1;\n                    while (slt32(skip_threads_234936, 32)) {\n                        bool thread_active_234937 = sle32(skip_threads_234936,\n                                                          local_tid_234919 -\n                                                          squot32(local_tid_234919,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234935;\n                        \n                        if (thread_active_234937) {\n                            // read operands\n                            {\n                                x_219606 = ((volatile __local\n                                             double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919) -\n                                                                           sext_i32_i64(skip_threads_234936)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234938 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234919),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_234919) -\n                                       sext_i32_i64(local_tid_234919 -\n                                       skip_threads_234936));\n                            \n                            if (thread_active_234937 && inactive_234938) {\n                                x_219606 = x_219607;",
            "\n                            }\n                            if (thread_active_234937) {\n                                if (!inactive_234938) {\n                                    double defunc_1_op_res_219608 = x_219606 +\n                                           x_219607;\n                                    \n                                    x_219606 = defunc_1_op_res_219608;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234921, skip_threads_234936)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234937) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)] =\n                                    x_219606;\n                                x_219607 = x_219606;\n                            }\n                        }\n                        if (sle32(wave_sizze_234921, skip_threads_234936)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234936 *= 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_234919 - squot32(local_tid_234919, 32) *\n                         32) == 31 && ltid_in_bounds_234935) {\n                        ((volatile __local\n                          double *) red_arr_mem_234923)[sext_i32_i64(squot32(local_tid_234919,\n                                                                             32))] =\n                            x_219606;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset",
            " 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_234939;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234919, 32) == 0 &&\n                            ltid_in_bounds_234935) {\n                            x_234933 = ((volatile __local\n                                         double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)];\n                            if ((local_tid_234919 - squot32(local_tid_234919,\n                                                            32) * 32) == 0) {\n                                x_234932 = x_234933;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234939 = 1;\n                        while (slt32(skip_threads_234939, 32)) {\n                            bool thread_active_234940 =\n                                 sle32(skip_threads_234939, local_tid_234919 -\n                                       squot32(local_tid_234919, 32) * 32) &&\n                                 (squot32(local_tid_234919, 32) == 0 &&\n                                  ltid_in_bounds_234935);\n                            \n                            if (thread_active_234940) {\n                                // read operands\n                                {\n                                    x_234932 = ((volatile __local\n                                                 double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919) -\n                                                                               sext_i32_i64(skip_threads_234939)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234941 =\n                         ",
            "            slt64(srem64(sext_i32_i64(local_tid_234919 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_234919 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234919 -\n                                                         skip_threads_234939) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234940 && inactive_234941) {\n                                    x_234932 = x_234933;\n                                }\n                                if (thread_active_234940) {\n                                    if (!inactive_234941) {\n                                        double defunc_1_op_res_234934 =\n                                               x_234932 + x_234933;\n                                        \n                                        x_234932 = defunc_1_op_res_234934;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234921, skip_threads_234939)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234940) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)] =\n                                        x_234932;\n                                    x_234933 = x_234932;\n                                }\n                            }\n                            if (sle32(wave_sizze_234921, skip_threads_234939)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                          ",
            "  skip_threads_234939 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234942 = squot32(local_tid_234919, 32) == 0 ||\n                     !ltid_in_bounds_234935;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234942) {\n                            x_219607 = x_219606;\n                            x_219606 = ((__local\n                                         double *) red_arr_mem_234923)[sext_i32_i64(squot32(local_tid_234919,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234943 =\n                             slt64(srem64(sext_i32_i64(local_tid_234919),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_234919) -\n                                   sext_i32_i64(squot32(local_tid_234919, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234942) {\n                            if (inactive_234943) {\n                                x_219606 = x_219607;\n                            }\n                        }\n                        if (!no_carry_in_234942) {\n                            if (!inactive_234943) {\n                                double defunc_1_op_res_219608 = x_219606 +\n                                       x_219607;\n                                \n                                x_219606 = defunc_1_op_res_219608;\n                            }\n                        }\n                    }",
            "\n                    // write final result\n                    {\n                        if (!no_carry_in_234942) {\n                            ((__local\n                              double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)] =\n                                x_219606;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234919, 32) == 0 &&\n                        ltid_in_bounds_234935) {\n                        ((__local\n                          double *) red_arr_mem_234923)[sext_i32_i64(local_tid_234919)] =\n                            x_219607;\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_234927) *\n                      squot64(segred_group_sizze_219598,\n                              segment_sizze_nonzzero_234916) +\n                      sext_i32_i64(local_tid_234919), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_234919),\n                                             squot64(segred_group_sizze_219598,\n                                                     segment_sizze_nonzzero_234916))) {\n                double tmp_234944;\n                \n                tmp_234944 = ((__local\n                               double *) red_arr_mem_234923)[(sext_i32_i64(local_tid_234919) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234916 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230704)[squot64(sext_i32_i64(virt_group_id_234927) *\n    ",
            "                                            squot64(segred_group_sizze_219598,\n                                                        segment_sizze_nonzzero_234916) +\n                                                sext_i32_i64(local_tid_234919),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_234927) *\n                                         squot64(segred_group_sizze_219598,\n                                                 segment_sizze_nonzzero_234916) +\n                                         sext_i32_i64(local_tid_234919) -\n                                         squot64(sext_i32_i64(virt_group_id_234927) *\n                                                 squot64(segred_group_sizze_219598,\n                                                         segment_sizze_nonzzero_234916) +\n                                                 sext_i32_i64(local_tid_234919),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_234944;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219598\n}\n__kernel void mainzisegred_small_219654(__global int *global_failure,\n                                        uint red_arr_mem_235005_backing_offset_0,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_219648,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                       ",
            " int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_234998,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230709,\n                                        __global unsigned char *mem_230714)\n{\n    #define segred_group_sizze_219647 (mainzisegred_group_sizze_219283)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235005_backing_0 =\n                           &shared_mem[red_arr_mem_235005_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235000;\n    int32_t local_tid_235001;\n    int64_t group_sizze_235004;\n    int32_t wave_sizze_235003;\n    int32_t group_tid_235002;\n    \n    global_tid_235000 = get_global_id(0);\n    local_tid_235001 = get_local_id(0);\n    group_sizze_235004 = get_local_size(0);\n    wave_sizze_235003 = LOCKSTEP_WIDTH;\n    group_tid_235002 = get_group_id(0);\n    \n    int32_t phys_tid_219654 = global_tid_235000;\n    __local unsigned char *red_arr_mem_235005;\n    \n    red_arr_mem_235005 = (__local unsigned char *) red_arr_mem_235005_backing_0;\n    \n    int32_t phys_group_id_235007;\n    \n    phys_group_id_235007 = get_group_id(0);\n    for (int32_t i_235008 = 0; i_235008 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_219647,\n                                                  segment_sizze_nonzzero_234998))) -\n                   phys_group_id_235007, sext_i64_i32(num_groups_219648));\n         i_235008++",
            ") {\n        int32_t virt_group_id_235009 = phys_group_id_235007 + i_235008 *\n                sext_i64_i32(num_groups_219648);\n        int64_t slice_235010 = l_n_m_203733;\n        int64_t slice_235011 = partition_sizze_203667 * slice_235010;\n        int64_t gtid_219651 = squot64(squot64(sext_i32_i64(local_tid_235001),\n                                              segment_sizze_nonzzero_234998) +\n                                      sext_i32_i64(virt_group_id_235009) *\n                                      squot64(segred_group_sizze_219647,\n                                              segment_sizze_nonzzero_234998),\n                                      slice_235010);\n        int64_t remnant_235012 = squot64(sext_i32_i64(local_tid_235001),\n                                         segment_sizze_nonzzero_234998) +\n                sext_i32_i64(virt_group_id_235009) *\n                squot64(segred_group_sizze_219647,\n                        segment_sizze_nonzzero_234998) - gtid_219651 *\n                slice_235010;\n        int64_t gtid_219652 = remnant_235012;\n        int64_t remnant_235013 = remnant_235012 - gtid_219652;\n        int64_t gtid_219653 = srem64(sext_i32_i64(local_tid_235001),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_219651,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_219652,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_235001),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_219647,\n                                                                 segment_sizze_nonzzero_234998)))) {\n                int64_t x_",
            "219664;\n                \n                x_219664 = ((__global int64_t *) ext_mem_229520)[gtid_219651 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_219652];\n                \n                double x_219665;\n                \n                x_219665 = ((__global double *) ext_mem_229519)[gtid_219651 *\n                                                                l_n_m_203733 +\n                                                                gtid_219652];\n                \n                int64_t binop_y_228775 = mul64(jump_t_203582, gtid_219652);\n                int64_t binop_y_228776 = smin64(i_203760, binop_y_228775);\n                int64_t index_primexp_228777 = add64((int64_t) 1,\n                                                     binop_y_228776);\n                double a0_219667;\n                \n                a0_219667 = ((__global double *) mem_230709)[gtid_219651 *\n                                                             l_n_m_203733 +\n                                                             gtid_219652];\n                \n                bool cond_219669 = sle64(n_203572, gtid_219653);\n                int64_t defunc_0_f_res_219670;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219670 = (int64_t) 0;\n                } else {\n                    int64_t i_219671 = add64(gtid_219653, x_219664);\n                    int64_t defunc_1_add_res_219672 = add64((int64_t) 1,\n                                                            i_219671);\n                    \n                    defunc_0_f_res_219670 = defunc_1_add_res_219672;\n                }\n                \n                double defunc_0_f_res_219673;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219673 = 0.0;\n                } else {\n                    int64_t i_219674 = add64(gtid_219653, x_219664);\n            ",
            "        double defunc_0_add_arg_219675;\n                    \n                    defunc_0_add_arg_219675 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_219651 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_219674 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_219673 = defunc_0_add_arg_219675;\n                }\n                \n                int64_t binop_p_219676 = sub64(defunc_0_f_res_219670,\n                                               index_primexp_228777);\n                double defunc_0_f_res_219677 = sitofp_i64_f64(binop_p_219676);\n                double abs_res_219678 = fabs(defunc_0_f_res_219677);\n                double tmp1_219679 = abs_res_219678 / x_219665;\n                double x_219680 = tmp1_219679 * tmp1_219679;\n                double y_219681 = tmp1_219679 * x_219680;\n                double tmp2_219682 = 1.0 - y_219681;\n                double x_219683 = tmp2_219682 * tmp2_219682;\n                double tmp3_219684 = tmp2_219682 * x_219683;\n                double tmp4_219685 = defunc_0_f_res_219673 * tmp3_219684;\n                double defunc_0_f_res_219686;\n                \n                if (cond_219669) {\n                    defunc_0_f_res_219686 = 0.0;\n                } else {\n                    int64_t i_219687 = add64(gtid_219653, x_219664);\n                    double defunc_0_add_arg_219688;\n                    \n                    defunc_0_add_arg_219688 = ((__global\n                                                double *) mem_230659)[gtid_219651 *\n                                                                      n_203572 +\n                                           ",
            "                           i_219687];\n                    defunc_0_f_res_219686 = defunc_0_add_arg_219688;\n                }\n                \n                double x_219689 = a0_219667 * tmp4_219685;\n                double defunc_9_fit_fun_res_219690 = defunc_0_f_res_219686 *\n                       x_219689;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)] =\n                        defunc_9_fit_fun_res_219690;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219655;\n                double x_219656;\n                double x_235014;\n                double x_235015;\n                bool ltid_in_bounds_235017 =\n                     slt64(sext_i32_i64(local_tid_235001), q_l_203577 *\n                           squot64(segred_group_sizze_219647,\n                                   segment_sizze_nonzzero_234998));\n                int32_t skip_threads_235018;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235017) {\n                        x_219656 = ((volatile __local\n                                     double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)];\n                        if ((local_tid_235001 - squot32(local_tid_235001, 32) *\n                             32) == 0) {\n                            x_219655 = x_219656;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                ",
            "{\n                    skip_threads_235018 = 1;\n                    while (slt32(skip_threads_235018, 32)) {\n                        bool thread_active_235019 = sle32(skip_threads_235018,\n                                                          local_tid_235001 -\n                                                          squot32(local_tid_235001,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235017;\n                        \n                        if (thread_active_235019) {\n                            // read operands\n                            {\n                                x_219655 = ((volatile __local\n                                             double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001) -\n                                                                           sext_i32_i64(skip_threads_235018)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235020 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235001),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235001) -\n                                       sext_i32_i64(local_tid_235001 -\n                                       skip_threads_235018));\n                            \n                            if (thread_active_235019 && inactive_235020) {\n                                x_219655 = x_219656;\n                            }\n                            if (thread_active_235019) {\n                                if (!inactive_235020) {\n                                    double defunc_1_op_res_219657 = x_219655 +\n                                           x_219656;\n                                    \n                                    x_219655 = defunc_1_op_res_219657;\n                             ",
            "   }\n                            }\n                        }\n                        if (sle32(wave_sizze_235003, skip_threads_235018)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235019) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)] =\n                                    x_219655;\n                                x_219656 = x_219655;\n                            }\n                        }\n                        if (sle32(wave_sizze_235003, skip_threads_235018)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235018 *= 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_235001 - squot32(local_tid_235001, 32) *\n                         32) == 31 && ltid_in_bounds_235017) {\n                        ((volatile __local\n                          double *) red_arr_mem_235005)[sext_i32_i64(squot32(local_tid_235001,\n                                                                             32))] =\n                            x_219655;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235021;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235001, 32) == 0 &&\n                            ltid_in_bounds_235017) {\n                            x_235015 = ((volatile __local\n                                  ",
            "       double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)];\n                            if ((local_tid_235001 - squot32(local_tid_235001,\n                                                            32) * 32) == 0) {\n                                x_235014 = x_235015;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235021 = 1;\n                        while (slt32(skip_threads_235021, 32)) {\n                            bool thread_active_235022 =\n                                 sle32(skip_threads_235021, local_tid_235001 -\n                                       squot32(local_tid_235001, 32) * 32) &&\n                                 (squot32(local_tid_235001, 32) == 0 &&\n                                  ltid_in_bounds_235017);\n                            \n                            if (thread_active_235022) {\n                                // read operands\n                                {\n                                    x_235014 = ((volatile __local\n                                                 double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001) -\n                                                                               sext_i32_i64(skip_threads_235021)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235023 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235001 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_235001 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235001 -\n                                                         skip_threads",
            "_235021) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235022 && inactive_235023) {\n                                    x_235014 = x_235015;\n                                }\n                                if (thread_active_235022) {\n                                    if (!inactive_235023) {\n                                        double defunc_1_op_res_235016 =\n                                               x_235014 + x_235015;\n                                        \n                                        x_235014 = defunc_1_op_res_235016;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235003, skip_threads_235021)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235022) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)] =\n                                        x_235014;\n                                    x_235015 = x_235014;\n                                }\n                            }\n                            if (sle32(wave_sizze_235003, skip_threads_235021)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235021 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235024 = squot32(local_tid_235001, 32) == 0 ||\n                     !ltid_in_bounds_235017;\n                \n                // carry-in for every block except the first\n                {\n                    // read operan",
            "ds\n                    {\n                        if (!no_carry_in_235024) {\n                            x_219656 = x_219655;\n                            x_219655 = ((__local\n                                         double *) red_arr_mem_235005)[sext_i32_i64(squot32(local_tid_235001,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235025 =\n                             slt64(srem64(sext_i32_i64(local_tid_235001),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235001) -\n                                   sext_i32_i64(squot32(local_tid_235001, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235024) {\n                            if (inactive_235025) {\n                                x_219655 = x_219656;\n                            }\n                        }\n                        if (!no_carry_in_235024) {\n                            if (!inactive_235025) {\n                                double defunc_1_op_res_219657 = x_219655 +\n                                       x_219656;\n                                \n                                x_219655 = defunc_1_op_res_219657;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235024) {\n                            ((__local\n                              double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)] =\n                                x_219655;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n          ",
            "      // restore correct values for first block\n                {\n                    if (squot32(local_tid_235001, 32) == 0 &&\n                        ltid_in_bounds_235017) {\n                        ((__local\n                          double *) red_arr_mem_235005)[sext_i32_i64(local_tid_235001)] =\n                            x_219656;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235009) *\n                      squot64(segred_group_sizze_219647,\n                              segment_sizze_nonzzero_234998) +\n                      sext_i32_i64(local_tid_235001), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235001),\n                                             squot64(segred_group_sizze_219647,\n                                                     segment_sizze_nonzzero_234998))) {\n                double tmp_235026;\n                \n                tmp_235026 = ((__local\n                               double *) red_arr_mem_235005)[(sext_i32_i64(local_tid_235001) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234998 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230714)[squot64(sext_i32_i64(virt_group_id_235009) *\n                                                squot64(segred_group_sizze_219647,\n                                                        segment_sizze_nonzzero_234998) +\n                                                sext_i32_i64(local_tid_235001),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235009) *\n       ",
            "                                  squot64(segred_group_sizze_219647,\n                                                 segment_sizze_nonzzero_234998) +\n                                         sext_i32_i64(local_tid_235001) -\n                                         squot64(sext_i32_i64(virt_group_id_235009) *\n                                                 squot64(segred_group_sizze_219647,\n                                                         segment_sizze_nonzzero_234998) +\n                                                 sext_i32_i64(local_tid_235001),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235026;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_219647\n}\n__kernel void mainzisegred_small_220434(__global int *global_failure,\n                                        uint red_arr_mem_235135_backing_offset_0,\n                                        uint red_arr_mem_235133_backing_offset_1,\n                                        uint red_arr_mem_235131_backing_offset_2,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220426,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_235124,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned ",
            "char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230784,\n                                        __global unsigned char *mem_230788,\n                                        __global unsigned char *mem_230792)\n{\n    #define segred_group_sizze_220425 (mainzisegred_group_sizze_220102)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235135_backing_2 =\n                           &shared_mem[red_arr_mem_235135_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235133_backing_1 =\n                           &shared_mem[red_arr_mem_235133_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235131_backing_0 =\n                           &shared_mem[red_arr_mem_235131_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235126;\n    int32_t local_tid_235127;\n    int64_t group_sizze_235130;\n    int32_t wave_sizze_235129;\n    int32_t group_tid_235128;\n    \n    global_tid_235126 = get_global_id(0);\n    local_tid_235127 = get_local_id(0);\n    group_sizze_235130 = get_local_size(0);\n    wave_sizze_235129 = LOCKSTEP_WIDTH;\n    group_tid_235128 = get_group_id(0);\n    \n    int32_t phys_tid_220434 = global_tid_235126;\n    __local unsigned char *red_arr_mem_235131;\n    \n    red_arr_mem_235131 = (__local unsigned char *) red_arr_mem_235131_backing_0;\n    \n    __local unsigned char *red_arr_mem_235133;\n    \n    red_arr_mem_235133 = (__local unsigned char *) red_arr_mem_235133_backing_1;\n    \n    __local unsigned char *red_arr_mem_235135;\n    \n    red_arr_mem_235135 = (__local unsigned char *) red_arr_mem_235135_backing_2;\n    \n    int32_t phys_group_id_235137;\n    \n    phys_group_id_235137 = get_group_id(0);\n    for (int32_t i_235138 = 0; i_235138 <\n         sdiv_up32(sext_i64_i32(sdiv_",
            "up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_220425,\n                                                  segment_sizze_nonzzero_235124))) -\n                   phys_group_id_235137, sext_i64_i32(num_groups_220426));\n         i_235138++) {\n        int32_t virt_group_id_235139 = phys_group_id_235137 + i_235138 *\n                sext_i64_i32(num_groups_220426);\n        int64_t slice_235140 = l_n_m_203733;\n        int64_t slice_235141 = partition_sizze_203667 * slice_235140;\n        int64_t gtid_220431 = squot64(squot64(sext_i32_i64(local_tid_235127),\n                                              segment_sizze_nonzzero_235124) +\n                                      sext_i32_i64(virt_group_id_235139) *\n                                      squot64(segred_group_sizze_220425,\n                                              segment_sizze_nonzzero_235124),\n                                      slice_235140);\n        int64_t remnant_235142 = squot64(sext_i32_i64(local_tid_235127),\n                                         segment_sizze_nonzzero_235124) +\n                sext_i32_i64(virt_group_id_235139) *\n                squot64(segred_group_sizze_220425,\n                        segment_sizze_nonzzero_235124) - gtid_220431 *\n                slice_235140;\n        int64_t gtid_220432 = remnant_235142;\n        int64_t remnant_235143 = remnant_235142 - gtid_220432;\n        int64_t gtid_220433 = srem64(sext_i32_i64(local_tid_235127),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_220431,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_220432,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_ti",
            "d_235127),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_220425,\n                                                                 segment_sizze_nonzzero_235124)))) {\n                int64_t x_220448;\n                \n                x_220448 = ((__global int64_t *) ext_mem_229520)[gtid_220431 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220432];\n                \n                double x_220449;\n                \n                x_220449 = ((__global double *) ext_mem_229519)[gtid_220431 *\n                                                                l_n_m_203733 +\n                                                                gtid_220432];\n                \n                int64_t binop_y_228790 = mul64(jump_t_203582, gtid_220432);\n                int64_t binop_y_228791 = smin64(i_203760, binop_y_228790);\n                int64_t index_primexp_228792 = add64((int64_t) 1,\n                                                     binop_y_228791);\n                bool cond_220452 = sle64(n_203572, gtid_220433);\n                int64_t defunc_0_f_res_220453;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220453 = (int64_t) 0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220433, x_220448);\n                    int64_t defunc_1_add_res_220455 = add64((int64_t) 1,\n                                                            i_220454);\n                    \n                    defunc_0_f_res_220453 = defunc_1_add_res_220455;\n                }\n                \n                double defunc_0_f_res_220456;\n                \n                if (cond_220452) {\n                    defunc_0_f_res_220456 = 0.0;\n                } else {\n                    int64_t i_220457 = add64(gtid_220433, x_220448);\n      ",
            "              double defunc_0_add_arg_220458;\n                    \n                    defunc_0_add_arg_220458 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220431 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220457 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220456 = defunc_0_add_arg_220458;\n                }\n                \n                int64_t binop_p_220459 = sub64(defunc_0_f_res_220453,\n                                               index_primexp_228792);\n                double defunc_0_f_res_220460 = sitofp_i64_f64(binop_p_220459);\n                double abs_res_220461 = fabs(defunc_0_f_res_220460);\n                double tmp1_220462 = abs_res_220461 / x_220449;\n                double x_220463 = tmp1_220462 * tmp1_220462;\n                double y_220464 = tmp1_220462 * x_220463;\n                double tmp2_220465 = 1.0 - y_220464;\n                double x_220466 = tmp2_220465 * tmp2_220465;\n                double tmp3_220467 = tmp2_220465 * x_220466;\n                double w_j_220468 = defunc_0_f_res_220456 * tmp3_220467;\n                double xw_j_220469 = defunc_0_f_res_220460 * w_j_220468;\n                double x2w_j_220470 = defunc_0_f_res_220460 * xw_j_220469;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)] =\n                        w_j_220468;\n                    ((__local\n                      double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)] =\n                 ",
            "       xw_j_220469;\n                    ((__local\n                      double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)] =\n                        x2w_j_220470;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220435;\n                double x_220436;\n                double x_220437;\n                double x_220438;\n                double x_220439;\n                double x_220440;\n                double x_235144;\n                double x_235145;\n                double x_235146;\n                double x_235147;\n                double x_235148;\n                double x_235149;\n                bool ltid_in_bounds_235153 =\n                     slt64(sext_i32_i64(local_tid_235127), q_l_203577 *\n                           squot64(segred_group_sizze_220425,\n                                   segment_sizze_nonzzero_235124));\n                int32_t skip_threads_235154;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235153) {\n                        x_220438 = ((volatile __local\n                                     double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)];\n                        x_220439 = ((volatile __local\n                                     double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)];\n                        x_220440 = ((volatile __local\n                         ",
            "            double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)];\n                        if ((local_tid_235127 - squot32(local_tid_235127, 32) *\n                             32) == 0) {\n                            x_220435 = x_220438;\n                            x_220436 = x_220439;\n                            x_220437 = x_220440;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235154 = 1;\n                    while (slt32(skip_threads_235154, 32)) {\n                        bool thread_active_235155 = sle32(skip_threads_235154,\n                                                          local_tid_235127 -\n                                                          squot32(local_tid_235127,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235153;\n                        \n                        if (thread_active_235155) {\n                            // read operands\n                            {\n                                x_220435 = ((volatile __local\n                                             double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127) -\n                                                                           sext_i32_i64(skip_threads_235154)];\n                                x_220436 = ((volatile __local\n                                             double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127) -\n                                                                           sext_i32_i64(skip_threads_235154)];\n                                x_220437 = ((volatile __local\n                                             double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127) -\n                                                                           sext_i32_i64(skip_threads_235154)];\n                            }\n       ",
            "                 }\n                        // perform operation\n                        {\n                            bool inactive_235156 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235127),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235127) -\n                                       sext_i32_i64(local_tid_235127 -\n                                       skip_threads_235154));\n                            \n                            if (thread_active_235155 && inactive_235156) {\n                                x_220435 = x_220438;\n                                x_220436 = x_220439;\n                                x_220437 = x_220440;\n                            }\n                            if (thread_active_235155) {\n                                if (!inactive_235156) {\n                                    double defunc_1_op_res_220441 = x_220435 +\n                                           x_220438;\n                                    double defunc_1_op_res_220442 = x_220436 +\n                                           x_220439;\n                                    double defunc_1_op_res_220443 = x_220437 +\n                                           x_220440;\n                                    \n                                    x_220435 = defunc_1_op_res_220441;\n                                    x_220436 = defunc_1_op_res_220442;\n                                    x_220437 = defunc_1_op_res_220443;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235129, skip_threads_235154)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235155) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  doub",
            "le *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)] =\n                                    x_220435;\n                                x_220438 = x_220435;\n                                ((volatile __local\n                                  double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)] =\n                                    x_220436;\n                                x_220439 = x_220436;\n                                ((volatile __local\n                                  double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)] =\n                                    x_220437;\n                                x_220440 = x_220437;\n                            }\n                        }\n                        if (sle32(wave_sizze_235129, skip_threads_235154)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235154 *= 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_235127 - squot32(local_tid_235127, 32) *\n                         32) == 31 && ltid_in_bounds_235153) {\n                        ((volatile __local\n                          double *) red_arr_mem_235131)[sext_i32_i64(squot32(local_tid_235127,\n                                                                             32))] =\n                            x_220435;\n                        ((volatile __local\n                          double *) red_arr_mem_235133)[sext_i32_i64(squot32(local_tid_235127,\n                                                                             32))] =\n                            x_220436;\n                        ((volatile __local\n                          double *) red_arr_mem_235135)[sext_i32_i64(squot32(local_tid_235127,\n                                                                             32))] =\n              ",
            "              x_220437;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235157;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235127, 32) == 0 &&\n                            ltid_in_bounds_235153) {\n                            x_235147 = ((volatile __local\n                                         double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)];\n                            x_235148 = ((volatile __local\n                                         double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)];\n                            x_235149 = ((volatile __local\n                                         double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)];\n                            if ((local_tid_235127 - squot32(local_tid_235127,\n                                                            32) * 32) == 0) {\n                                x_235144 = x_235147;\n                                x_235145 = x_235148;\n                                x_235146 = x_235149;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235157 = 1;\n                        while (slt32(skip_threads_235157, 32)) {\n                            bool thread_active_235158 =\n                                 sle32(skip_threads_235157, local_tid_235127 -\n                                       squot32(local_tid_235127, 32) * 32) &&\n                                 (squot32(local_tid_235127, 32) == 0 &&\n                                  ltid_in_bounds_235153);\n                            \n                            if (thread_active_235158) {\n",
            "                                // read operands\n                                {\n                                    x_235144 = ((volatile __local\n                                                 double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127) -\n                                                                               sext_i32_i64(skip_threads_235157)];\n                                    x_235145 = ((volatile __local\n                                                 double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127) -\n                                                                               sext_i32_i64(skip_threads_235157)];\n                                    x_235146 = ((volatile __local\n                                                 double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127) -\n                                                                               sext_i32_i64(skip_threads_235157)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235159 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235127 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_235127 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235127 -\n                                                         skip_threads_235157) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235158 && inactive_235159) {\n                                    x_235144 = x_235147;\n                                    x_235145 = x_235148;\n                                    x_235146 = x_235149;\n                                }\n                 ",
            "               if (thread_active_235158) {\n                                    if (!inactive_235159) {\n                                        double defunc_1_op_res_235150 =\n                                               x_235144 + x_235147;\n                                        double defunc_1_op_res_235151 =\n                                               x_235145 + x_235148;\n                                        double defunc_1_op_res_235152 =\n                                               x_235146 + x_235149;\n                                        \n                                        x_235144 = defunc_1_op_res_235150;\n                                        x_235145 = defunc_1_op_res_235151;\n                                        x_235146 = defunc_1_op_res_235152;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235129, skip_threads_235157)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235158) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)] =\n                                        x_235144;\n                                    x_235147 = x_235144;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)] =\n                                        x_235145;\n                                    x_235148 = x_235145;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)] =\n                                        x_235146;\n                                    x_235149 = x_235146;\n      ",
            "                          }\n                            }\n                            if (sle32(wave_sizze_235129, skip_threads_235157)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235157 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235160 = squot32(local_tid_235127, 32) == 0 ||\n                     !ltid_in_bounds_235153;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235160) {\n                            x_220438 = x_220435;\n                            x_220439 = x_220436;\n                            x_220440 = x_220437;\n                            x_220435 = ((__local\n                                         double *) red_arr_mem_235131)[sext_i32_i64(squot32(local_tid_235127,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220436 = ((__local\n                                         double *) red_arr_mem_235133)[sext_i32_i64(squot32(local_tid_235127,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220437 = ((__local\n                                         double *) red_arr_mem_235135)[sext_i32_i64(squot32(local_tid_235127,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform ",
            "operation\n                    {\n                        bool inactive_235161 =\n                             slt64(srem64(sext_i32_i64(local_tid_235127),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235127) -\n                                   sext_i32_i64(squot32(local_tid_235127, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235160) {\n                            if (inactive_235161) {\n                                x_220435 = x_220438;\n                                x_220436 = x_220439;\n                                x_220437 = x_220440;\n                            }\n                        }\n                        if (!no_carry_in_235160) {\n                            if (!inactive_235161) {\n                                double defunc_1_op_res_220441 = x_220435 +\n                                       x_220438;\n                                double defunc_1_op_res_220442 = x_220436 +\n                                       x_220439;\n                                double defunc_1_op_res_220443 = x_220437 +\n                                       x_220440;\n                                \n                                x_220435 = defunc_1_op_res_220441;\n                                x_220436 = defunc_1_op_res_220442;\n                                x_220437 = defunc_1_op_res_220443;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235160) {\n                            ((__local\n                              double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)] =\n                                x_220435;\n                            ((__local\n                              double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)] =\n                                x_220436;\n       ",
            "                     ((__local\n                              double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)] =\n                                x_220437;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235127, 32) == 0 &&\n                        ltid_in_bounds_235153) {\n                        ((__local\n                          double *) red_arr_mem_235131)[sext_i32_i64(local_tid_235127)] =\n                            x_220438;\n                        ((__local\n                          double *) red_arr_mem_235133)[sext_i32_i64(local_tid_235127)] =\n                            x_220439;\n                        ((__local\n                          double *) red_arr_mem_235135)[sext_i32_i64(local_tid_235127)] =\n                            x_220440;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235139) *\n                      squot64(segred_group_sizze_220425,\n                              segment_sizze_nonzzero_235124) +\n                      sext_i32_i64(local_tid_235127), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235127),\n                                             squot64(segred_group_sizze_220425,\n                                                     segment_sizze_nonzzero_235124))) {\n                double tmp_235162;\n                \n                tmp_235162 = ((__local\n                               double *) red_arr_mem_235131)[(sext_i32_i64(local_tid_235127) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero",
            "_235124 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230784)[squot64(sext_i32_i64(virt_group_id_235139) *\n                                                squot64(segred_group_sizze_220425,\n                                                        segment_sizze_nonzzero_235124) +\n                                                sext_i32_i64(local_tid_235127),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235139) *\n                                         squot64(segred_group_sizze_220425,\n                                                 segment_sizze_nonzzero_235124) +\n                                         sext_i32_i64(local_tid_235127) -\n                                         squot64(sext_i32_i64(virt_group_id_235139) *\n                                                 squot64(segred_group_sizze_220425,\n                                                         segment_sizze_nonzzero_235124) +\n                                                 sext_i32_i64(local_tid_235127),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235162;\n                \n                double tmp_235163;\n                \n                tmp_235163 = ((__local\n                               double *) red_arr_mem_235133)[(sext_i32_i64(local_tid_235127) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235124 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230788)[squot64(sext_i32_i64(virt_group_id_235139) *\n                                                squot64(segred_group_sizze_220425,\n                                           ",
            "             segment_sizze_nonzzero_235124) +\n                                                sext_i32_i64(local_tid_235127),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235139) *\n                                         squot64(segred_group_sizze_220425,\n                                                 segment_sizze_nonzzero_235124) +\n                                         sext_i32_i64(local_tid_235127) -\n                                         squot64(sext_i32_i64(virt_group_id_235139) *\n                                                 squot64(segred_group_sizze_220425,\n                                                         segment_sizze_nonzzero_235124) +\n                                                 sext_i32_i64(local_tid_235127),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235163;\n                \n                double tmp_235164;\n                \n                tmp_235164 = ((__local\n                               double *) red_arr_mem_235135)[(sext_i32_i64(local_tid_235127) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235124 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230792)[squot64(sext_i32_i64(virt_group_id_235139) *\n                                                squot64(segred_group_sizze_220425,\n                                                        segment_sizze_nonzzero_235124) +\n                                                sext_i32_i64(local_tid_235127),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235139) *\n                                        ",
            " squot64(segred_group_sizze_220425,\n                                                 segment_sizze_nonzzero_235124) +\n                                         sext_i32_i64(local_tid_235127) -\n                                         squot64(sext_i32_i64(virt_group_id_235139) *\n                                                 squot64(segred_group_sizze_220425,\n                                                         segment_sizze_nonzzero_235124) +\n                                                 sext_i32_i64(local_tid_235127),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235164;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220425\n}\n__kernel void mainzisegred_small_220503(__global int *global_failure,\n                                        uint red_arr_mem_235243_backing_offset_0,\n                                        uint red_arr_mem_235241_backing_offset_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_220496,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_235234,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsi",
            "gned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230797,\n                                        __global unsigned char *mem_230801,\n                                        __global unsigned char *mem_230805,\n                                        __global unsigned char *mem_230810,\n                                        __global unsigned char *mem_230814)\n{\n    #define segred_group_sizze_220495 (mainzisegred_group_sizze_220008)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235243_backing_1 =\n                           &shared_mem[red_arr_mem_235243_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235241_backing_0 =\n                           &shared_mem[red_arr_mem_235241_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235236;\n    int32_t local_tid_235237;\n    int64_t group_sizze_235240;\n    int32_t wave_sizze_235239;\n    int32_t group_tid_235238;\n    \n    global_tid_235236 = get_global_id(0);\n    local_tid_235237 = get_local_id(0);\n    group_sizze_235240 = get_local_size(0);\n    wave_sizze_235239 = LOCKSTEP_WIDTH;\n    group_tid_235238 = get_group_id(0);\n    \n    int32_t phys_tid_220503 = global_tid_235236;\n    __local unsigned char *red_arr_mem_235241;\n    \n    red_arr_mem_235241 = (__local unsigned char *) red_arr_mem_235241_backing_0;\n    \n    __local unsigned char *red_arr_mem_235243;\n    \n    red_arr_mem_235243 = (__local unsigned char *) red_arr_mem_235243_backing_1;\n    \n    int32_t phys_group_id_235245;\n    \n    phys_group_id_235245 = get_group_id(0);\n    for (int32_t i_235246 = 0; i_235246 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_220495,\n                                        ",
            "          segment_sizze_nonzzero_235234))) -\n                   phys_group_id_235245, sext_i64_i32(num_groups_220496));\n         i_235246++) {\n        int32_t virt_group_id_235247 = phys_group_id_235245 + i_235246 *\n                sext_i64_i32(num_groups_220496);\n        int64_t slice_235248 = l_n_m_203733;\n        int64_t slice_235249 = partition_sizze_203667 * slice_235248;\n        int64_t gtid_220500 = squot64(squot64(sext_i32_i64(local_tid_235237),\n                                              segment_sizze_nonzzero_235234) +\n                                      sext_i32_i64(virt_group_id_235247) *\n                                      squot64(segred_group_sizze_220495,\n                                              segment_sizze_nonzzero_235234),\n                                      slice_235248);\n        int64_t remnant_235250 = squot64(sext_i32_i64(local_tid_235237),\n                                         segment_sizze_nonzzero_235234) +\n                sext_i32_i64(virt_group_id_235247) *\n                squot64(segred_group_sizze_220495,\n                        segment_sizze_nonzzero_235234) - gtid_220500 *\n                slice_235248;\n        int64_t gtid_220501 = remnant_235250;\n        int64_t remnant_235251 = remnant_235250 - gtid_220501;\n        int64_t gtid_220502 = srem64(sext_i32_i64(local_tid_235237),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_220500,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_220501,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_235237),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_si",
            "zze_220495,\n                                                                 segment_sizze_nonzzero_235234)))) {\n                int64_t x_220518;\n                \n                x_220518 = ((__global int64_t *) ext_mem_229520)[gtid_220500 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_220501];\n                \n                double x_220519;\n                \n                x_220519 = ((__global double *) ext_mem_229519)[gtid_220500 *\n                                                                l_n_m_203733 +\n                                                                gtid_220501];\n                \n                int64_t binop_y_228785 = mul64(jump_t_203582, gtid_220501);\n                int64_t binop_y_228786 = smin64(i_203760, binop_y_228785);\n                int64_t index_primexp_228787 = add64((int64_t) 1,\n                                                     binop_y_228786);\n                double a11_220521;\n                \n                a11_220521 = ((__global double *) mem_230797)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double b11_220522;\n                \n                b11_220522 = ((__global double *) mem_230801)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                double c11_220523;\n                \n                c11_220523 = ((__global double *) mem_230805)[gtid_220500 *\n                                                              l_n_m_203733 +\n                                                              gtid_220501];\n                \n                bool cond_220525 = sle64(n_203572, gtid_220502);\n                int64_t defunc_0_",
            "f_res_220526;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220526 = (int64_t) 0;\n                } else {\n                    int64_t i_220527 = add64(gtid_220502, x_220518);\n                    int64_t defunc_1_add_res_220528 = add64((int64_t) 1,\n                                                            i_220527);\n                    \n                    defunc_0_f_res_220526 = defunc_1_add_res_220528;\n                }\n                \n                double defunc_0_f_res_220529;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220529 = 0.0;\n                } else {\n                    int64_t i_220530 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220531;\n                    \n                    defunc_0_add_arg_220531 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_220500 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_220530 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_220529 = defunc_0_add_arg_220531;\n                }\n                \n                int64_t binop_p_220532 = sub64(defunc_0_f_res_220526,\n                                               index_primexp_228787);\n                double defunc_0_f_res_220533 = sitofp_i64_f64(binop_p_220532);\n                double abs_res_220534 = fabs(defunc_0_f_res_220533);\n                double tmp1_220535 = abs_res_220534 / x_220519;\n                double x_220536 = tmp1_220535 * tmp1_220535;\n                double y_220537 = tmp1_220535 * x_220536;\n                double tmp2_220538 = 1.0 - y_220537;\n                double x_220539 = tm",
            "p2_220538 * tmp2_220538;\n                double tmp3_220540 = tmp2_220538 * x_220539;\n                double tmp4_220541 = defunc_0_f_res_220529 * tmp3_220540;\n                double defunc_1_f_res_220542 = defunc_0_f_res_220533 *\n                       tmp4_220541;\n                double defunc_0_f_res_220543;\n                \n                if (cond_220525) {\n                    defunc_0_f_res_220543 = 0.0;\n                } else {\n                    int64_t i_220544 = add64(gtid_220502, x_220518);\n                    double defunc_0_add_arg_220545;\n                    \n                    defunc_0_add_arg_220545 = ((__global\n                                                double *) mem_230659)[gtid_220500 *\n                                                                      n_203572 +\n                                                                      i_220544];\n                    defunc_0_f_res_220543 = defunc_0_add_arg_220545;\n                }\n                \n                double x_220546 = a11_220521 * tmp4_220541;\n                double y_220547 = b11_220522 * defunc_1_f_res_220542;\n                double x_220548 = x_220546 + y_220547;\n                double defunc_9_fit_fun_res_220549 = defunc_0_f_res_220543 *\n                       x_220548;\n                double x_220550 = b11_220522 * tmp4_220541;\n                double y_220551 = c11_220523 * defunc_1_f_res_220542;\n                double x_220552 = x_220550 + y_220551;\n                double defunc_9_slope_fun_res_220553 = defunc_0_f_res_220543 *\n                       x_220552;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)] =\n                        defunc_9_fit_fun_res_220549;\n                    ((__local\n                      double *) red_arr_mem_235243)[sext_i32_i64(local_tid_23523",
            "7)] =\n                        defunc_9_slope_fun_res_220553;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220504;\n                double x_220505;\n                double x_220506;\n                double x_220507;\n                double x_235252;\n                double x_235253;\n                double x_235254;\n                double x_235255;\n                bool ltid_in_bounds_235258 =\n                     slt64(sext_i32_i64(local_tid_235237), q_l_203577 *\n                           squot64(segred_group_sizze_220495,\n                                   segment_sizze_nonzzero_235234));\n                int32_t skip_threads_235259;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235258) {\n                        x_220506 = ((volatile __local\n                                     double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)];\n                        x_220507 = ((volatile __local\n                                     double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)];\n                        if ((local_tid_235237 - squot32(local_tid_235237, 32) *\n                             32) == 0) {\n                            x_220504 = x_220506;\n                            x_220505 = x_220507;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235259 = 1;\n                    while (slt32(skip_threads",
            "_235259, 32)) {\n                        bool thread_active_235260 = sle32(skip_threads_235259,\n                                                          local_tid_235237 -\n                                                          squot32(local_tid_235237,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235258;\n                        \n                        if (thread_active_235260) {\n                            // read operands\n                            {\n                                x_220504 = ((volatile __local\n                                             double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237) -\n                                                                           sext_i32_i64(skip_threads_235259)];\n                                x_220505 = ((volatile __local\n                                             double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237) -\n                                                                           sext_i32_i64(skip_threads_235259)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235261 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235237),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235237) -\n                                       sext_i32_i64(local_tid_235237 -\n                                       skip_threads_235259));\n                            \n                            if (thread_active_235260 && inactive_235261) {\n                                x_220504 = x_220506;\n                                x_220505 = x_220507;\n                            }\n                            if (thread_active_235260) {\n                                if (!inactive_235261) {\n                           ",
            "         double defunc_1_op_res_220508 = x_220504 +\n                                           x_220506;\n                                    double defunc_1_op_res_220509 = x_220505 +\n                                           x_220507;\n                                    \n                                    x_220504 = defunc_1_op_res_220508;\n                                    x_220505 = defunc_1_op_res_220509;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235239, skip_threads_235259)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235260) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)] =\n                                    x_220504;\n                                x_220506 = x_220504;\n                                ((volatile __local\n                                  double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)] =\n                                    x_220505;\n                                x_220507 = x_220505;\n                            }\n                        }\n                        if (sle32(wave_sizze_235239, skip_threads_235259)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235259 *= 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_235237 - squot32(local_tid_235237, 32) *\n                         32) == 31 && ltid_in_bounds_235258) {\n                        ((volatile __local\n                          double *) red_arr_mem_235241)[sext_i32_i64(squot32(local",
            "_tid_235237,\n                                                                             32))] =\n                            x_220504;\n                        ((volatile __local\n                          double *) red_arr_mem_235243)[sext_i32_i64(squot32(local_tid_235237,\n                                                                             32))] =\n                            x_220505;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235262;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235237, 32) == 0 &&\n                            ltid_in_bounds_235258) {\n                            x_235254 = ((volatile __local\n                                         double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)];\n                            x_235255 = ((volatile __local\n                                         double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)];\n                            if ((local_tid_235237 - squot32(local_tid_235237,\n                                                            32) * 32) == 0) {\n                                x_235252 = x_235254;\n                                x_235253 = x_235255;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235262 = 1;\n                        while (slt32(skip_threads_235262, 32)) {\n                            bool thread_active_235263 =\n                                 sle32(skip_threads_235262, local_tid_235237 -\n                                       squot32(local_tid_235237, 32) * 32) &&\n                                 (squot32(local_tid_23523",
            "7, 32) == 0 &&\n                                  ltid_in_bounds_235258);\n                            \n                            if (thread_active_235263) {\n                                // read operands\n                                {\n                                    x_235252 = ((volatile __local\n                                                 double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237) -\n                                                                               sext_i32_i64(skip_threads_235262)];\n                                    x_235253 = ((volatile __local\n                                                 double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237) -\n                                                                               sext_i32_i64(skip_threads_235262)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235264 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235237 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_235237 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235237 -\n                                                         skip_threads_235262) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235263 && inactive_235264) {\n                                    x_235252 = x_235254;\n                                    x_235253 = x_235255;\n                                }\n                                if (thread_active_235263) {\n                                    if (!inactive_235264) {\n                                        double defunc_1_op_res_235256 =\n                 ",
            "                              x_235252 + x_235254;\n                                        double defunc_1_op_res_235257 =\n                                               x_235253 + x_235255;\n                                        \n                                        x_235252 = defunc_1_op_res_235256;\n                                        x_235253 = defunc_1_op_res_235257;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235239, skip_threads_235262)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235263) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)] =\n                                        x_235252;\n                                    x_235254 = x_235252;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)] =\n                                        x_235253;\n                                    x_235255 = x_235253;\n                                }\n                            }\n                            if (sle32(wave_sizze_235239, skip_threads_235262)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235262 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235265 = squot32(local_tid_235237, 32) == 0 ||\n                     !ltid_in_bounds_235258;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands",
            "\n                    {\n                        if (!no_carry_in_235265) {\n                            x_220506 = x_220504;\n                            x_220507 = x_220505;\n                            x_220504 = ((__local\n                                         double *) red_arr_mem_235241)[sext_i32_i64(squot32(local_tid_235237,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220505 = ((__local\n                                         double *) red_arr_mem_235243)[sext_i32_i64(squot32(local_tid_235237,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235266 =\n                             slt64(srem64(sext_i32_i64(local_tid_235237),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235237) -\n                                   sext_i32_i64(squot32(local_tid_235237, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235265) {\n                            if (inactive_235266) {\n                                x_220504 = x_220506;\n                                x_220505 = x_220507;\n                            }\n                        }\n                        if (!no_carry_in_235265) {\n                            if (!inactive_235266) {\n                                double defunc_1_op_res_220508 = x_220504 +\n                                       x_220506;\n                                double defunc_1_op_res_220509 = x_220505 +\n                                       x_220507;\n                      ",
            "          \n                                x_220504 = defunc_1_op_res_220508;\n                                x_220505 = defunc_1_op_res_220509;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235265) {\n                            ((__local\n                              double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)] =\n                                x_220504;\n                            ((__local\n                              double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)] =\n                                x_220505;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235237, 32) == 0 &&\n                        ltid_in_bounds_235258) {\n                        ((__local\n                          double *) red_arr_mem_235241)[sext_i32_i64(local_tid_235237)] =\n                            x_220506;\n                        ((__local\n                          double *) red_arr_mem_235243)[sext_i32_i64(local_tid_235237)] =\n                            x_220507;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235247) *\n                      squot64(segred_group_sizze_220495,\n                              segment_sizze_nonzzero_235234) +\n                      sext_i32_i64(local_tid_235237), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235237),\n                                             squot64(segred_group_sizze_220495,\n                                                     segment_sizze_nonzzero_2",
            "35234))) {\n                double tmp_235267;\n                \n                tmp_235267 = ((__local\n                               double *) red_arr_mem_235241)[(sext_i32_i64(local_tid_235237) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235234 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230810)[squot64(sext_i32_i64(virt_group_id_235247) *\n                                                squot64(segred_group_sizze_220495,\n                                                        segment_sizze_nonzzero_235234) +\n                                                sext_i32_i64(local_tid_235237),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235247) *\n                                         squot64(segred_group_sizze_220495,\n                                                 segment_sizze_nonzzero_235234) +\n                                         sext_i32_i64(local_tid_235237) -\n                                         squot64(sext_i32_i64(virt_group_id_235247) *\n                                                 squot64(segred_group_sizze_220495,\n                                                         segment_sizze_nonzzero_235234) +\n                                                 sext_i32_i64(local_tid_235237),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235267;\n                \n                double tmp_235268;\n                \n                tmp_235268 = ((__local\n                               double *) red_arr_mem_235243)[(sext_i32_i64(local_tid_235237) +\n                                                              (int64_t) 1) *\n                                                 ",
            "            segment_sizze_nonzzero_235234 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230814)[squot64(sext_i32_i64(virt_group_id_235247) *\n                                                squot64(segred_group_sizze_220495,\n                                                        segment_sizze_nonzzero_235234) +\n                                                sext_i32_i64(local_tid_235237),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235247) *\n                                         squot64(segred_group_sizze_220495,\n                                                 segment_sizze_nonzzero_235234) +\n                                         sext_i32_i64(local_tid_235237) -\n                                         squot64(sext_i32_i64(virt_group_id_235247) *\n                                                 squot64(segred_group_sizze_220495,\n                                                         segment_sizze_nonzzero_235234) +\n                                                 sext_i32_i64(local_tid_235237),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235268;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_220495\n}\n__kernel void mainzisegred_small_221513(__global int *global_failure,\n                                        uint red_arr_mem_235393_backing_offset_0,\n                                        uint red_arr_mem_235391_backing_offset_1,\n                                        uint red_arr_mem_235389_backing_offset_2,\n                                        uint red_arr_mem_235387_backing_offset_3,\n                                        uint red_arr_mem_2",
            "35385_backing_offset_4,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221503,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                                        int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_235378,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230891,\n                                        __global unsigned char *mem_230895,\n                                        __global unsigned char *mem_230899,\n                                        __global unsigned char *mem_230903,\n                                        __global unsigned char *mem_230907)\n{\n    #define segred_group_sizze_221502 (mainzisegred_group_sizze_221099)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235393_backing_4 =\n                           &shared_mem[red_arr_mem_235393_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235391_backing_3 =\n                           &shared_mem[red_arr_mem_235391_backing_offset_1];\n    volatile unsigned char *red_arr_mem_235389_backing_2 =\n                           &shared_mem[red_arr_mem_235389_backing_offset_2];\n    volatile unsigned char *red_arr_mem_235387_backing_1 =\n                           &s",
            "hared_mem[red_arr_mem_235387_backing_offset_3];\n    volatile unsigned char *red_arr_mem_235385_backing_0 =\n                           &shared_mem[red_arr_mem_235385_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235380;\n    int32_t local_tid_235381;\n    int64_t group_sizze_235384;\n    int32_t wave_sizze_235383;\n    int32_t group_tid_235382;\n    \n    global_tid_235380 = get_global_id(0);\n    local_tid_235381 = get_local_id(0);\n    group_sizze_235384 = get_local_size(0);\n    wave_sizze_235383 = LOCKSTEP_WIDTH;\n    group_tid_235382 = get_group_id(0);\n    \n    int32_t phys_tid_221513 = global_tid_235380;\n    __local unsigned char *red_arr_mem_235385;\n    \n    red_arr_mem_235385 = (__local unsigned char *) red_arr_mem_235385_backing_0;\n    \n    __local unsigned char *red_arr_mem_235387;\n    \n    red_arr_mem_235387 = (__local unsigned char *) red_arr_mem_235387_backing_1;\n    \n    __local unsigned char *red_arr_mem_235389;\n    \n    red_arr_mem_235389 = (__local unsigned char *) red_arr_mem_235389_backing_2;\n    \n    __local unsigned char *red_arr_mem_235391;\n    \n    red_arr_mem_235391 = (__local unsigned char *) red_arr_mem_235391_backing_3;\n    \n    __local unsigned char *red_arr_mem_235393;\n    \n    red_arr_mem_235393 = (__local unsigned char *) red_arr_mem_235393_backing_4;\n    \n    int32_t phys_group_id_235395;\n    \n    phys_group_id_235395 = get_group_id(0);\n    for (int32_t i_235396 = 0; i_235396 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_221502,\n                                                  segment_sizze_nonzzero_235378))) -\n                   phys_group_id_235395, sext_i64_i32(num_groups_221503));\n         i_235396++) {\n        int32_t virt_group_id_235397 = phys_group_id_235395 + i_235396 *\n                sext_i64_i32(num_groups_221503);\n        int64_t slice_235398 = l_n_m_203733;\n        int64_t sl",
            "ice_235399 = partition_sizze_203667 * slice_235398;\n        int64_t gtid_221510 = squot64(squot64(sext_i32_i64(local_tid_235381),\n                                              segment_sizze_nonzzero_235378) +\n                                      sext_i32_i64(virt_group_id_235397) *\n                                      squot64(segred_group_sizze_221502,\n                                              segment_sizze_nonzzero_235378),\n                                      slice_235398);\n        int64_t remnant_235400 = squot64(sext_i32_i64(local_tid_235381),\n                                         segment_sizze_nonzzero_235378) +\n                sext_i32_i64(virt_group_id_235397) *\n                squot64(segred_group_sizze_221502,\n                        segment_sizze_nonzzero_235378) - gtid_221510 *\n                slice_235398;\n        int64_t gtid_221511 = remnant_235400;\n        int64_t remnant_235401 = remnant_235400 - gtid_221511;\n        int64_t gtid_221512 = srem64(sext_i32_i64(local_tid_235381),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_221510,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_221511,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_235381),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_221502,\n                                                                 segment_sizze_nonzzero_235378)))) {\n                int64_t x_221533;\n                \n                x_221533 = ((__global int64_t *) ext_mem_229520)[gtid_221510 *\n                                                                 l_n_m_203733 +\n     ",
            "                                                            gtid_221511];\n                \n                double x_221534;\n                \n                x_221534 = ((__global double *) ext_mem_229519)[gtid_221510 *\n                                                                l_n_m_203733 +\n                                                                gtid_221511];\n                \n                int64_t binop_y_228800 = mul64(jump_t_203582, gtid_221511);\n                int64_t binop_y_228801 = smin64(i_203760, binop_y_228800);\n                int64_t index_primexp_228802 = add64((int64_t) 1,\n                                                     binop_y_228801);\n                bool cond_221537 = sle64(n_203572, gtid_221512);\n                int64_t defunc_0_f_res_221538;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221538 = (int64_t) 0;\n                } else {\n                    int64_t i_221539 = add64(gtid_221512, x_221533);\n                    int64_t defunc_1_add_res_221540 = add64((int64_t) 1,\n                                                            i_221539);\n                    \n                    defunc_0_f_res_221538 = defunc_1_add_res_221540;\n                }\n                \n                double defunc_0_f_res_221541;\n                \n                if (cond_221537) {\n                    defunc_0_f_res_221541 = 0.0;\n                } else {\n                    int64_t i_221542 = add64(gtid_221512, x_221533);\n                    double defunc_0_add_arg_221543;\n                    \n                    defunc_0_add_arg_221543 = ((__global\n                                                double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221510 *\n                                                                             ctx_param_ext_229597 +\n                                                                           ",
            "  i_221542 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221541 = defunc_0_add_arg_221543;\n                }\n                \n                int64_t binop_p_221544 = sub64(defunc_0_f_res_221538,\n                                               index_primexp_228802);\n                double defunc_0_f_res_221545 = sitofp_i64_f64(binop_p_221544);\n                double abs_res_221546 = fabs(defunc_0_f_res_221545);\n                double tmp1_221547 = abs_res_221546 / x_221534;\n                double x_221548 = tmp1_221547 * tmp1_221547;\n                double y_221549 = tmp1_221547 * x_221548;\n                double tmp2_221550 = 1.0 - y_221549;\n                double x_221551 = tmp2_221550 * tmp2_221550;\n                double tmp3_221552 = tmp2_221550 * x_221551;\n                double w_j_221553 = defunc_0_f_res_221541 * tmp3_221552;\n                double xw_j_221554 = defunc_0_f_res_221545 * w_j_221553;\n                double x2w_j_221555 = defunc_0_f_res_221545 * xw_j_221554;\n                double x3w_j_221556 = defunc_0_f_res_221545 * x2w_j_221555;\n                double x4w_j_221557 = defunc_0_f_res_221545 * x3w_j_221556;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)] =\n                        w_j_221553;\n                    ((__local\n                      double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)] =\n                        xw_j_221554;\n                    ((__local\n                      double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)] =\n                        x2w_j_221555;\n                    ((__local\n                      double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)] =\n                        x3w_j_221556;\n         ",
            "           ((__local\n                      double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)] =\n                        x4w_j_221557;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_221514;\n                double x_221515;\n                double x_221516;\n                double x_221517;\n                double x_221518;\n                double x_221519;\n                double x_221520;\n                double x_221521;\n                double x_221522;\n                double x_221523;\n                double x_235402;\n                double x_235403;\n                double x_235404;\n                double x_235405;\n                double x_235406;\n                double x_235407;\n                double x_235408;\n                double x_235409;\n                double x_235410;\n                double x_235411;\n                bool ltid_in_bounds_235417 =\n                     slt64(sext_i32_i64(local_tid_235381), q_l_203577 *\n                           squot64(segred_group_sizze_221502,\n                                   segment_sizze_nonzzero_235378));\n                int32_t skip_threads_235418;\n                \n ",
            "               // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235417) {\n                        x_221519 = ((volatile __local\n                                     double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)];\n                        x_221520 = ((volatile __local\n                                     double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)];\n                        x_221521 = ((volatile __local\n                                     double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)];\n                        x_221522 = ((volatile __local\n                                     double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)];\n                        x_221523 = ((volatile __local\n                                     double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)];\n                        if ((local_tid_235381 - squot32(local_tid_235381, 32) *\n                             32) == 0) {\n                            x_221514 = x_221519;\n                            x_221515 = x_221520;\n                            x_221516 = x_221521;\n                            x_221517 = x_221522;\n                            x_221518 = x_221523;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235418 = 1;\n                    while (slt32(skip_threads_235418, 32)) {\n                        bool thread_active_235419 = sle32(skip_threads_235418,\n                                                          local_tid_235381 -\n                                                          squot32(local_tid_235381,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235417;\n                        \n                        if (thread_active_235419) {\n                            // read operands\n   ",
            "                         {\n                                x_221514 = ((volatile __local\n                                             double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381) -\n                                                                           sext_i32_i64(skip_threads_235418)];\n                                x_221515 = ((volatile __local\n                                             double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381) -\n                                                                           sext_i32_i64(skip_threads_235418)];\n                                x_221516 = ((volatile __local\n                                             double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381) -\n                                                                           sext_i32_i64(skip_threads_235418)];\n                                x_221517 = ((volatile __local\n                                             double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381) -\n                                                                           sext_i32_i64(skip_threads_235418)];\n                                x_221518 = ((volatile __local\n                                             double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381) -\n                                                                           sext_i32_i64(skip_threads_235418)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235420 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235381),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235381) -\n                                       sext_i32_i64(local_tid_235381 -\n                                       skip_threads_235418));\n                            \n                   ",
            "         if (thread_active_235419 && inactive_235420) {\n                                x_221514 = x_221519;\n                                x_221515 = x_221520;\n                                x_221516 = x_221521;\n                                x_221517 = x_221522;\n                                x_221518 = x_221523;\n                            }\n                            if (thread_active_235419) {\n                                if (!inactive_235420) {\n                                    double defunc_1_op_res_221524 = x_221514 +\n                                           x_221519;\n                                    double defunc_1_op_res_221525 = x_221515 +\n                                           x_221520;\n                                    double defunc_1_op_res_221526 = x_221516 +\n                                           x_221521;\n                                    double defunc_1_op_res_221527 = x_221517 +\n                                           x_221522;\n                                    double defunc_1_op_res_221528 = x_221518 +\n                                           x_221523;\n                                    \n                                    x_221514 = defunc_1_op_res_221524;\n                                    x_221515 = defunc_1_op_res_221525;\n                                    x_221516 = defunc_1_op_res_221526;\n                                    x_221517 = defunc_1_op_res_221527;\n                                    x_221518 = defunc_1_op_res_221528;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235383, skip_threads_235418)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235419) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_2",
            "35385)[sext_i32_i64(local_tid_235381)] =\n                                    x_221514;\n                                x_221519 = x_221514;\n                                ((volatile __local\n                                  double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)] =\n                                    x_221515;\n                                x_221520 = x_221515;\n                                ((volatile __local\n                                  double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)] =\n                                    x_221516;\n                                x_221521 = x_221516;\n                                ((volatile __local\n                                  double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)] =\n                                    x_221517;\n                                x_221522 = x_221517;\n                                ((volatile __local\n                                  double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)] =\n                                    x_221518;\n                                x_221523 = x_221518;\n                            }\n                        }\n                        if (sle32(wave_sizze_235383, skip_threads_235418)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235418 *= 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_235381 - squot32(local_tid_235381, 32) *\n                         32) == 31 && ltid_in_bounds_235417) {\n                        ((volatile __local\n                          double *) red_arr_mem_235385)[sext_i32_i64(squot32(local_tid_235381,\n                                                                             32))] =\n                            x_221514;\n                     ",
            "   ((volatile __local\n                          double *) red_arr_mem_235387)[sext_i32_i64(squot32(local_tid_235381,\n                                                                             32))] =\n                            x_221515;\n                        ((volatile __local\n                          double *) red_arr_mem_235389)[sext_i32_i64(squot32(local_tid_235381,\n                                                                             32))] =\n                            x_221516;\n                        ((volatile __local\n                          double *) red_arr_mem_235391)[sext_i32_i64(squot32(local_tid_235381,\n                                                                             32))] =\n                            x_221517;\n                        ((volatile __local\n                          double *) red_arr_mem_235393)[sext_i32_i64(squot32(local_tid_235381,\n                                                                             32))] =\n                            x_221518;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235421;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235381, 32) == 0 &&\n                            ltid_in_bounds_235417) {\n                            x_235407 = ((volatile __local\n                                         double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)];\n                            x_235408 = ((volatile __local\n                                         double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)];\n                            x_235409 = ((volatile __local\n                                         double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)];\n                          ",
            "  x_235410 = ((volatile __local\n                                         double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)];\n                            x_235411 = ((volatile __local\n                                         double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)];\n                            if ((local_tid_235381 - squot32(local_tid_235381,\n                                                            32) * 32) == 0) {\n                                x_235402 = x_235407;\n                                x_235403 = x_235408;\n                                x_235404 = x_235409;\n                                x_235405 = x_235410;\n                                x_235406 = x_235411;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235421 = 1;\n                        while (slt32(skip_threads_235421, 32)) {\n                            bool thread_active_235422 =\n                                 sle32(skip_threads_235421, local_tid_235381 -\n                                       squot32(local_tid_235381, 32) * 32) &&\n                                 (squot32(local_tid_235381, 32) == 0 &&\n                                  ltid_in_bounds_235417);\n                            \n                            if (thread_active_235422) {\n                                // read operands\n                                {\n                                    x_235402 = ((volatile __local\n                                                 double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381) -\n                                                                               sext_i32_i64(skip_threads_235421)];\n                                    x_235403 = ((volatile __local\n                                                 double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381) -\n                 ",
            "                                                              sext_i32_i64(skip_threads_235421)];\n                                    x_235404 = ((volatile __local\n                                                 double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381) -\n                                                                               sext_i32_i64(skip_threads_235421)];\n                                    x_235405 = ((volatile __local\n                                                 double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381) -\n                                                                               sext_i32_i64(skip_threads_235421)];\n                                    x_235406 = ((volatile __local\n                                                 double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381) -\n                                                                               sext_i32_i64(skip_threads_235421)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235423 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235381 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_235381 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235381 -\n                                                         skip_threads_235421) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235422 && inactive_235423) {\n                                    x_235402 = x_235407;\n                                    x_235403 = x_235408;\n                                    x_235404 = x_235409;\n                                    ",
            "x_235405 = x_235410;\n                                    x_235406 = x_235411;\n                                }\n                                if (thread_active_235422) {\n                                    if (!inactive_235423) {\n                                        double defunc_1_op_res_235412 =\n                                               x_235402 + x_235407;\n                                        double defunc_1_op_res_235413 =\n                                               x_235403 + x_235408;\n                                        double defunc_1_op_res_235414 =\n                                               x_235404 + x_235409;\n                                        double defunc_1_op_res_235415 =\n                                               x_235405 + x_235410;\n                                        double defunc_1_op_res_235416 =\n                                               x_235406 + x_235411;\n                                        \n                                        x_235402 = defunc_1_op_res_235412;\n                                        x_235403 = defunc_1_op_res_235413;\n                                        x_235404 = defunc_1_op_res_235414;\n                                        x_235405 = defunc_1_op_res_235415;\n                                        x_235406 = defunc_1_op_res_235416;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235383, skip_threads_235421)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235422) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)] =\n                                        x_235402;\n                                ",
            "    x_235407 = x_235402;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)] =\n                                        x_235403;\n                                    x_235408 = x_235403;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)] =\n                                        x_235404;\n                                    x_235409 = x_235404;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)] =\n                                        x_235405;\n                                    x_235410 = x_235405;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)] =\n                                        x_235406;\n                                    x_235411 = x_235406;\n                                }\n                            }\n                            if (sle32(wave_sizze_235383, skip_threads_235421)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235421 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235424 = squot32(local_tid_235381, 32) == 0 ||\n                     !ltid_in_bounds_235417;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235424) {\n                            x_221519 = x_221514;\n                            x_221520 = x_221515;\n                            x_221521 = x_221516;\n                     ",
            "       x_221522 = x_221517;\n                            x_221523 = x_221518;\n                            x_221514 = ((__local\n                                         double *) red_arr_mem_235385)[sext_i32_i64(squot32(local_tid_235381,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221515 = ((__local\n                                         double *) red_arr_mem_235387)[sext_i32_i64(squot32(local_tid_235381,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221516 = ((__local\n                                         double *) red_arr_mem_235389)[sext_i32_i64(squot32(local_tid_235381,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221517 = ((__local\n                                         double *) red_arr_mem_235391)[sext_i32_i64(squot32(local_tid_235381,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221518 = ((__local\n                                         double *) red_arr_mem_235393)[sext_i32_i64(squot32(local_tid_235381,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235425 =\n                             slt64(srem64(sext_i32",
            "_i64(local_tid_235381),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235381) -\n                                   sext_i32_i64(squot32(local_tid_235381, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235424) {\n                            if (inactive_235425) {\n                                x_221514 = x_221519;\n                                x_221515 = x_221520;\n                                x_221516 = x_221521;\n                                x_221517 = x_221522;\n                                x_221518 = x_221523;\n                            }\n                        }\n                        if (!no_carry_in_235424) {\n                            if (!inactive_235425) {\n                                double defunc_1_op_res_221524 = x_221514 +\n                                       x_221519;\n                                double defunc_1_op_res_221525 = x_221515 +\n                                       x_221520;\n                                double defunc_1_op_res_221526 = x_221516 +\n                                       x_221521;\n                                double defunc_1_op_res_221527 = x_221517 +\n                                       x_221522;\n                                double defunc_1_op_res_221528 = x_221518 +\n                                       x_221523;\n                                \n                                x_221514 = defunc_1_op_res_221524;\n                                x_221515 = defunc_1_op_res_221525;\n                                x_221516 = defunc_1_op_res_221526;\n                                x_221517 = defunc_1_op_res_221527;\n                                x_221518 = defunc_1_op_res_221528;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235424",
            ") {\n                            ((__local\n                              double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)] =\n                                x_221514;\n                            ((__local\n                              double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)] =\n                                x_221515;\n                            ((__local\n                              double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)] =\n                                x_221516;\n                            ((__local\n                              double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)] =\n                                x_221517;\n                            ((__local\n                              double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)] =\n                                x_221518;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235381, 32) == 0 &&\n                        ltid_in_bounds_235417) {\n                        ((__local\n                          double *) red_arr_mem_235385)[sext_i32_i64(local_tid_235381)] =\n                            x_221519;\n                        ((__local\n                          double *) red_arr_mem_235387)[sext_i32_i64(local_tid_235381)] =\n                            x_221520;\n                        ((__local\n                          double *) red_arr_mem_235389)[sext_i32_i64(local_tid_235381)] =\n                            x_221521;\n                        ((__local\n                          double *) red_arr_mem_235391)[sext_i32_i64(local_tid_235381)] =\n                            x_221522;\n                        ((__local\n                          double *) red_arr_mem_235393)[sext_i32_i64(local_tid_235381)] =\n                            x_221523;\n                 ",
            "   }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235397) *\n                      squot64(segred_group_sizze_221502,\n                              segment_sizze_nonzzero_235378) +\n                      sext_i32_i64(local_tid_235381), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235381),\n                                             squot64(segred_group_sizze_221502,\n                                                     segment_sizze_nonzzero_235378))) {\n                double tmp_235426;\n                \n                tmp_235426 = ((__local\n                               double *) red_arr_mem_235385)[(sext_i32_i64(local_tid_235381) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235378 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230891)[squot64(sext_i32_i64(virt_group_id_235397) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235378) +\n                                                sext_i32_i64(local_tid_235381),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235397) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235378) +\n                                         sext_i32_i64(local_tid_235381) -\n                                         squot64(sext_i32_i64(virt_group_id_235397) *\n                                             ",
            "    squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235378) +\n                                                 sext_i32_i64(local_tid_235381),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235426;\n                \n                double tmp_235427;\n                \n                tmp_235427 = ((__local\n                               double *) red_arr_mem_235387)[(sext_i32_i64(local_tid_235381) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235378 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230895)[squot64(sext_i32_i64(virt_group_id_235397) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235378) +\n                                                sext_i32_i64(local_tid_235381),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235397) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235378) +\n                                         sext_i32_i64(local_tid_235381) -\n                                         squot64(sext_i32_i64(virt_group_id_235397) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235378) +\n                                                 sext_i32_i64(local_tid_235381),\n                                                 l_n_m_203733) *\n                                         l_n_m_2",
            "03733)] = tmp_235427;\n                \n                double tmp_235428;\n                \n                tmp_235428 = ((__local\n                               double *) red_arr_mem_235389)[(sext_i32_i64(local_tid_235381) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235378 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230899)[squot64(sext_i32_i64(virt_group_id_235397) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235378) +\n                                                sext_i32_i64(local_tid_235381),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235397) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235378) +\n                                         sext_i32_i64(local_tid_235381) -\n                                         squot64(sext_i32_i64(virt_group_id_235397) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235378) +\n                                                 sext_i32_i64(local_tid_235381),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235428;\n                \n                double tmp_235429;\n                \n                tmp_235429 = ((__local\n                               double *) red_arr_mem_235391)[(sext_i32_i64(local_tid_235381) +\n                                                              (int64_t) 1) *\n                     ",
            "                                        segment_sizze_nonzzero_235378 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230903)[squot64(sext_i32_i64(virt_group_id_235397) *\n                                                squot64(segred_group_sizze_221502,\n                                                        segment_sizze_nonzzero_235378) +\n                                                sext_i32_i64(local_tid_235381),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235397) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235378) +\n                                         sext_i32_i64(local_tid_235381) -\n                                         squot64(sext_i32_i64(virt_group_id_235397) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235378) +\n                                                 sext_i32_i64(local_tid_235381),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235429;\n                \n                double tmp_235430;\n                \n                tmp_235430 = ((__local\n                               double *) red_arr_mem_235393)[(sext_i32_i64(local_tid_235381) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235378 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230907)[squot64(sext_i32_i64(virt_group_id_235397) *\n                                                squot64(segred_g",
            "roup_sizze_221502,\n                                                        segment_sizze_nonzzero_235378) +\n                                                sext_i32_i64(local_tid_235381),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235397) *\n                                         squot64(segred_group_sizze_221502,\n                                                 segment_sizze_nonzzero_235378) +\n                                         sext_i32_i64(local_tid_235381) -\n                                         squot64(sext_i32_i64(virt_group_id_235397) *\n                                                 squot64(segred_group_sizze_221502,\n                                                         segment_sizze_nonzzero_235378) +\n                                                 sext_i32_i64(local_tid_235381),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235430;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221502\n}\n__kernel void mainzisegred_small_221611(__global int *global_failure,\n                                        uint red_arr_mem_235525_backing_offset_0,\n                                        uint red_arr_mem_235523_backing_offset_1,\n                                        int64_t n_203572, int64_t q_l_203577,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t l_n_m_203733, int64_t i_203760,\n                                        int64_t num_groups_221604,\n                                        int64_t ctx_param_ext_229596,\n                                        int64_t ctx_param_ext_229597,\n                 ",
            "                       int64_t ctx_param_ext_229599,\n                                        int64_t segment_sizze_nonzzero_235516,\n                                        __global unsigned char *ext_mem_229519,\n                                        __global unsigned char *ext_mem_229520,\n                                        __global\n                                        unsigned char *mem_param_229601,\n                                        __global unsigned char *mem_230659,\n                                        __global unsigned char *mem_230912,\n                                        __global unsigned char *mem_230916,\n                                        __global unsigned char *mem_230920,\n                                        __global unsigned char *mem_230924,\n                                        __global unsigned char *mem_230928,\n                                        __global unsigned char *mem_230933,\n                                        __global unsigned char *mem_230937)\n{\n    #define segred_group_sizze_221603 (mainzisegred_group_sizze_220973)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235525_backing_1 =\n                           &shared_mem[red_arr_mem_235525_backing_offset_0];\n    volatile unsigned char *red_arr_mem_235523_backing_0 =\n                           &shared_mem[red_arr_mem_235523_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235518;\n    int32_t local_tid_235519;\n    int64_t group_sizze_235522;\n    int32_t wave_sizze_235521;\n    int32_t group_tid_235520;\n    \n    global_tid_235518 = get_global_id(0);\n    local_tid_235519 = get_local_id(0);\n    group_sizze_235522 = get_local_size(0);\n    wave_sizze_235521 = LOCKSTEP_WIDTH;\n    group_tid_235520 = get_group_id(0);\n    \n    int32_t phys_tid_221611 = global_tid_235518;\n    __local unsigned char *red_arr_mem_235523;\n    \n    red_ar",
            "r_mem_235523 = (__local unsigned char *) red_arr_mem_235523_backing_0;\n    \n    __local unsigned char *red_arr_mem_235525;\n    \n    red_arr_mem_235525 = (__local unsigned char *) red_arr_mem_235525_backing_1;\n    \n    int32_t phys_group_id_235527;\n    \n    phys_group_id_235527 = get_group_id(0);\n    for (int32_t i_235528 = 0; i_235528 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * l_n_m_203733,\n                                          squot64(segred_group_sizze_221603,\n                                                  segment_sizze_nonzzero_235516))) -\n                   phys_group_id_235527, sext_i64_i32(num_groups_221604));\n         i_235528++) {\n        int32_t virt_group_id_235529 = phys_group_id_235527 + i_235528 *\n                sext_i64_i32(num_groups_221604);\n        int64_t slice_235530 = l_n_m_203733;\n        int64_t slice_235531 = partition_sizze_203667 * slice_235530;\n        int64_t gtid_221608 = squot64(squot64(sext_i32_i64(local_tid_235519),\n                                              segment_sizze_nonzzero_235516) +\n                                      sext_i32_i64(virt_group_id_235529) *\n                                      squot64(segred_group_sizze_221603,\n                                              segment_sizze_nonzzero_235516),\n                                      slice_235530);\n        int64_t remnant_235532 = squot64(sext_i32_i64(local_tid_235519),\n                                         segment_sizze_nonzzero_235516) +\n                sext_i32_i64(virt_group_id_235529) *\n                squot64(segred_group_sizze_221603,\n                        segment_sizze_nonzzero_235516) - gtid_221608 *\n                slice_235530;\n        int64_t gtid_221609 = remnant_235532;\n        int64_t remnant_235533 = remnant_235532 - gtid_221609;\n        int64_t gtid_221610 = srem64(sext_i32_i64(local_tid_235519),\n                                     q_l_203577);\n        \n        // apply map function if in bounds\n        {\n     ",
            "       if (slt64((int64_t) 0, q_l_203577) && ((slt64(gtid_221608,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_221609,\n                                                          l_n_m_203733)) &&\n                                                   slt64(sext_i32_i64(local_tid_235519),\n                                                         q_l_203577 *\n                                                         squot64(segred_group_sizze_221603,\n                                                                 segment_sizze_nonzzero_235516)))) {\n                int64_t x_221628;\n                \n                x_221628 = ((__global int64_t *) ext_mem_229520)[gtid_221608 *\n                                                                 l_n_m_203733 +\n                                                                 gtid_221609];\n                \n                double x_221629;\n                \n                x_221629 = ((__global double *) ext_mem_229519)[gtid_221608 *\n                                                                l_n_m_203733 +\n                                                                gtid_221609];\n                \n                int64_t binop_y_228795 = mul64(jump_t_203582, gtid_221609);\n                int64_t binop_y_228796 = smin64(i_203760, binop_y_228795);\n                int64_t index_primexp_228797 = add64((int64_t) 1,\n                                                     binop_y_228796);\n                double a12_221631;\n                \n                a12_221631 = ((__global double *) mem_230912)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b12_221632;\n                \n                b12_221632 = ((__global double *) mem_230916)[gtid_221608 *\n                             ",
            "                                 l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double c12_221633;\n                \n                c12_221633 = ((__global double *) mem_230920)[gtid_221608 *\n                                                              l_n_m_203733 +\n                                                              gtid_221609];\n                \n                double b2_221634;\n                \n                b2_221634 = ((__global double *) mem_230924)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n                \n                double c2_221635;\n                \n                c2_221635 = ((__global double *) mem_230928)[gtid_221608 *\n                                                             l_n_m_203733 +\n                                                             gtid_221609];\n                \n                bool cond_221637 = sle64(n_203572, gtid_221610);\n                int64_t defunc_0_f_res_221638;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221638 = (int64_t) 0;\n                } else {\n                    int64_t i_221639 = add64(gtid_221610, x_221628);\n                    int64_t defunc_1_add_res_221640 = add64((int64_t) 1,\n                                                            i_221639);\n                    \n                    defunc_0_f_res_221638 = defunc_1_add_res_221640;\n                }\n                \n                double defunc_0_f_res_221641;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221641 = 0.0;\n                } else {\n                    int64_t i_221642 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221643;\n                    \n                    defunc_0_add_arg_221643 = ((__global\n                  ",
            "                              double *) mem_param_229601)[ctx_param_ext_229596 +\n                                                                            (gtid_221608 *\n                                                                             ctx_param_ext_229597 +\n                                                                             i_221642 *\n                                                                             ctx_param_ext_229599)];\n                    defunc_0_f_res_221641 = defunc_0_add_arg_221643;\n                }\n                \n                int64_t binop_p_221644 = sub64(defunc_0_f_res_221638,\n                                               index_primexp_228797);\n                double defunc_0_f_res_221645 = sitofp_i64_f64(binop_p_221644);\n                double abs_res_221646 = fabs(defunc_0_f_res_221645);\n                double tmp1_221647 = abs_res_221646 / x_221629;\n                double x_221648 = tmp1_221647 * tmp1_221647;\n                double y_221649 = tmp1_221647 * x_221648;\n                double tmp2_221650 = 1.0 - y_221649;\n                double x_221651 = tmp2_221650 * tmp2_221650;\n                double tmp3_221652 = tmp2_221650 * x_221651;\n                double tmp4_221653 = defunc_0_f_res_221641 * tmp3_221652;\n                double defunc_1_f_res_221654 = defunc_0_f_res_221645 *\n                       tmp4_221653;\n                double defunc_1_f_res_221655 = defunc_0_f_res_221645 *\n                       defunc_1_f_res_221654;\n                double defunc_0_f_res_221656;\n                \n                if (cond_221637) {\n                    defunc_0_f_res_221656 = 0.0;\n                } else {\n                    int64_t i_221657 = add64(gtid_221610, x_221628);\n                    double defunc_0_add_arg_221658;\n                    \n                    defunc_0_add_arg_221658 = ((__global\n                                                double *) mem_230659)[gtid_221608 *\n                                    ",
            "                                  n_203572 +\n                                                                      i_221657];\n                    defunc_0_f_res_221656 = defunc_0_add_arg_221658;\n                }\n                \n                double x_221659 = a12_221631 * tmp4_221653;\n                double y_221660 = b12_221632 * defunc_1_f_res_221654;\n                double x_221661 = x_221659 + y_221660;\n                double y_221662 = c12_221633 * defunc_1_f_res_221655;\n                double x_221663 = x_221661 + y_221662;\n                double defunc_9_fit_fun_res_221664 = defunc_0_f_res_221656 *\n                       x_221663;\n                double x_221665 = b12_221632 * tmp4_221653;\n                double y_221666 = b2_221634 * defunc_1_f_res_221654;\n                double x_221667 = x_221665 + y_221666;\n                double y_221668 = c2_221635 * defunc_1_f_res_221655;\n                double x_221669 = x_221667 + y_221668;\n                double defunc_9_slope_fun_res_221670 = defunc_0_f_res_221656 *\n                       x_221669;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)] =\n                        defunc_9_fit_fun_res_221664;\n                    ((__local\n                      double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)] =\n                        defunc_9_slope_fun_res_221670;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203577)) {\n            // perform segmented sca",
            "n to imitate reduction\n            {\n                double x_221612;\n                double x_221613;\n                double x_221614;\n                double x_221615;\n                double x_235534;\n                double x_235535;\n                double x_235536;\n                double x_235537;\n                bool ltid_in_bounds_235540 =\n                     slt64(sext_i32_i64(local_tid_235519), q_l_203577 *\n                           squot64(segred_group_sizze_221603,\n                                   segment_sizze_nonzzero_235516));\n                int32_t skip_threads_235541;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235540) {\n                        x_221614 = ((volatile __local\n                                     double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)];\n                        x_221615 = ((volatile __local\n                                     double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)];\n                        if ((local_tid_235519 - squot32(local_tid_235519, 32) *\n                             32) == 0) {\n                            x_221612 = x_221614;\n                            x_221613 = x_221615;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235541 = 1;\n                    while (slt32(skip_threads_235541, 32)) {\n                        bool thread_active_235542 = sle32(skip_threads_235541,\n                                                          local_tid_235519 -\n                                                          squot32(local_tid_235519,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235540;\n                        \n                        if (thread_active_235542) {\n                            // read operands\n ",
            "                           {\n                                x_221612 = ((volatile __local\n                                             double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519) -\n                                                                           sext_i32_i64(skip_threads_235541)];\n                                x_221613 = ((volatile __local\n                                             double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519) -\n                                                                           sext_i32_i64(skip_threads_235541)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235543 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235519),\n                                              q_l_203577),\n                                       sext_i32_i64(local_tid_235519) -\n                                       sext_i32_i64(local_tid_235519 -\n                                       skip_threads_235541));\n                            \n                            if (thread_active_235542 && inactive_235543) {\n                                x_221612 = x_221614;\n                                x_221613 = x_221615;\n                            }\n                            if (thread_active_235542) {\n                                if (!inactive_235543) {\n                                    double defunc_1_op_res_221616 = x_221612 +\n                                           x_221614;\n                                    double defunc_1_op_res_221617 = x_221613 +\n                                           x_221615;\n                                    \n                                    x_221612 = defunc_1_op_res_221616;\n                                    x_221613 = defunc_1_op_res_221617;\n                                }\n                            }\n                        }\n    ",
            "                    if (sle32(wave_sizze_235521, skip_threads_235541)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235542) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)] =\n                                    x_221612;\n                                x_221614 = x_221612;\n                                ((volatile __local\n                                  double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)] =\n                                    x_221613;\n                                x_221615 = x_221613;\n                            }\n                        }\n                        if (sle32(wave_sizze_235521, skip_threads_235541)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235541 *= 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_235519 - squot32(local_tid_235519, 32) *\n                         32) == 31 && ltid_in_bounds_235540) {\n                        ((volatile __local\n                          double *) red_arr_mem_235523)[sext_i32_i64(squot32(local_tid_235519,\n                                                                             32))] =\n                            x_221612;\n                        ((volatile __local\n                          double *) red_arr_mem_235525)[sext_i32_i64(squot32(local_tid_235519,\n                                                                             32))] =\n                            x_221613;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the",
            " first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235544;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235519, 32) == 0 &&\n                            ltid_in_bounds_235540) {\n                            x_235536 = ((volatile __local\n                                         double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)];\n                            x_235537 = ((volatile __local\n                                         double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)];\n                            if ((local_tid_235519 - squot32(local_tid_235519,\n                                                            32) * 32) == 0) {\n                                x_235534 = x_235536;\n                                x_235535 = x_235537;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235544 = 1;\n                        while (slt32(skip_threads_235544, 32)) {\n                            bool thread_active_235545 =\n                                 sle32(skip_threads_235544, local_tid_235519 -\n                                       squot32(local_tid_235519, 32) * 32) &&\n                                 (squot32(local_tid_235519, 32) == 0 &&\n                                  ltid_in_bounds_235540);\n                            \n                            if (thread_active_235545) {\n                                // read operands\n                                {\n                                    x_235534 = ((volatile __local\n                                                 double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519) -\n                                                                               sext_i32_i64",
            "(skip_threads_235544)];\n                                    x_235535 = ((volatile __local\n                                                 double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519) -\n                                                                               sext_i32_i64(skip_threads_235544)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235546 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235519 *\n                                                  32 + 32 - 1), q_l_203577),\n                                           sext_i32_i64(local_tid_235519 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235519 -\n                                                         skip_threads_235544) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235545 && inactive_235546) {\n                                    x_235534 = x_235536;\n                                    x_235535 = x_235537;\n                                }\n                                if (thread_active_235545) {\n                                    if (!inactive_235546) {\n                                        double defunc_1_op_res_235538 =\n                                               x_235534 + x_235536;\n                                        double defunc_1_op_res_235539 =\n                                               x_235535 + x_235537;\n                                        \n                                        x_235534 = defunc_1_op_res_235538;\n                                        x_235535 = defunc_1_op_res_235539;\n                                    }\n                                }\n                            }\n                          ",
            "  if (sle32(wave_sizze_235521, skip_threads_235544)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235545) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)] =\n                                        x_235534;\n                                    x_235536 = x_235534;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)] =\n                                        x_235535;\n                                    x_235537 = x_235535;\n                                }\n                            }\n                            if (sle32(wave_sizze_235521, skip_threads_235544)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235544 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235547 = squot32(local_tid_235519, 32) == 0 ||\n                     !ltid_in_bounds_235540;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235547) {\n                            x_221614 = x_221612;\n                            x_221615 = x_221613;\n                            x_221612 = ((__local\n                                         double *) red_arr_mem_235523)[sext_i32_i64(squot32(local_tid_235519,\n                                                                                            32)) -\n                                                                       (int64_t)",
            " 1];\n                            x_221613 = ((__local\n                                         double *) red_arr_mem_235525)[sext_i32_i64(squot32(local_tid_235519,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235548 =\n                             slt64(srem64(sext_i32_i64(local_tid_235519),\n                                          q_l_203577),\n                                   sext_i32_i64(local_tid_235519) -\n                                   sext_i32_i64(squot32(local_tid_235519, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235547) {\n                            if (inactive_235548) {\n                                x_221612 = x_221614;\n                                x_221613 = x_221615;\n                            }\n                        }\n                        if (!no_carry_in_235547) {\n                            if (!inactive_235548) {\n                                double defunc_1_op_res_221616 = x_221612 +\n                                       x_221614;\n                                double defunc_1_op_res_221617 = x_221613 +\n                                       x_221615;\n                                \n                                x_221612 = defunc_1_op_res_221616;\n                                x_221613 = defunc_1_op_res_221617;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235547) {\n                            ((__local\n                              double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)] =\n                                x_221612",
            ";\n                            ((__local\n                              double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)] =\n                                x_221613;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235519, 32) == 0 &&\n                        ltid_in_bounds_235540) {\n                        ((__local\n                          double *) red_arr_mem_235523)[sext_i32_i64(local_tid_235519)] =\n                            x_221614;\n                        ((__local\n                          double *) red_arr_mem_235525)[sext_i32_i64(local_tid_235519)] =\n                            x_221615;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235529) *\n                      squot64(segred_group_sizze_221603,\n                              segment_sizze_nonzzero_235516) +\n                      sext_i32_i64(local_tid_235519), partition_sizze_203667 *\n                      l_n_m_203733) && slt64(sext_i32_i64(local_tid_235519),\n                                             squot64(segred_group_sizze_221603,\n                                                     segment_sizze_nonzzero_235516))) {\n                double tmp_235549;\n                \n                tmp_235549 = ((__local\n                               double *) red_arr_mem_235523)[(sext_i32_i64(local_tid_235519) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235516 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230933)[s",
            "quot64(sext_i32_i64(virt_group_id_235529) *\n                                                squot64(segred_group_sizze_221603,\n                                                        segment_sizze_nonzzero_235516) +\n                                                sext_i32_i64(local_tid_235519),\n                                                l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235529) *\n                                         squot64(segred_group_sizze_221603,\n                                                 segment_sizze_nonzzero_235516) +\n                                         sext_i32_i64(local_tid_235519) -\n                                         squot64(sext_i32_i64(virt_group_id_235529) *\n                                                 squot64(segred_group_sizze_221603,\n                                                         segment_sizze_nonzzero_235516) +\n                                                 sext_i32_i64(local_tid_235519),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235549;\n                \n                double tmp_235550;\n                \n                tmp_235550 = ((__local\n                               double *) red_arr_mem_235525)[(sext_i32_i64(local_tid_235519) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235516 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230937)[squot64(sext_i32_i64(virt_group_id_235529) *\n                                                squot64(segred_group_sizze_221603,\n                                                        segment_sizze_nonzzero_235516) +\n                                                sext_i32_i64(local_tid_235519),\n                           ",
            "                     l_n_m_203733) * l_n_m_203733 +\n                                        (sext_i32_i64(virt_group_id_235529) *\n                                         squot64(segred_group_sizze_221603,\n                                                 segment_sizze_nonzzero_235516) +\n                                         sext_i32_i64(local_tid_235519) -\n                                         squot64(sext_i32_i64(virt_group_id_235529) *\n                                                 squot64(segred_group_sizze_221603,\n                                                         segment_sizze_nonzzero_235516) +\n                                                 sext_i32_i64(local_tid_235519),\n                                                 l_n_m_203733) *\n                                         l_n_m_203733)] = tmp_235550;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_221603\n}\n__kernel void mainzisegred_small_223287(__global int *global_failure,\n                                        uint red_arr_mem_235773_backing_offset_0,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_223281,\n                                        int64_t segment_sizze_nonzzero_235766,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsign",
            "ed char *mem_231121,\n                                        __global unsigned char *mem_231135)\n{\n    #define segred_group_sizze_223280 (mainzisegred_group_sizze_222884)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235773_backing_0 =\n                           &shared_mem[red_arr_mem_235773_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235768;\n    int32_t local_tid_235769;\n    int64_t group_sizze_235772;\n    int32_t wave_sizze_235771;\n    int32_t group_tid_235770;\n    \n    global_tid_235768 = get_global_id(0);\n    local_tid_235769 = get_local_id(0);\n    group_sizze_235772 = get_local_size(0);\n    wave_sizze_235771 = LOCKSTEP_WIDTH;\n    group_tid_235770 = get_group_id(0);\n    \n    int32_t phys_tid_223287 = global_tid_235768;\n    __local unsigned char *red_arr_mem_235773;\n    \n    red_arr_mem_235773 = (__local unsigned char *) red_arr_mem_235773_backing_0;\n    \n    int32_t phys_group_id_235775;\n    \n    phys_group_id_235775 = get_group_id(0);\n    for (int32_t i_235776 = 0; i_235776 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_223280,\n                                                  segment_sizze_nonzzero_235766))) -\n                   phys_group_id_235775, sext_i64_i32(num_groups_223281));\n         i_235776++) {\n        int32_t virt_group_id_235777 = phys_group_id_235775 + i_235776 *\n                sext_i64_i32(num_groups_223281);\n        int64_t slice_235778 = t_n_m_203740;\n        int64_t slice_235779 = partition_sizze_203667 * slice_235778;\n        int64_t gtid_223284 = squot64(squot64(sext_i32_i64(local_tid_235769),\n                                              segment_sizze_nonzzero_235766) +\n                                      sext_i32_i64(virt_group_id_235777) *\n                                      squot64(segr",
            "ed_group_sizze_223280,\n                                              segment_sizze_nonzzero_235766),\n                                      slice_235778);\n        int64_t remnant_235780 = squot64(sext_i32_i64(local_tid_235769),\n                                         segment_sizze_nonzzero_235766) +\n                sext_i32_i64(virt_group_id_235777) *\n                squot64(segred_group_sizze_223280,\n                        segment_sizze_nonzzero_235766) - gtid_223284 *\n                slice_235778;\n        int64_t gtid_223285 = remnant_235780;\n        int64_t remnant_235781 = remnant_235780 - gtid_223285;\n        int64_t gtid_223286 = srem64(sext_i32_i64(local_tid_235769),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_223284,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_223285,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_235769),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_223280,\n                                                                 segment_sizze_nonzzero_235766)))) {\n                int64_t x_223292;\n                \n                x_223292 = ((__global int64_t *) ext_mem_229304)[gtid_223284];\n                \n                int64_t x_223297;\n                \n                x_223297 = ((__global int64_t *) ext_mem_229569)[gtid_223284 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223285];\n                \n                double x_223298;\n                \n                x_223298 = ((__global double *",
            ") ext_mem_229568)[gtid_223284 *\n                                                                t_n_m_203740 +\n                                                                gtid_223285];\n                \n                int64_t binop_y_228750 = mul64(jump_t_203582, gtid_223285);\n                int64_t binop_y_228751 = smin64(i_203760, binop_y_228750);\n                int64_t index_primexp_228752 = add64((int64_t) 1,\n                                                     binop_y_228751);\n                bool cond_223301 = sle64(x_223292, gtid_223286);\n                int64_t defunc_0_f_res_223302;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223302 = (int64_t) 0;\n                } else {\n                    int64_t i_223303 = add64(gtid_223286, x_223297);\n                    int64_t defunc_0_add_arg_223304;\n                    \n                    defunc_0_add_arg_223304 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223284 *\n                                                                           n_203572 +\n                                                                           i_223303];\n                    \n                    int64_t defunc_1_add_res_223305 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223304);\n                    \n                    defunc_0_f_res_223302 = defunc_1_add_res_223305;\n                }\n                \n                double defunc_0_f_res_223306;\n                \n                if (cond_223301) {\n                    defunc_0_f_res_223306 = 0.0;\n                } else {\n                    int64_t i_223307 = add64(gtid_223286, x_223297);\n                    double defunc_0_add_arg_223308;\n                    \n                    defunc_0_add_arg_223308 = ((__global\n                                                double *) mem_231121)[gtid_223284 *\n                                        ",
            "                              n_203572 +\n                                                                      i_223307];\n                    defunc_0_f_res_223306 = defunc_0_add_arg_223308;\n                }\n                \n                int64_t binop_p_223309 = sub64(defunc_0_f_res_223302,\n                                               index_primexp_228752);\n                double defunc_0_f_res_223310 = sitofp_i64_f64(binop_p_223309);\n                double abs_res_223311 = fabs(defunc_0_f_res_223310);\n                double tmp1_223312 = abs_res_223311 / x_223298;\n                double x_223313 = tmp1_223312 * tmp1_223312;\n                double y_223314 = tmp1_223312 * x_223313;\n                double tmp2_223315 = 1.0 - y_223314;\n                double x_223316 = tmp2_223315 * tmp2_223315;\n                double tmp3_223317 = tmp2_223315 * x_223316;\n                double w_j_223318 = defunc_0_f_res_223306 * tmp3_223317;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)] =\n                        w_j_223318;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223288;\n                double x_223289;\n                double x_235782;\n                double x_235783;\n                bool ltid_in_bounds_235785 =\n                     slt64(sext_i32_i64(local_tid_235769), q_t_203576 *\n                           squot64(segred_group_sizze_223280,\n                                   segment_sizze_nonzzero_235766));\n                int32_t skip_t",
            "hreads_235786;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235785) {\n                        x_223289 = ((volatile __local\n                                     double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)];\n                        if ((local_tid_235769 - squot32(local_tid_235769, 32) *\n                             32) == 0) {\n                            x_223288 = x_223289;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235786 = 1;\n                    while (slt32(skip_threads_235786, 32)) {\n                        bool thread_active_235787 = sle32(skip_threads_235786,\n                                                          local_tid_235769 -\n                                                          squot32(local_tid_235769,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235785;\n                        \n                        if (thread_active_235787) {\n                            // read operands\n                            {\n                                x_223288 = ((volatile __local\n                                             double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769) -\n                                                                           sext_i32_i64(skip_threads_235786)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235788 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235769),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_235769) -\n                                       sext_i32_i64(local_tid_235769 -\n             ",
            "                          skip_threads_235786));\n                            \n                            if (thread_active_235787 && inactive_235788) {\n                                x_223288 = x_223289;\n                            }\n                            if (thread_active_235787) {\n                                if (!inactive_235788) {\n                                    double defunc_1_op_res_223290 = x_223288 +\n                                           x_223289;\n                                    \n                                    x_223288 = defunc_1_op_res_223290;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235771, skip_threads_235786)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235787) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)] =\n                                    x_223288;\n                                x_223289 = x_223288;\n                            }\n                        }\n                        if (sle32(wave_sizze_235771, skip_threads_235786)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235786 *= 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_235769 - squot32(local_tid_235769, 32) *\n                         32) == 31 && ltid_in_bounds_235785) {\n                        ((volatile __local\n                          double *) red_arr_mem_235773)[sext_i32_i64(squot32(local_tid_235769,\n                                                               ",
            "              32))] =\n                            x_223288;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235789;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235769, 32) == 0 &&\n                            ltid_in_bounds_235785) {\n                            x_235783 = ((volatile __local\n                                         double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)];\n                            if ((local_tid_235769 - squot32(local_tid_235769,\n                                                            32) * 32) == 0) {\n                                x_235782 = x_235783;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235789 = 1;\n                        while (slt32(skip_threads_235789, 32)) {\n                            bool thread_active_235790 =\n                                 sle32(skip_threads_235789, local_tid_235769 -\n                                       squot32(local_tid_235769, 32) * 32) &&\n                                 (squot32(local_tid_235769, 32) == 0 &&\n                                  ltid_in_bounds_235785);\n                            \n                            if (thread_active_235790) {\n                                // read operands\n                                {\n                                    x_235782 = ((volatile __local\n                                                 double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769) -\n                                                                               sext_i32_i64(skip_threads_235789)];\n                  ",
            "              }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235791 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235769 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_235769 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235769 -\n                                                         skip_threads_235789) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235790 && inactive_235791) {\n                                    x_235782 = x_235783;\n                                }\n                                if (thread_active_235790) {\n                                    if (!inactive_235791) {\n                                        double defunc_1_op_res_235784 =\n                                               x_235782 + x_235783;\n                                        \n                                        x_235782 = defunc_1_op_res_235784;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235771, skip_threads_235789)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235790) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)] =\n                                        x_235782;\n                                    x_235783 = x_235782;\n                                }\n                        ",
            "    }\n                            if (sle32(wave_sizze_235771, skip_threads_235789)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235789 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235792 = squot32(local_tid_235769, 32) == 0 ||\n                     !ltid_in_bounds_235785;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235792) {\n                            x_223289 = x_223288;\n                            x_223288 = ((__local\n                                         double *) red_arr_mem_235773)[sext_i32_i64(squot32(local_tid_235769,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235793 =\n                             slt64(srem64(sext_i32_i64(local_tid_235769),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_235769) -\n                                   sext_i32_i64(squot32(local_tid_235769, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235792) {\n                            if (inactive_235793) {\n                                x_223288 = x_223289;\n                            }\n                        }\n                        if (!no_carry_in_235792) {\n                            if (!inactive_235793) {\n                                double defunc_1_op_res_223290 = x_223288 +\n                     ",
            "                  x_223289;\n                                \n                                x_223288 = defunc_1_op_res_223290;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235792) {\n                            ((__local\n                              double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)] =\n                                x_223288;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235769, 32) == 0 &&\n                        ltid_in_bounds_235785) {\n                        ((__local\n                          double *) red_arr_mem_235773)[sext_i32_i64(local_tid_235769)] =\n                            x_223289;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235777) *\n                      squot64(segred_group_sizze_223280,\n                              segment_sizze_nonzzero_235766) +\n                      sext_i32_i64(local_tid_235769), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_235769),\n                                             squot64(segred_group_sizze_223280,\n                                                     segment_sizze_nonzzero_235766))) {\n                double tmp_235794;\n                \n                tmp_235794 = ((__local\n                               double *) red_arr_mem_235773)[(sext_i32_i64(local_tid_235769) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonz",
            "zero_235766 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231135)[squot64(sext_i32_i64(virt_group_id_235777) *\n                                                squot64(segred_group_sizze_223280,\n                                                        segment_sizze_nonzzero_235766) +\n                                                sext_i32_i64(local_tid_235769),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235777) *\n                                         squot64(segred_group_sizze_223280,\n                                                 segment_sizze_nonzzero_235766) +\n                                         sext_i32_i64(local_tid_235769) -\n                                         squot64(sext_i32_i64(virt_group_id_235777) *\n                                                 squot64(segred_group_sizze_223280,\n                                                         segment_sizze_nonzzero_235766) +\n                                                 sext_i32_i64(local_tid_235769),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235794;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223280\n}\n__kernel void mainzisegred_small_223339(__global int *global_failure,\n                                        uint red_arr_mem_235855_backing_offset_0,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        i",
            "nt64_t num_groups_223333,\n                                        int64_t segment_sizze_nonzzero_235848,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231121,\n                                        __global unsigned char *mem_231125,\n                                        __global unsigned char *mem_231140,\n                                        __global unsigned char *mem_231145)\n{\n    #define segred_group_sizze_223332 (mainzisegred_group_sizze_222814)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_235855_backing_0 =\n                           &shared_mem[red_arr_mem_235855_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235850;\n    int32_t local_tid_235851;\n    int64_t group_sizze_235854;\n    int32_t wave_sizze_235853;\n    int32_t group_tid_235852;\n    \n    global_tid_235850 = get_global_id(0);\n    local_tid_235851 = get_local_id(0);\n    group_sizze_235854 = get_local_size(0);\n    wave_sizze_235853 = LOCKSTEP_WIDTH;\n    group_tid_235852 = get_group_id(0);\n    \n    int32_t phys_tid_223339 = global_tid_235850;\n    __local unsigned char *red_arr_mem_235855;\n    \n    red_arr_mem_235855 = (__local unsigned char *) red_arr_mem_235855_backing_0;\n    \n    int32_t phys_group_id_235857;\n    \n    phys_group_id_235857 = get_group_id(0);\n    for (int32_t i_235858 = 0; i_235858 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_223332,\n                                                  segment_sizze_nonzze",
            "ro_235848))) -\n                   phys_group_id_235857, sext_i64_i32(num_groups_223333));\n         i_235858++) {\n        int32_t virt_group_id_235859 = phys_group_id_235857 + i_235858 *\n                sext_i64_i32(num_groups_223333);\n        int64_t slice_235860 = t_n_m_203740;\n        int64_t slice_235861 = partition_sizze_203667 * slice_235860;\n        int64_t gtid_223336 = squot64(squot64(sext_i32_i64(local_tid_235851),\n                                              segment_sizze_nonzzero_235848) +\n                                      sext_i32_i64(virt_group_id_235859) *\n                                      squot64(segred_group_sizze_223332,\n                                              segment_sizze_nonzzero_235848),\n                                      slice_235860);\n        int64_t remnant_235862 = squot64(sext_i32_i64(local_tid_235851),\n                                         segment_sizze_nonzzero_235848) +\n                sext_i32_i64(virt_group_id_235859) *\n                squot64(segred_group_sizze_223332,\n                        segment_sizze_nonzzero_235848) - gtid_223336 *\n                slice_235860;\n        int64_t gtid_223337 = remnant_235862;\n        int64_t remnant_235863 = remnant_235862 - gtid_223337;\n        int64_t gtid_223338 = srem64(sext_i32_i64(local_tid_235851),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_223336,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_223337,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_235851),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_223332,\n                  ",
            "                                               segment_sizze_nonzzero_235848)))) {\n                int64_t x_223344;\n                \n                x_223344 = ((__global int64_t *) ext_mem_229304)[gtid_223336];\n                \n                int64_t x_223351;\n                \n                x_223351 = ((__global int64_t *) ext_mem_229569)[gtid_223336 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_223337];\n                \n                double x_223352;\n                \n                x_223352 = ((__global double *) ext_mem_229568)[gtid_223336 *\n                                                                t_n_m_203740 +\n                                                                gtid_223337];\n                \n                int64_t binop_y_228745 = mul64(jump_t_203582, gtid_223337);\n                int64_t binop_y_228746 = smin64(i_203760, binop_y_228745);\n                int64_t index_primexp_228747 = add64((int64_t) 1,\n                                                     binop_y_228746);\n                double a0_223354;\n                \n                a0_223354 = ((__global double *) mem_231140)[gtid_223336 *\n                                                             t_n_m_203740 +\n                                                             gtid_223337];\n                \n                bool cond_223356 = sle64(x_223344, gtid_223338);\n                int64_t defunc_0_f_res_223357;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223357 = (int64_t) 0;\n                } else {\n                    int64_t i_223358 = add64(gtid_223338, x_223351);\n                    int64_t defunc_0_add_arg_223359;\n                    \n                    defunc_0_add_arg_223359 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_223336 *\n                                              ",
            "                             n_203572 +\n                                                                           i_223358];\n                    \n                    int64_t defunc_1_add_res_223360 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223359);\n                    \n                    defunc_0_f_res_223357 = defunc_1_add_res_223360;\n                }\n                \n                double defunc_0_f_res_223361;\n                \n                if (cond_223356) {\n                    defunc_0_f_res_223361 = 0.0;\n                } else {\n                    int64_t i_223362 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223363;\n                    \n                    defunc_0_add_arg_223363 = ((__global\n                                                double *) mem_231121)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223362];\n                    defunc_0_f_res_223361 = defunc_0_add_arg_223363;\n                }\n                \n                int64_t binop_p_223364 = sub64(defunc_0_f_res_223357,\n                                               index_primexp_228747);\n                double defunc_0_f_res_223365 = sitofp_i64_f64(binop_p_223364);\n                double abs_res_223366 = fabs(defunc_0_f_res_223365);\n                double tmp1_223367 = abs_res_223366 / x_223352;\n                double x_223368 = tmp1_223367 * tmp1_223367;\n                double y_223369 = tmp1_223367 * x_223368;\n                double tmp2_223370 = 1.0 - y_223369;\n                double x_223371 = tmp2_223370 * tmp2_223370;\n                double tmp3_223372 = tmp2_223370 * x_223371;\n                double tmp4_223373 = defunc_0_f_res_223361 * tmp3_223372;\n                double defunc_0_f_res_223374;\n                \n                if (cond_223356) {\n                    defunc_0_f",
            "_res_223374 = 0.0;\n                } else {\n                    int64_t i_223375 = add64(gtid_223338, x_223351);\n                    double defunc_0_add_arg_223376;\n                    \n                    defunc_0_add_arg_223376 = ((__global\n                                                double *) mem_231125)[gtid_223336 *\n                                                                      n_203572 +\n                                                                      i_223375];\n                    defunc_0_f_res_223374 = defunc_0_add_arg_223376;\n                }\n                \n                double x_223377 = a0_223354 * tmp4_223373;\n                double defunc_9_fit_fun_res_223378 = defunc_0_f_res_223374 *\n                       x_223377;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)] =\n                        defunc_9_fit_fun_res_223378;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223340;\n                double x_223341;\n                double x_235864;\n                double x_235865;\n                bool ltid_in_bounds_235867 =\n                     slt64(sext_i32_i64(local_tid_235851), q_t_203576 *\n                           squot64(segred_group_sizze_223332,\n                                   segment_sizze_nonzzero_235848));\n                int32_t skip_threads_235868;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235867) {\n                   ",
            "     x_223341 = ((volatile __local\n                                     double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)];\n                        if ((local_tid_235851 - squot32(local_tid_235851, 32) *\n                             32) == 0) {\n                            x_223340 = x_223341;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235868 = 1;\n                    while (slt32(skip_threads_235868, 32)) {\n                        bool thread_active_235869 = sle32(skip_threads_235868,\n                                                          local_tid_235851 -\n                                                          squot32(local_tid_235851,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235867;\n                        \n                        if (thread_active_235869) {\n                            // read operands\n                            {\n                                x_223340 = ((volatile __local\n                                             double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851) -\n                                                                           sext_i32_i64(skip_threads_235868)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235870 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235851),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_235851) -\n                                       sext_i32_i64(local_tid_235851 -\n                                       skip_threads_235868));\n                            \n                            if (thread_active_235869 && inactive_235870) {\n             ",
            "                   x_223340 = x_223341;\n                            }\n                            if (thread_active_235869) {\n                                if (!inactive_235870) {\n                                    double defunc_1_op_res_223342 = x_223340 +\n                                           x_223341;\n                                    \n                                    x_223340 = defunc_1_op_res_223342;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235853, skip_threads_235868)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235869) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)] =\n                                    x_223340;\n                                x_223341 = x_223340;\n                            }\n                        }\n                        if (sle32(wave_sizze_235853, skip_threads_235868)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235868 *= 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_235851 - squot32(local_tid_235851, 32) *\n                         32) == 31 && ltid_in_bounds_235867) {\n                        ((volatile __local\n                          double *) red_arr_mem_235855)[sext_i32_i64(squot32(local_tid_235851,\n                                                                             32))] =\n                            x_223340;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // s",
            "can the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235871;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235851, 32) == 0 &&\n                            ltid_in_bounds_235867) {\n                            x_235865 = ((volatile __local\n                                         double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)];\n                            if ((local_tid_235851 - squot32(local_tid_235851,\n                                                            32) * 32) == 0) {\n                                x_235864 = x_235865;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235871 = 1;\n                        while (slt32(skip_threads_235871, 32)) {\n                            bool thread_active_235872 =\n                                 sle32(skip_threads_235871, local_tid_235851 -\n                                       squot32(local_tid_235851, 32) * 32) &&\n                                 (squot32(local_tid_235851, 32) == 0 &&\n                                  ltid_in_bounds_235867);\n                            \n                            if (thread_active_235872) {\n                                // read operands\n                                {\n                                    x_235864 = ((volatile __local\n                                                 double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851) -\n                                                                               sext_i32_i64(skip_threads_235871)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inac",
            "tive_235873 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235851 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_235851 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235851 -\n                                                         skip_threads_235871) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235872 && inactive_235873) {\n                                    x_235864 = x_235865;\n                                }\n                                if (thread_active_235872) {\n                                    if (!inactive_235873) {\n                                        double defunc_1_op_res_235866 =\n                                               x_235864 + x_235865;\n                                        \n                                        x_235864 = defunc_1_op_res_235866;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235853, skip_threads_235871)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235872) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)] =\n                                        x_235864;\n                                    x_235865 = x_235864;\n                                }\n                            }\n                            if (sle32(wave_sizze_235853, skip_threads_235871)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                 ",
            "           }\n                            skip_threads_235871 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235874 = squot32(local_tid_235851, 32) == 0 ||\n                     !ltid_in_bounds_235867;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235874) {\n                            x_223341 = x_223340;\n                            x_223340 = ((__local\n                                         double *) red_arr_mem_235855)[sext_i32_i64(squot32(local_tid_235851,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235875 =\n                             slt64(srem64(sext_i32_i64(local_tid_235851),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_235851) -\n                                   sext_i32_i64(squot32(local_tid_235851, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235874) {\n                            if (inactive_235875) {\n                                x_223340 = x_223341;\n                            }\n                        }\n                        if (!no_carry_in_235874) {\n                            if (!inactive_235875) {\n                                double defunc_1_op_res_223342 = x_223340 +\n                                       x_223341;\n                                \n                                x_223340 = defunc_1_op_res_223342;\n                            }\n        ",
            "                }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235874) {\n                            ((__local\n                              double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)] =\n                                x_223340;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235851, 32) == 0 &&\n                        ltid_in_bounds_235867) {\n                        ((__local\n                          double *) red_arr_mem_235855)[sext_i32_i64(local_tid_235851)] =\n                            x_223341;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_235859) *\n                      squot64(segred_group_sizze_223332,\n                              segment_sizze_nonzzero_235848) +\n                      sext_i32_i64(local_tid_235851), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_235851),\n                                             squot64(segred_group_sizze_223332,\n                                                     segment_sizze_nonzzero_235848))) {\n                double tmp_235876;\n                \n                tmp_235876 = ((__local\n                               double *) red_arr_mem_235855)[(sext_i32_i64(local_tid_235851) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235848 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231145)[squot64(se",
            "xt_i32_i64(virt_group_id_235859) *\n                                                squot64(segred_group_sizze_223332,\n                                                        segment_sizze_nonzzero_235848) +\n                                                sext_i32_i64(local_tid_235851),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_235859) *\n                                         squot64(segred_group_sizze_223332,\n                                                 segment_sizze_nonzzero_235848) +\n                                         sext_i32_i64(local_tid_235851) -\n                                         squot64(sext_i32_i64(virt_group_id_235859) *\n                                                 squot64(segred_group_sizze_223332,\n                                                         segment_sizze_nonzzero_235848) +\n                                                 sext_i32_i64(local_tid_235851),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_235876;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_223332\n}\n__kernel void mainzisegred_small_224325(__global int *global_failure,\n                                        uint red_arr_mem_236008_backing_offset_0,\n                                        uint red_arr_mem_236006_backing_offset_1,\n                                        uint red_arr_mem_236004_backing_offset_2,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int",
            "64_t num_groups_224317,\n                                        int64_t segment_sizze_nonzzero_235997,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231277,\n                                        __global unsigned char *mem_231281,\n                                        __global unsigned char *mem_231285)\n{\n    #define segred_group_sizze_224316 (mainzisegred_group_sizze_223845)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236008_backing_2 =\n                           &shared_mem[red_arr_mem_236008_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236006_backing_1 =\n                           &shared_mem[red_arr_mem_236006_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236004_backing_0 =\n                           &shared_mem[red_arr_mem_236004_backing_offset_2];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235999;\n    int32_t local_tid_236000;\n    int64_t group_sizze_236003;\n    int32_t wave_sizze_236002;\n    int32_t group_tid_236001;\n    \n    global_tid_235999 = get_global_id(0);\n    local_tid_236000 = get_local_id(0);\n    group_sizze_236003 = get_local_size(0);\n    wave_sizze_236002 = LOCKSTEP_WIDTH;\n    group_tid_236001 = get_group_id(0);\n    \n    int32_t phys_tid_224325 = global_tid_235999;\n    __local unsigned char *red_arr_mem_236004;\n    \n    red_arr_mem_236004 = (__local unsigned char *) red_arr_mem_236004_backing_0;\n    \n    __local unsigned char *red_arr_mem_236006;\n    \n    red_arr_mem_236006 = (__loc",
            "al unsigned char *) red_arr_mem_236006_backing_1;\n    \n    __local unsigned char *red_arr_mem_236008;\n    \n    red_arr_mem_236008 = (__local unsigned char *) red_arr_mem_236008_backing_2;\n    \n    int32_t phys_group_id_236010;\n    \n    phys_group_id_236010 = get_group_id(0);\n    for (int32_t i_236011 = 0; i_236011 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_224316,\n                                                  segment_sizze_nonzzero_235997))) -\n                   phys_group_id_236010, sext_i64_i32(num_groups_224317));\n         i_236011++) {\n        int32_t virt_group_id_236012 = phys_group_id_236010 + i_236011 *\n                sext_i64_i32(num_groups_224317);\n        int64_t slice_236013 = t_n_m_203740;\n        int64_t slice_236014 = partition_sizze_203667 * slice_236013;\n        int64_t gtid_224322 = squot64(squot64(sext_i32_i64(local_tid_236000),\n                                              segment_sizze_nonzzero_235997) +\n                                      sext_i32_i64(virt_group_id_236012) *\n                                      squot64(segred_group_sizze_224316,\n                                              segment_sizze_nonzzero_235997),\n                                      slice_236013);\n        int64_t remnant_236015 = squot64(sext_i32_i64(local_tid_236000),\n                                         segment_sizze_nonzzero_235997) +\n                sext_i32_i64(virt_group_id_236012) *\n                squot64(segred_group_sizze_224316,\n                        segment_sizze_nonzzero_235997) - gtid_224322 *\n                slice_236013;\n        int64_t gtid_224323 = remnant_236015;\n        int64_t remnant_236016 = remnant_236015 - gtid_224323;\n        int64_t gtid_224324 = srem64(sext_i32_i64(local_tid_236000),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int",
            "64_t) 0, q_t_203576) && ((slt64(gtid_224322,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_224323,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_236000),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_224316,\n                                                                 segment_sizze_nonzzero_235997)))) {\n                int64_t x_224336;\n                \n                x_224336 = ((__global int64_t *) ext_mem_229304)[gtid_224322];\n                \n                int64_t x_224341;\n                \n                x_224341 = ((__global int64_t *) ext_mem_229569)[gtid_224322 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224323];\n                \n                double x_224342;\n                \n                x_224342 = ((__global double *) ext_mem_229568)[gtid_224322 *\n                                                                t_n_m_203740 +\n                                                                gtid_224323];\n                \n                int64_t binop_y_228760 = mul64(jump_t_203582, gtid_224323);\n                int64_t binop_y_228761 = smin64(i_203760, binop_y_228760);\n                int64_t index_primexp_228762 = add64((int64_t) 1,\n                                                     binop_y_228761);\n                bool cond_224345 = sle64(x_224336, gtid_224324);\n                int64_t defunc_0_f_res_224346;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224346 = (int64_t) 0;\n                } else {\n                    int64_t i_224347 = add64(gtid_224324, x_224341);\n              ",
            "      int64_t defunc_0_add_arg_224348;\n                    \n                    defunc_0_add_arg_224348 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224322 *\n                                                                           n_203572 +\n                                                                           i_224347];\n                    \n                    int64_t defunc_1_add_res_224349 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224348);\n                    \n                    defunc_0_f_res_224346 = defunc_1_add_res_224349;\n                }\n                \n                double defunc_0_f_res_224350;\n                \n                if (cond_224345) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224324, x_224341);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231259)[gtid_224322 *\n                                                                      n_203572 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                int64_t binop_p_224353 = sub64(defunc_0_f_res_224346,\n                                               index_primexp_228762);\n                double defunc_0_f_res_224354 = sitofp_i64_f64(binop_p_224353);\n                double abs_res_224355 = fabs(defunc_0_f_res_224354);\n                double tmp1_224356 = abs_res_224355 / x_224342;\n                double x_224357 = tmp1_224356 * tmp1_224356;\n                double y_224358 = tmp1_224356 * x_224357;\n                double tmp2_224359 = 1.0 - y_224358;\n                double x_224360 = tmp2_224359 * tmp2_224359;\n           ",
            "     double tmp3_224361 = tmp2_224359 * x_224360;\n                double w_j_224362 = defunc_0_f_res_224350 * tmp3_224361;\n                double xw_j_224363 = defunc_0_f_res_224354 * w_j_224362;\n                double x2w_j_224364 = defunc_0_f_res_224354 * xw_j_224363;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)] =\n                        w_j_224362;\n                    ((__local\n                      double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)] =\n                        xw_j_224363;\n                    ((__local\n                      double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)] =\n                        x2w_j_224364;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224326;\n                double x_224327;\n                double x_224328;\n                double x_224329;\n                double x_224330;\n                double x_224331;\n                double x_236017;\n                double x_236018;\n                double x_236019;\n                double x_236020;\n                double x_236021;\n                double x_236022;\n                bool ltid_in_bounds_236026 =\n                     slt64(sext_i32_i64(local_tid_236000), q_t_203576",
            " *\n                           squot64(segred_group_sizze_224316,\n                                   segment_sizze_nonzzero_235997));\n                int32_t skip_threads_236027;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236026) {\n                        x_224329 = ((volatile __local\n                                     double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)];\n                        x_224330 = ((volatile __local\n                                     double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)];\n                        x_224331 = ((volatile __local\n                                     double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)];\n                        if ((local_tid_236000 - squot32(local_tid_236000, 32) *\n                             32) == 0) {\n                            x_224326 = x_224329;\n                            x_224327 = x_224330;\n                            x_224328 = x_224331;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236027 = 1;\n                    while (slt32(skip_threads_236027, 32)) {\n                        bool thread_active_236028 = sle32(skip_threads_236027,\n                                                          local_tid_236000 -\n                                                          squot32(local_tid_236000,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236026;\n                        \n                        if (thread_active_236028) {\n                            // read operands\n                            {\n                                x_224326 = ((volatile __local\n                                             double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000) -\n             ",
            "                                                              sext_i32_i64(skip_threads_236027)];\n                                x_224327 = ((volatile __local\n                                             double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000) -\n                                                                           sext_i32_i64(skip_threads_236027)];\n                                x_224328 = ((volatile __local\n                                             double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000) -\n                                                                           sext_i32_i64(skip_threads_236027)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236029 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236000),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_236000) -\n                                       sext_i32_i64(local_tid_236000 -\n                                       skip_threads_236027));\n                            \n                            if (thread_active_236028 && inactive_236029) {\n                                x_224326 = x_224329;\n                                x_224327 = x_224330;\n                                x_224328 = x_224331;\n                            }\n                            if (thread_active_236028) {\n                                if (!inactive_236029) {\n                                    double defunc_1_op_res_224332 = x_224326 +\n                                           x_224329;\n                                    double defunc_1_op_res_224333 = x_224327 +\n                                           x_224330;\n                                    double defunc_1_op_res_224334 = x_224328 +\n                                           x_224331;\n                   ",
            "                 \n                                    x_224326 = defunc_1_op_res_224332;\n                                    x_224327 = defunc_1_op_res_224333;\n                                    x_224328 = defunc_1_op_res_224334;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236002, skip_threads_236027)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236028) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)] =\n                                    x_224326;\n                                x_224329 = x_224326;\n                                ((volatile __local\n                                  double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)] =\n                                    x_224327;\n                                x_224330 = x_224327;\n                                ((volatile __local\n                                  double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)] =\n                                    x_224328;\n                                x_224331 = x_224328;\n                            }\n                        }\n                        if (sle32(wave_sizze_236002, skip_threads_236027)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236027 *= 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_236000 - squot32(local_tid_236000, 32) *\n                         32) == 31 && ltid_in_bounds_236026) {\n                        ((volatile __local\n                   ",
            "       double *) red_arr_mem_236004)[sext_i32_i64(squot32(local_tid_236000,\n                                                                             32))] =\n                            x_224326;\n                        ((volatile __local\n                          double *) red_arr_mem_236006)[sext_i32_i64(squot32(local_tid_236000,\n                                                                             32))] =\n                            x_224327;\n                        ((volatile __local\n                          double *) red_arr_mem_236008)[sext_i32_i64(squot32(local_tid_236000,\n                                                                             32))] =\n                            x_224328;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236030;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236000, 32) == 0 &&\n                            ltid_in_bounds_236026) {\n                            x_236020 = ((volatile __local\n                                         double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)];\n                            x_236021 = ((volatile __local\n                                         double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)];\n                            x_236022 = ((volatile __local\n                                         double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)];\n                            if ((local_tid_236000 - squot32(local_tid_236000,\n                                                            32) * 32) == 0) {\n                                x_236017 = x_236020;\n                                x_236018 = x_236021;\n                                x_236019 = x_236022;\n             ",
            "               }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236030 = 1;\n                        while (slt32(skip_threads_236030, 32)) {\n                            bool thread_active_236031 =\n                                 sle32(skip_threads_236030, local_tid_236000 -\n                                       squot32(local_tid_236000, 32) * 32) &&\n                                 (squot32(local_tid_236000, 32) == 0 &&\n                                  ltid_in_bounds_236026);\n                            \n                            if (thread_active_236031) {\n                                // read operands\n                                {\n                                    x_236017 = ((volatile __local\n                                                 double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000) -\n                                                                               sext_i32_i64(skip_threads_236030)];\n                                    x_236018 = ((volatile __local\n                                                 double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000) -\n                                                                               sext_i32_i64(skip_threads_236030)];\n                                    x_236019 = ((volatile __local\n                                                 double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000) -\n                                                                               sext_i32_i64(skip_threads_236030)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236032 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236000 *\n                                                  32 + 32 - 1",
            "), q_t_203576),\n                                           sext_i32_i64(local_tid_236000 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236000 -\n                                                         skip_threads_236030) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236031 && inactive_236032) {\n                                    x_236017 = x_236020;\n                                    x_236018 = x_236021;\n                                    x_236019 = x_236022;\n                                }\n                                if (thread_active_236031) {\n                                    if (!inactive_236032) {\n                                        double defunc_1_op_res_236023 =\n                                               x_236017 + x_236020;\n                                        double defunc_1_op_res_236024 =\n                                               x_236018 + x_236021;\n                                        double defunc_1_op_res_236025 =\n                                               x_236019 + x_236022;\n                                        \n                                        x_236017 = defunc_1_op_res_236023;\n                                        x_236018 = defunc_1_op_res_236024;\n                                        x_236019 = defunc_1_op_res_236025;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236002, skip_threads_236030)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236031) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *",
            ") red_arr_mem_236004)[sext_i32_i64(local_tid_236000)] =\n                                        x_236017;\n                                    x_236020 = x_236017;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)] =\n                                        x_236018;\n                                    x_236021 = x_236018;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)] =\n                                        x_236019;\n                                    x_236022 = x_236019;\n                                }\n                            }\n                            if (sle32(wave_sizze_236002, skip_threads_236030)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236030 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236033 = squot32(local_tid_236000, 32) == 0 ||\n                     !ltid_in_bounds_236026;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236033) {\n                            x_224329 = x_224326;\n                            x_224330 = x_224327;\n                            x_224331 = x_224328;\n                            x_224326 = ((__local\n                                         double *) red_arr_mem_236004)[sext_i32_i64(squot32(local_tid_236000,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224327 = ((__local\n                   ",
            "                      double *) red_arr_mem_236006)[sext_i32_i64(squot32(local_tid_236000,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224328 = ((__local\n                                         double *) red_arr_mem_236008)[sext_i32_i64(squot32(local_tid_236000,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236034 =\n                             slt64(srem64(sext_i32_i64(local_tid_236000),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_236000) -\n                                   sext_i32_i64(squot32(local_tid_236000, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236033) {\n                            if (inactive_236034) {\n                                x_224326 = x_224329;\n                                x_224327 = x_224330;\n                                x_224328 = x_224331;\n                            }\n                        }\n                        if (!no_carry_in_236033) {\n                            if (!inactive_236034) {\n                                double defunc_1_op_res_224332 = x_224326 +\n                                       x_224329;\n                                double defunc_1_op_res_224333 = x_224327 +\n                                       x_224330;\n                                double defunc_1_op_res_224334 = x_224328 +\n                                       x_224331;\n                                \n                                x_224326 = defunc_1_",
            "op_res_224332;\n                                x_224327 = defunc_1_op_res_224333;\n                                x_224328 = defunc_1_op_res_224334;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236033) {\n                            ((__local\n                              double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)] =\n                                x_224326;\n                            ((__local\n                              double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)] =\n                                x_224327;\n                            ((__local\n                              double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)] =\n                                x_224328;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236000, 32) == 0 &&\n                        ltid_in_bounds_236026) {\n                        ((__local\n                          double *) red_arr_mem_236004)[sext_i32_i64(local_tid_236000)] =\n                            x_224329;\n                        ((__local\n                          double *) red_arr_mem_236006)[sext_i32_i64(local_tid_236000)] =\n                            x_224330;\n                        ((__local\n                          double *) red_arr_mem_236008)[sext_i32_i64(local_tid_236000)] =\n                            x_224331;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236012) *\n                      squot64(segred_group_sizze_224316,\n                              segmen",
            "t_sizze_nonzzero_235997) +\n                      sext_i32_i64(local_tid_236000), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_236000),\n                                             squot64(segred_group_sizze_224316,\n                                                     segment_sizze_nonzzero_235997))) {\n                double tmp_236035;\n                \n                tmp_236035 = ((__local\n                               double *) red_arr_mem_236004)[(sext_i32_i64(local_tid_236000) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235997 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231277)[squot64(sext_i32_i64(virt_group_id_236012) *\n                                                squot64(segred_group_sizze_224316,\n                                                        segment_sizze_nonzzero_235997) +\n                                                sext_i32_i64(local_tid_236000),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236012) *\n                                         squot64(segred_group_sizze_224316,\n                                                 segment_sizze_nonzzero_235997) +\n                                         sext_i32_i64(local_tid_236000) -\n                                         squot64(sext_i32_i64(virt_group_id_236012) *\n                                                 squot64(segred_group_sizze_224316,\n                                                         segment_sizze_nonzzero_235997) +\n                                                 sext_i32_i64(local_tid_236000),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = t",
            "mp_236035;\n                \n                double tmp_236036;\n                \n                tmp_236036 = ((__local\n                               double *) red_arr_mem_236006)[(sext_i32_i64(local_tid_236000) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235997 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231281)[squot64(sext_i32_i64(virt_group_id_236012) *\n                                                squot64(segred_group_sizze_224316,\n                                                        segment_sizze_nonzzero_235997) +\n                                                sext_i32_i64(local_tid_236000),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236012) *\n                                         squot64(segred_group_sizze_224316,\n                                                 segment_sizze_nonzzero_235997) +\n                                         sext_i32_i64(local_tid_236000) -\n                                         squot64(sext_i32_i64(virt_group_id_236012) *\n                                                 squot64(segred_group_sizze_224316,\n                                                         segment_sizze_nonzzero_235997) +\n                                                 sext_i32_i64(local_tid_236000),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236036;\n                \n                double tmp_236037;\n                \n                tmp_236037 = ((__local\n                               double *) red_arr_mem_236008)[(sext_i32_i64(local_tid_236000) +\n                                                              (int64_t) 1) *\n                                ",
            "                             segment_sizze_nonzzero_235997 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231285)[squot64(sext_i32_i64(virt_group_id_236012) *\n                                                squot64(segred_group_sizze_224316,\n                                                        segment_sizze_nonzzero_235997) +\n                                                sext_i32_i64(local_tid_236000),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236012) *\n                                         squot64(segred_group_sizze_224316,\n                                                 segment_sizze_nonzzero_235997) +\n                                         sext_i32_i64(local_tid_236000) -\n                                         squot64(sext_i32_i64(virt_group_id_236012) *\n                                                 squot64(segred_group_sizze_224316,\n                                                         segment_sizze_nonzzero_235997) +\n                                                 sext_i32_i64(local_tid_236000),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236037;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224316\n}\n__kernel void mainzisegred_small_224397(__global int *global_failure,\n                                        uint red_arr_mem_236116_backing_offset_0,\n                                        uint red_arr_mem_236114_backing_offset_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_",
            "203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_224390,\n                                        int64_t segment_sizze_nonzzero_236107,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231259,\n                                        __global unsigned char *mem_231263,\n                                        __global unsigned char *mem_231290,\n                                        __global unsigned char *mem_231294,\n                                        __global unsigned char *mem_231298,\n                                        __global unsigned char *mem_231303,\n                                        __global unsigned char *mem_231307)\n{\n    #define segred_group_sizze_224389 (mainzisegred_group_sizze_223748)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236116_backing_1 =\n                           &shared_mem[red_arr_mem_236116_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236114_backing_0 =\n                           &shared_mem[red_arr_mem_236114_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236109;\n    int32_t local_tid_236110;\n    int64_t group_sizze_236113;\n    int32_t wave_sizze_236112;\n    int32_t group_tid_236111;\n    \n    global_tid_236109 = get_global_id(0);\n    local_tid_236110 = get_local_id(0);\n    group_sizze_236113 = get_local_size(0);\n    wave_sizze_236112 = LOCKSTEP_WIDTH;\n    group_tid_236111 = get_group_id(0);\n    \n    int32_t phys_tid_224397 = global_tid_236109",
            ";\n    __local unsigned char *red_arr_mem_236114;\n    \n    red_arr_mem_236114 = (__local unsigned char *) red_arr_mem_236114_backing_0;\n    \n    __local unsigned char *red_arr_mem_236116;\n    \n    red_arr_mem_236116 = (__local unsigned char *) red_arr_mem_236116_backing_1;\n    \n    int32_t phys_group_id_236118;\n    \n    phys_group_id_236118 = get_group_id(0);\n    for (int32_t i_236119 = 0; i_236119 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_224389,\n                                                  segment_sizze_nonzzero_236107))) -\n                   phys_group_id_236118, sext_i64_i32(num_groups_224390));\n         i_236119++) {\n        int32_t virt_group_id_236120 = phys_group_id_236118 + i_236119 *\n                sext_i64_i32(num_groups_224390);\n        int64_t slice_236121 = t_n_m_203740;\n        int64_t slice_236122 = partition_sizze_203667 * slice_236121;\n        int64_t gtid_224394 = squot64(squot64(sext_i32_i64(local_tid_236110),\n                                              segment_sizze_nonzzero_236107) +\n                                      sext_i32_i64(virt_group_id_236120) *\n                                      squot64(segred_group_sizze_224389,\n                                              segment_sizze_nonzzero_236107),\n                                      slice_236121);\n        int64_t remnant_236123 = squot64(sext_i32_i64(local_tid_236110),\n                                         segment_sizze_nonzzero_236107) +\n                sext_i32_i64(virt_group_id_236120) *\n                squot64(segred_group_sizze_224389,\n                        segment_sizze_nonzzero_236107) - gtid_224394 *\n                slice_236121;\n        int64_t gtid_224395 = remnant_236123;\n        int64_t remnant_236124 = remnant_236123 - gtid_224395;\n        int64_t gtid_224396 = srem64(sext_i32_i64(local_tid_236110),\n                                     q_t_203576);\n   ",
            "     \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_224394,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_224395,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_236110),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_224389,\n                                                                 segment_sizze_nonzzero_236107)))) {\n                int64_t x_224405;\n                \n                x_224405 = ((__global int64_t *) ext_mem_229304)[gtid_224394];\n                \n                int64_t x_224414;\n                \n                x_224414 = ((__global int64_t *) ext_mem_229569)[gtid_224394 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_224395];\n                \n                double x_224415;\n                \n                x_224415 = ((__global double *) ext_mem_229568)[gtid_224394 *\n                                                                t_n_m_203740 +\n                                                                gtid_224395];\n                \n                int64_t binop_y_228755 = mul64(jump_t_203582, gtid_224395);\n                int64_t binop_y_228756 = smin64(i_203760, binop_y_228755);\n                int64_t index_primexp_228757 = add64((int64_t) 1,\n                                                     binop_y_228756);\n                double a11_224417;\n                \n                a11_224417 = ((__global double *) mem_231290)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                       ",
            "                       gtid_224395];\n                \n                double b11_224418;\n                \n                b11_224418 = ((__global double *) mem_231294)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                double c11_224419;\n                \n                c11_224419 = ((__global double *) mem_231298)[gtid_224394 *\n                                                              t_n_m_203740 +\n                                                              gtid_224395];\n                \n                bool cond_224421 = sle64(x_224405, gtid_224396);\n                int64_t defunc_0_f_res_224422;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224422 = (int64_t) 0;\n                } else {\n                    int64_t i_224423 = add64(gtid_224396, x_224414);\n                    int64_t defunc_0_add_arg_224424;\n                    \n                    defunc_0_add_arg_224424 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_224394 *\n                                                                           n_203572 +\n                                                                           i_224423];\n                    \n                    int64_t defunc_1_add_res_224425 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224424);\n                    \n                    defunc_0_f_res_224422 = defunc_1_add_res_224425;\n                }\n                \n                double defunc_0_f_res_224426;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224426 = 0.0;\n                } else {\n                    int64_t i_224427 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224428;\n                    \n                    defu",
            "nc_0_add_arg_224428 = ((__global\n                                                double *) mem_231259)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224427];\n                    defunc_0_f_res_224426 = defunc_0_add_arg_224428;\n                }\n                \n                int64_t binop_p_224429 = sub64(defunc_0_f_res_224422,\n                                               index_primexp_228757);\n                double defunc_0_f_res_224430 = sitofp_i64_f64(binop_p_224429);\n                double abs_res_224431 = fabs(defunc_0_f_res_224430);\n                double tmp1_224432 = abs_res_224431 / x_224415;\n                double x_224433 = tmp1_224432 * tmp1_224432;\n                double y_224434 = tmp1_224432 * x_224433;\n                double tmp2_224435 = 1.0 - y_224434;\n                double x_224436 = tmp2_224435 * tmp2_224435;\n                double tmp3_224437 = tmp2_224435 * x_224436;\n                double tmp4_224438 = defunc_0_f_res_224426 * tmp3_224437;\n                double defunc_1_f_res_224439 = defunc_0_f_res_224430 *\n                       tmp4_224438;\n                double defunc_0_f_res_224440;\n                \n                if (cond_224421) {\n                    defunc_0_f_res_224440 = 0.0;\n                } else {\n                    int64_t i_224441 = add64(gtid_224396, x_224414);\n                    double defunc_0_add_arg_224442;\n                    \n                    defunc_0_add_arg_224442 = ((__global\n                                                double *) mem_231263)[gtid_224394 *\n                                                                      n_203572 +\n                                                                      i_224441];\n                    defunc_0_f_res_224440 = defunc_0_add_arg_224442;\n                }\n                \n                double x_224443 = a11_224417 * tmp4_224438;\n         ",
            "       double y_224444 = b11_224418 * defunc_1_f_res_224439;\n                double x_224445 = x_224443 + y_224444;\n                double defunc_9_fit_fun_res_224446 = defunc_0_f_res_224440 *\n                       x_224445;\n                double x_224447 = b11_224418 * tmp4_224438;\n                double y_224448 = c11_224419 * defunc_1_f_res_224439;\n                double x_224449 = x_224447 + y_224448;\n                double defunc_9_slope_fun_res_224450 = defunc_0_f_res_224440 *\n                       x_224449;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)] =\n                        defunc_9_fit_fun_res_224446;\n                    ((__local\n                      double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)] =\n                        defunc_9_slope_fun_res_224450;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224398;\n                double x_224399;\n                double x_224400;\n                double x_224401;\n                double x_236125;\n                double x_236126;\n                double x_236127;\n                double x_236128;\n                bool ltid_in_bounds_236131 =\n                     slt64(sext_i32_i64(local_tid_236110), q_t_203576 *\n                           squot64(segred_group_sizze_224389,\n                                   segment_sizze_nonzzero_236107));",
            "\n                int32_t skip_threads_236132;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236131) {\n                        x_224400 = ((volatile __local\n                                     double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)];\n                        x_224401 = ((volatile __local\n                                     double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)];\n                        if ((local_tid_236110 - squot32(local_tid_236110, 32) *\n                             32) == 0) {\n                            x_224398 = x_224400;\n                            x_224399 = x_224401;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236132 = 1;\n                    while (slt32(skip_threads_236132, 32)) {\n                        bool thread_active_236133 = sle32(skip_threads_236132,\n                                                          local_tid_236110 -\n                                                          squot32(local_tid_236110,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236131;\n                        \n                        if (thread_active_236133) {\n                            // read operands\n                            {\n                                x_224398 = ((volatile __local\n                                             double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110) -\n                                                                           sext_i32_i64(skip_threads_236132)];\n                                x_224399 = ((volatile __local\n                                             double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110) -\n                                                                   ",
            "        sext_i32_i64(skip_threads_236132)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236134 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236110),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_236110) -\n                                       sext_i32_i64(local_tid_236110 -\n                                       skip_threads_236132));\n                            \n                            if (thread_active_236133 && inactive_236134) {\n                                x_224398 = x_224400;\n                                x_224399 = x_224401;\n                            }\n                            if (thread_active_236133) {\n                                if (!inactive_236134) {\n                                    double defunc_1_op_res_224402 = x_224398 +\n                                           x_224400;\n                                    double defunc_1_op_res_224403 = x_224399 +\n                                           x_224401;\n                                    \n                                    x_224398 = defunc_1_op_res_224402;\n                                    x_224399 = defunc_1_op_res_224403;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236112, skip_threads_236132)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236133) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)] =\n                                    x_224398;\n                                x_224400 = x_224398;\n                ",
            "                ((volatile __local\n                                  double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)] =\n                                    x_224399;\n                                x_224401 = x_224399;\n                            }\n                        }\n                        if (sle32(wave_sizze_236112, skip_threads_236132)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236132 *= 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_236110 - squot32(local_tid_236110, 32) *\n                         32) == 31 && ltid_in_bounds_236131) {\n                        ((volatile __local\n                          double *) red_arr_mem_236114)[sext_i32_i64(squot32(local_tid_236110,\n                                                                             32))] =\n                            x_224398;\n                        ((volatile __local\n                          double *) red_arr_mem_236116)[sext_i32_i64(squot32(local_tid_236110,\n                                                                             32))] =\n                            x_224399;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236135;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236110, 32) == 0 &&\n                            ltid_in_bounds_236131) {\n                            x_236127 = ((volatile __local\n                                         double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)];\n                            x_236",
            "128 = ((volatile __local\n                                         double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)];\n                            if ((local_tid_236110 - squot32(local_tid_236110,\n                                                            32) * 32) == 0) {\n                                x_236125 = x_236127;\n                                x_236126 = x_236128;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236135 = 1;\n                        while (slt32(skip_threads_236135, 32)) {\n                            bool thread_active_236136 =\n                                 sle32(skip_threads_236135, local_tid_236110 -\n                                       squot32(local_tid_236110, 32) * 32) &&\n                                 (squot32(local_tid_236110, 32) == 0 &&\n                                  ltid_in_bounds_236131);\n                            \n                            if (thread_active_236136) {\n                                // read operands\n                                {\n                                    x_236125 = ((volatile __local\n                                                 double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110) -\n                                                                               sext_i32_i64(skip_threads_236135)];\n                                    x_236126 = ((volatile __local\n                                                 double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110) -\n                                                                               sext_i32_i64(skip_threads_236135)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236137 =\n                                ",
            "     slt64(srem64(sext_i32_i64(local_tid_236110 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_236110 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236110 -\n                                                         skip_threads_236135) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236136 && inactive_236137) {\n                                    x_236125 = x_236127;\n                                    x_236126 = x_236128;\n                                }\n                                if (thread_active_236136) {\n                                    if (!inactive_236137) {\n                                        double defunc_1_op_res_236129 =\n                                               x_236125 + x_236127;\n                                        double defunc_1_op_res_236130 =\n                                               x_236126 + x_236128;\n                                        \n                                        x_236125 = defunc_1_op_res_236129;\n                                        x_236126 = defunc_1_op_res_236130;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236112, skip_threads_236135)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236136) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)] =\n                                        x_236125;\n                                    x_236127 = x_236125",
            ";\n                                    ((volatile __local\n                                      double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)] =\n                                        x_236126;\n                                    x_236128 = x_236126;\n                                }\n                            }\n                            if (sle32(wave_sizze_236112, skip_threads_236135)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236135 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236138 = squot32(local_tid_236110, 32) == 0 ||\n                     !ltid_in_bounds_236131;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236138) {\n                            x_224400 = x_224398;\n                            x_224401 = x_224399;\n                            x_224398 = ((__local\n                                         double *) red_arr_mem_236114)[sext_i32_i64(squot32(local_tid_236110,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224399 = ((__local\n                                         double *) red_arr_mem_236116)[sext_i32_i64(squot32(local_tid_236110,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236139 =\n                             slt64(srem64",
            "(sext_i32_i64(local_tid_236110),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_236110) -\n                                   sext_i32_i64(squot32(local_tid_236110, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236138) {\n                            if (inactive_236139) {\n                                x_224398 = x_224400;\n                                x_224399 = x_224401;\n                            }\n                        }\n                        if (!no_carry_in_236138) {\n                            if (!inactive_236139) {\n                                double defunc_1_op_res_224402 = x_224398 +\n                                       x_224400;\n                                double defunc_1_op_res_224403 = x_224399 +\n                                       x_224401;\n                                \n                                x_224398 = defunc_1_op_res_224402;\n                                x_224399 = defunc_1_op_res_224403;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236138) {\n                            ((__local\n                              double *) red_arr_mem_236114)[sext_i32_i64(local_tid_236110)] =\n                                x_224398;\n                            ((__local\n                              double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)] =\n                                x_224399;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236110, 32) == 0 &&\n                        ltid_in_bounds_236131) {\n                        ((__local\n                          double *) re",
            "d_arr_mem_236114)[sext_i32_i64(local_tid_236110)] =\n                            x_224400;\n                        ((__local\n                          double *) red_arr_mem_236116)[sext_i32_i64(local_tid_236110)] =\n                            x_224401;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236120) *\n                      squot64(segred_group_sizze_224389,\n                              segment_sizze_nonzzero_236107) +\n                      sext_i32_i64(local_tid_236110), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_236110),\n                                             squot64(segred_group_sizze_224389,\n                                                     segment_sizze_nonzzero_236107))) {\n                double tmp_236140;\n                \n                tmp_236140 = ((__local\n                               double *) red_arr_mem_236114)[(sext_i32_i64(local_tid_236110) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236107 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231303)[squot64(sext_i32_i64(virt_group_id_236120) *\n                                                squot64(segred_group_sizze_224389,\n                                                        segment_sizze_nonzzero_236107) +\n                                                sext_i32_i64(local_tid_236110),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236120) *\n                                         squot64(segred_group_sizze_224389,\n                  ",
            "                               segment_sizze_nonzzero_236107) +\n                                         sext_i32_i64(local_tid_236110) -\n                                         squot64(sext_i32_i64(virt_group_id_236120) *\n                                                 squot64(segred_group_sizze_224389,\n                                                         segment_sizze_nonzzero_236107) +\n                                                 sext_i32_i64(local_tid_236110),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236140;\n                \n                double tmp_236141;\n                \n                tmp_236141 = ((__local\n                               double *) red_arr_mem_236116)[(sext_i32_i64(local_tid_236110) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236107 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231307)[squot64(sext_i32_i64(virt_group_id_236120) *\n                                                squot64(segred_group_sizze_224389,\n                                                        segment_sizze_nonzzero_236107) +\n                                                sext_i32_i64(local_tid_236110),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236120) *\n                                         squot64(segred_group_sizze_224389,\n                                                 segment_sizze_nonzzero_236107) +\n                                         sext_i32_i64(local_tid_236110) -\n                                         squot64(sext_i32_i64(virt_group_id_236120) *\n                                                 squot64(segred_group_sizze_224389,\n               ",
            "                                          segment_sizze_nonzzero_236107) +\n                                                 sext_i32_i64(local_tid_236110),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236141;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_224389\n}\n__kernel void mainzisegred_small_225613(__global int *global_failure,\n                                        uint red_arr_mem_236289_backing_offset_0,\n                                        uint red_arr_mem_236287_backing_offset_1,\n                                        uint red_arr_mem_236285_backing_offset_2,\n                                        uint red_arr_mem_236283_backing_offset_3,\n                                        uint red_arr_mem_236281_backing_offset_4,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225603,\n                                        int64_t segment_sizze_nonzzero_236274,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231446,\n                                        __global unsigned char *mem_231450,\n                                        __glob",
            "al unsigned char *mem_231454,\n                                        __global unsigned char *mem_231458,\n                                        __global unsigned char *mem_231462)\n{\n    #define segred_group_sizze_225602 (mainzisegred_group_sizze_225051)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236289_backing_4 =\n                           &shared_mem[red_arr_mem_236289_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236287_backing_3 =\n                           &shared_mem[red_arr_mem_236287_backing_offset_1];\n    volatile unsigned char *red_arr_mem_236285_backing_2 =\n                           &shared_mem[red_arr_mem_236285_backing_offset_2];\n    volatile unsigned char *red_arr_mem_236283_backing_1 =\n                           &shared_mem[red_arr_mem_236283_backing_offset_3];\n    volatile unsigned char *red_arr_mem_236281_backing_0 =\n                           &shared_mem[red_arr_mem_236281_backing_offset_4];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236276;\n    int32_t local_tid_236277;\n    int64_t group_sizze_236280;\n    int32_t wave_sizze_236279;\n    int32_t group_tid_236278;\n    \n    global_tid_236276 = get_global_id(0);\n    local_tid_236277 = get_local_id(0);\n    group_sizze_236280 = get_local_size(0);\n    wave_sizze_236279 = LOCKSTEP_WIDTH;\n    group_tid_236278 = get_group_id(0);\n    \n    int32_t phys_tid_225613 = global_tid_236276;\n    __local unsigned char *red_arr_mem_236281;\n    \n    red_arr_mem_236281 = (__local unsigned char *) red_arr_mem_236281_backing_0;\n    \n    __local unsigned char *red_arr_mem_236283;\n    \n    red_arr_mem_236283 = (__local unsigned char *) red_arr_mem_236283_backing_1;\n    \n    __local unsigned char *red_arr_mem_236285;\n    \n    red_arr_mem_236285 = (__local unsigned char *) red_arr_mem_236285_backing_2;\n    \n    __local unsigned char *red_arr_mem_236287;\n    \n    red_arr_mem_236287 = (__",
            "local unsigned char *) red_arr_mem_236287_backing_3;\n    \n    __local unsigned char *red_arr_mem_236289;\n    \n    red_arr_mem_236289 = (__local unsigned char *) red_arr_mem_236289_backing_4;\n    \n    int32_t phys_group_id_236291;\n    \n    phys_group_id_236291 = get_group_id(0);\n    for (int32_t i_236292 = 0; i_236292 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_225602,\n                                                  segment_sizze_nonzzero_236274))) -\n                   phys_group_id_236291, sext_i64_i32(num_groups_225603));\n         i_236292++) {\n        int32_t virt_group_id_236293 = phys_group_id_236291 + i_236292 *\n                sext_i64_i32(num_groups_225603);\n        int64_t slice_236294 = t_n_m_203740;\n        int64_t slice_236295 = partition_sizze_203667 * slice_236294;\n        int64_t gtid_225610 = squot64(squot64(sext_i32_i64(local_tid_236277),\n                                              segment_sizze_nonzzero_236274) +\n                                      sext_i32_i64(virt_group_id_236293) *\n                                      squot64(segred_group_sizze_225602,\n                                              segment_sizze_nonzzero_236274),\n                                      slice_236294);\n        int64_t remnant_236296 = squot64(sext_i32_i64(local_tid_236277),\n                                         segment_sizze_nonzzero_236274) +\n                sext_i32_i64(virt_group_id_236293) *\n                squot64(segred_group_sizze_225602,\n                        segment_sizze_nonzzero_236274) - gtid_225610 *\n                slice_236294;\n        int64_t gtid_225611 = remnant_236296;\n        int64_t remnant_236297 = remnant_236296 - gtid_225611;\n        int64_t gtid_225612 = srem64(sext_i32_i64(local_tid_236277),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((",
            "int64_t) 0, q_t_203576) && ((slt64(gtid_225610,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_225611,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_236277),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_225602,\n                                                                 segment_sizze_nonzzero_236274)))) {\n                int64_t x_225630;\n                \n                x_225630 = ((__global int64_t *) ext_mem_229304)[gtid_225610];\n                \n                int64_t x_225635;\n                \n                x_225635 = ((__global int64_t *) ext_mem_229569)[gtid_225610 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225611];\n                \n                double x_225636;\n                \n                x_225636 = ((__global double *) ext_mem_229568)[gtid_225610 *\n                                                                t_n_m_203740 +\n                                                                gtid_225611];\n                \n                int64_t binop_y_228770 = mul64(jump_t_203582, gtid_225611);\n                int64_t binop_y_228771 = smin64(i_203760, binop_y_228770);\n                int64_t index_primexp_228772 = add64((int64_t) 1,\n                                                     binop_y_228771);\n                bool cond_225639 = sle64(x_225630, gtid_225612);\n                int64_t defunc_0_f_res_225640;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225640 = (int64_t) 0;\n                } else {\n                    int64_t i_225641 = add64(gtid_225612, x_225635);\n           ",
            "         int64_t defunc_0_add_arg_225642;\n                    \n                    defunc_0_add_arg_225642 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225610 *\n                                                                           n_203572 +\n                                                                           i_225641];\n                    \n                    int64_t defunc_1_add_res_225643 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225642);\n                    \n                    defunc_0_f_res_225640 = defunc_1_add_res_225643;\n                }\n                \n                double defunc_0_f_res_225644;\n                \n                if (cond_225639) {\n                    defunc_0_f_res_225644 = 0.0;\n                } else {\n                    int64_t i_225645 = add64(gtid_225612, x_225635);\n                    double defunc_0_add_arg_225646;\n                    \n                    defunc_0_add_arg_225646 = ((__global\n                                                double *) mem_231428)[gtid_225610 *\n                                                                      n_203572 +\n                                                                      i_225645];\n                    defunc_0_f_res_225644 = defunc_0_add_arg_225646;\n                }\n                \n                int64_t binop_p_225647 = sub64(defunc_0_f_res_225640,\n                                               index_primexp_228772);\n                double defunc_0_f_res_225648 = sitofp_i64_f64(binop_p_225647);\n                double abs_res_225649 = fabs(defunc_0_f_res_225648);\n                double tmp1_225650 = abs_res_225649 / x_225636;\n                double x_225651 = tmp1_225650 * tmp1_225650;\n                double y_225652 = tmp1_225650 * x_225651;\n                double tmp2_225653 = 1.0 - y_225652;\n                double x_225654 = tmp2_225653 * tmp2_225653;\n        ",
            "        double tmp3_225655 = tmp2_225653 * x_225654;\n                double w_j_225656 = defunc_0_f_res_225644 * tmp3_225655;\n                double xw_j_225657 = defunc_0_f_res_225648 * w_j_225656;\n                double x2w_j_225658 = defunc_0_f_res_225648 * xw_j_225657;\n                double x3w_j_225659 = defunc_0_f_res_225648 * x2w_j_225658;\n                double x4w_j_225660 = defunc_0_f_res_225648 * x3w_j_225659;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)] =\n                        w_j_225656;\n                    ((__local\n                      double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)] =\n                        xw_j_225657;\n                    ((__local\n                      double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)] =\n                        x2w_j_225658;\n                    ((__local\n                      double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)] =\n                        x3w_j_225659;\n                    ((__local\n                      double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277)] =\n                        x4w_j_225660;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236289)[sext_i32_i64(local_ti",
            "d_236277)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225614;\n                double x_225615;\n                double x_225616;\n                double x_225617;\n                double x_225618;\n                double x_225619;\n                double x_225620;\n                double x_225621;\n                double x_225622;\n                double x_225623;\n                double x_236298;\n                double x_236299;\n                double x_236300;\n                double x_236301;\n                double x_236302;\n                double x_236303;\n                double x_236304;\n                double x_236305;\n                double x_236306;\n                double x_236307;\n                bool ltid_in_bounds_236313 =\n                     slt64(sext_i32_i64(local_tid_236277), q_t_203576 *\n                           squot64(segred_group_sizze_225602,\n                                   segment_sizze_nonzzero_236274));\n                int32_t skip_threads_236314;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236313) {\n                        x_225619 = ((volatile __local\n                                     double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)];\n                        x_225620 = ((volatile __local\n                                     double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)];\n                        x_225621 = ((volatile __local\n                                     double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)];\n                        x_225622 = ((volatile __local\n                                     double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)];\n                        x_225623 = ((volatile __local\n                           ",
            "          double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277)];\n                        if ((local_tid_236277 - squot32(local_tid_236277, 32) *\n                             32) == 0) {\n                            x_225614 = x_225619;\n                            x_225615 = x_225620;\n                            x_225616 = x_225621;\n                            x_225617 = x_225622;\n                            x_225618 = x_225623;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236314 = 1;\n                    while (slt32(skip_threads_236314, 32)) {\n                        bool thread_active_236315 = sle32(skip_threads_236314,\n                                                          local_tid_236277 -\n                                                          squot32(local_tid_236277,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236313;\n                        \n                        if (thread_active_236315) {\n                            // read operands\n                            {\n                                x_225614 = ((volatile __local\n                                             double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277) -\n                                                                           sext_i32_i64(skip_threads_236314)];\n                                x_225615 = ((volatile __local\n                                             double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277) -\n                                                                           sext_i32_i64(skip_threads_236314)];\n                                x_225616 = ((volatile __local\n                                             double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277) -\n                                                    ",
            "                       sext_i32_i64(skip_threads_236314)];\n                                x_225617 = ((volatile __local\n                                             double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277) -\n                                                                           sext_i32_i64(skip_threads_236314)];\n                                x_225618 = ((volatile __local\n                                             double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277) -\n                                                                           sext_i32_i64(skip_threads_236314)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236316 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236277),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_236277) -\n                                       sext_i32_i64(local_tid_236277 -\n                                       skip_threads_236314));\n                            \n                            if (thread_active_236315 && inactive_236316) {\n                                x_225614 = x_225619;\n                                x_225615 = x_225620;\n                                x_225616 = x_225621;\n                                x_225617 = x_225622;\n                                x_225618 = x_225623;\n                            }\n                            if (thread_active_236315) {\n                                if (!inactive_236316) {\n                                    double defunc_1_op_res_225624 = x_225614 +\n                                           x_225619;\n                                    double defunc_1_op_res_225625 = x_225615 +\n                                           x_225620;\n                                    double defunc_1_op_res_225626 = x_225616 +\n     ",
            "                                      x_225621;\n                                    double defunc_1_op_res_225627 = x_225617 +\n                                           x_225622;\n                                    double defunc_1_op_res_225628 = x_225618 +\n                                           x_225623;\n                                    \n                                    x_225614 = defunc_1_op_res_225624;\n                                    x_225615 = defunc_1_op_res_225625;\n                                    x_225616 = defunc_1_op_res_225626;\n                                    x_225617 = defunc_1_op_res_225627;\n                                    x_225618 = defunc_1_op_res_225628;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236279, skip_threads_236314)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236315) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)] =\n                                    x_225614;\n                                x_225619 = x_225614;\n                                ((volatile __local\n                                  double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)] =\n                                    x_225615;\n                                x_225620 = x_225615;\n                                ((volatile __local\n                                  double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)] =\n                                    x_225616;\n                                x_225621 = x_225616;\n                                ((volatile __local\n                                  double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)] =\n                          ",
            "          x_225617;\n                                x_225622 = x_225617;\n                                ((volatile __local\n                                  double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277)] =\n                                    x_225618;\n                                x_225623 = x_225618;\n                            }\n                        }\n                        if (sle32(wave_sizze_236279, skip_threads_236314)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236314 *= 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_236277 - squot32(local_tid_236277, 32) *\n                         32) == 31 && ltid_in_bounds_236313) {\n                        ((volatile __local\n                          double *) red_arr_mem_236281)[sext_i32_i64(squot32(local_tid_236277,\n                                                                             32))] =\n                            x_225614;\n                        ((volatile __local\n                          double *) red_arr_mem_236283)[sext_i32_i64(squot32(local_tid_236277,\n                                                                             32))] =\n                            x_225615;\n                        ((volatile __local\n                          double *) red_arr_mem_236285)[sext_i32_i64(squot32(local_tid_236277,\n                                                                             32))] =\n                            x_225616;\n                        ((volatile __local\n                          double *) red_arr_mem_236287)[sext_i32_i64(squot32(local_tid_236277,\n                                                                             32))] =\n                            x_225617;\n                        ((volatile __local\n      ",
            "                    double *) red_arr_mem_236289)[sext_i32_i64(squot32(local_tid_236277,\n                                                                             32))] =\n                            x_225618;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236317;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236277, 32) == 0 &&\n                            ltid_in_bounds_236313) {\n                            x_236303 = ((volatile __local\n                                         double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)];\n                            x_236304 = ((volatile __local\n                                         double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)];\n                            x_236305 = ((volatile __local\n                                         double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)];\n                            x_236306 = ((volatile __local\n                                         double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)];\n                            x_236307 = ((volatile __local\n                                         double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277)];\n                            if ((local_tid_236277 - squot32(local_tid_236277,\n                                                            32) * 32) == 0) {\n                                x_236298 = x_236303;\n                                x_236299 = x_236304;\n                                x_236300 = x_236305;\n                                x_236301 = x_236306;\n                                x_236302 = x_236307;\n                            }\n                        }\n                    }\n              ",
            "      // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236317 = 1;\n                        while (slt32(skip_threads_236317, 32)) {\n                            bool thread_active_236318 =\n                                 sle32(skip_threads_236317, local_tid_236277 -\n                                       squot32(local_tid_236277, 32) * 32) &&\n                                 (squot32(local_tid_236277, 32) == 0 &&\n                                  ltid_in_bounds_236313);\n                            \n                            if (thread_active_236318) {\n                                // read operands\n                                {\n                                    x_236298 = ((volatile __local\n                                                 double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277) -\n                                                                               sext_i32_i64(skip_threads_236317)];\n                                    x_236299 = ((volatile __local\n                                                 double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277) -\n                                                                               sext_i32_i64(skip_threads_236317)];\n                                    x_236300 = ((volatile __local\n                                                 double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277) -\n                                                                               sext_i32_i64(skip_threads_236317)];\n                                    x_236301 = ((volatile __local\n                                                 double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277) -\n                                                                               sext_i32_i64(skip_threads_236317)];\n                                    x_236302 = ((volatile __local\n                                                 double *) re",
            "d_arr_mem_236289)[sext_i32_i64(local_tid_236277) -\n                                                                               sext_i32_i64(skip_threads_236317)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236319 =\n                                     slt64(srem64(sext_i32_i64(local_tid_236277 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_236277 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236277 -\n                                                         skip_threads_236317) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236318 && inactive_236319) {\n                                    x_236298 = x_236303;\n                                    x_236299 = x_236304;\n                                    x_236300 = x_236305;\n                                    x_236301 = x_236306;\n                                    x_236302 = x_236307;\n                                }\n                                if (thread_active_236318) {\n                                    if (!inactive_236319) {\n                                        double defunc_1_op_res_236308 =\n                                               x_236298 + x_236303;\n                                        double defunc_1_op_res_236309 =\n                                               x_236299 + x_236304;\n                                        double defunc_1_op_res_236310 =\n                                               x_236300 + x_236305;\n                                        double defunc_1_op_res_236311 =\n                                               x_236301 + x_236306;\n                   ",
            "                     double defunc_1_op_res_236312 =\n                                               x_236302 + x_236307;\n                                        \n                                        x_236298 = defunc_1_op_res_236308;\n                                        x_236299 = defunc_1_op_res_236309;\n                                        x_236300 = defunc_1_op_res_236310;\n                                        x_236301 = defunc_1_op_res_236311;\n                                        x_236302 = defunc_1_op_res_236312;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236279, skip_threads_236317)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236318) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)] =\n                                        x_236298;\n                                    x_236303 = x_236298;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)] =\n                                        x_236299;\n                                    x_236304 = x_236299;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)] =\n                                        x_236300;\n                                    x_236305 = x_236300;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)] =\n                                        x_236301;\n                                    x_236306 = x_23",
            "6301;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277)] =\n                                        x_236302;\n                                    x_236307 = x_236302;\n                                }\n                            }\n                            if (sle32(wave_sizze_236279, skip_threads_236317)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236317 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236320 = squot32(local_tid_236277, 32) == 0 ||\n                     !ltid_in_bounds_236313;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236320) {\n                            x_225619 = x_225614;\n                            x_225620 = x_225615;\n                            x_225621 = x_225616;\n                            x_225622 = x_225617;\n                            x_225623 = x_225618;\n                            x_225614 = ((__local\n                                         double *) red_arr_mem_236281)[sext_i32_i64(squot32(local_tid_236277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225615 = ((__local\n                                         double *) red_arr_mem_236283)[sext_i32_i64(squot32(local_tid_236277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225616 = ((__local",
            "\n                                         double *) red_arr_mem_236285)[sext_i32_i64(squot32(local_tid_236277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225617 = ((__local\n                                         double *) red_arr_mem_236287)[sext_i32_i64(squot32(local_tid_236277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225618 = ((__local\n                                         double *) red_arr_mem_236289)[sext_i32_i64(squot32(local_tid_236277,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236321 =\n                             slt64(srem64(sext_i32_i64(local_tid_236277),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_236277) -\n                                   sext_i32_i64(squot32(local_tid_236277, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236320) {\n                            if (inactive_236321) {\n                                x_225614 = x_225619;\n                                x_225615 = x_225620;\n                                x_225616 = x_225621;\n                                x_225617 = x_225622;\n                                x_225618 = x_225623;\n                            }\n                        }\n                        if (!no_carry_in_236320) {\n                            if (!inactiv",
            "e_236321) {\n                                double defunc_1_op_res_225624 = x_225614 +\n                                       x_225619;\n                                double defunc_1_op_res_225625 = x_225615 +\n                                       x_225620;\n                                double defunc_1_op_res_225626 = x_225616 +\n                                       x_225621;\n                                double defunc_1_op_res_225627 = x_225617 +\n                                       x_225622;\n                                double defunc_1_op_res_225628 = x_225618 +\n                                       x_225623;\n                                \n                                x_225614 = defunc_1_op_res_225624;\n                                x_225615 = defunc_1_op_res_225625;\n                                x_225616 = defunc_1_op_res_225626;\n                                x_225617 = defunc_1_op_res_225627;\n                                x_225618 = defunc_1_op_res_225628;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236320) {\n                            ((__local\n                              double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)] =\n                                x_225614;\n                            ((__local\n                              double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)] =\n                                x_225615;\n                            ((__local\n                              double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)] =\n                                x_225616;\n                            ((__local\n                              double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)] =\n                                x_225617;\n                            ((__local\n                              double *) red_arr_mem_236289)[sext_i32_i64(",
            "local_tid_236277)] =\n                                x_225618;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236277, 32) == 0 &&\n                        ltid_in_bounds_236313) {\n                        ((__local\n                          double *) red_arr_mem_236281)[sext_i32_i64(local_tid_236277)] =\n                            x_225619;\n                        ((__local\n                          double *) red_arr_mem_236283)[sext_i32_i64(local_tid_236277)] =\n                            x_225620;\n                        ((__local\n                          double *) red_arr_mem_236285)[sext_i32_i64(local_tid_236277)] =\n                            x_225621;\n                        ((__local\n                          double *) red_arr_mem_236287)[sext_i32_i64(local_tid_236277)] =\n                            x_225622;\n                        ((__local\n                          double *) red_arr_mem_236289)[sext_i32_i64(local_tid_236277)] =\n                            x_225623;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236293) *\n                      squot64(segred_group_sizze_225602,\n                              segment_sizze_nonzzero_236274) +\n                      sext_i32_i64(local_tid_236277), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_236277),\n                                             squot64(segred_group_sizze_225602,\n                                                     segment_sizze_nonzzero_236274))) {\n                double tmp_236322;\n                \n                tmp_236322 = ((__local\n                               doub",
            "le *) red_arr_mem_236281)[(sext_i32_i64(local_tid_236277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236274 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231446)[squot64(sext_i32_i64(virt_group_id_236293) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236274) +\n                                                sext_i32_i64(local_tid_236277),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236293) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236274) +\n                                         sext_i32_i64(local_tid_236277) -\n                                         squot64(sext_i32_i64(virt_group_id_236293) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236274) +\n                                                 sext_i32_i64(local_tid_236277),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236322;\n                \n                double tmp_236323;\n                \n                tmp_236323 = ((__local\n                               double *) red_arr_mem_236283)[(sext_i32_i64(local_tid_236277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236274 -\n                                                             (int64_t) 1];\n                ((",
            "__global\n                  double *) mem_231450)[squot64(sext_i32_i64(virt_group_id_236293) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236274) +\n                                                sext_i32_i64(local_tid_236277),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236293) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236274) +\n                                         sext_i32_i64(local_tid_236277) -\n                                         squot64(sext_i32_i64(virt_group_id_236293) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236274) +\n                                                 sext_i32_i64(local_tid_236277),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236323;\n                \n                double tmp_236324;\n                \n                tmp_236324 = ((__local\n                               double *) red_arr_mem_236285)[(sext_i32_i64(local_tid_236277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236274 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231454)[squot64(sext_i32_i64(virt_group_id_236293) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236274) +\n                                                sext_i32_",
            "i64(local_tid_236277),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236293) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236274) +\n                                         sext_i32_i64(local_tid_236277) -\n                                         squot64(sext_i32_i64(virt_group_id_236293) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236274) +\n                                                 sext_i32_i64(local_tid_236277),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236324;\n                \n                double tmp_236325;\n                \n                tmp_236325 = ((__local\n                               double *) red_arr_mem_236287)[(sext_i32_i64(local_tid_236277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236274 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231458)[squot64(sext_i32_i64(virt_group_id_236293) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236274) +\n                                                sext_i32_i64(local_tid_236277),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236293) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonz",
            "zero_236274) +\n                                         sext_i32_i64(local_tid_236277) -\n                                         squot64(sext_i32_i64(virt_group_id_236293) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment_sizze_nonzzero_236274) +\n                                                 sext_i32_i64(local_tid_236277),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236325;\n                \n                double tmp_236326;\n                \n                tmp_236326 = ((__local\n                               double *) red_arr_mem_236289)[(sext_i32_i64(local_tid_236277) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236274 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231462)[squot64(sext_i32_i64(virt_group_id_236293) *\n                                                squot64(segred_group_sizze_225602,\n                                                        segment_sizze_nonzzero_236274) +\n                                                sext_i32_i64(local_tid_236277),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236293) *\n                                         squot64(segred_group_sizze_225602,\n                                                 segment_sizze_nonzzero_236274) +\n                                         sext_i32_i64(local_tid_236277) -\n                                         squot64(sext_i32_i64(virt_group_id_236293) *\n                                                 squot64(segred_group_sizze_225602,\n                                                         segment",
            "_sizze_nonzzero_236274) +\n                                                 sext_i32_i64(local_tid_236277),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236326;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225602\n}\n__kernel void mainzisegred_small_225714(__global int *global_failure,\n                                        uint red_arr_mem_236421_backing_offset_0,\n                                        uint red_arr_mem_236419_backing_offset_1,\n                                        int64_t n_203572, int64_t q_t_203576,\n                                        int64_t jump_t_203582,\n                                        int64_t partition_sizze_203667,\n                                        int64_t t_n_m_203740, int64_t i_203760,\n                                        int64_t num_groups_225707,\n                                        int64_t segment_sizze_nonzzero_236412,\n                                        __global unsigned char *ext_mem_229304,\n                                        __global unsigned char *ext_mem_229305,\n                                        __global unsigned char *ext_mem_229568,\n                                        __global unsigned char *ext_mem_229569,\n                                        __global unsigned char *mem_231428,\n                                        __global unsigned char *mem_231432,\n                                        __global unsigned char *mem_231467,\n                                        __global unsigned char *mem_231471,\n                                        __global unsigned char *mem_231475,\n                                        __global unsigned char *mem_231479,\n                                        __global unsigned char *mem_231483,\n                                     ",
            "   __global unsigned char *mem_231488,\n                                        __global unsigned char *mem_231492)\n{\n    #define segred_group_sizze_225706 (mainzisegred_group_sizze_224922)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_236421_backing_1 =\n                           &shared_mem[red_arr_mem_236421_backing_offset_0];\n    volatile unsigned char *red_arr_mem_236419_backing_0 =\n                           &shared_mem[red_arr_mem_236419_backing_offset_1];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236414;\n    int32_t local_tid_236415;\n    int64_t group_sizze_236418;\n    int32_t wave_sizze_236417;\n    int32_t group_tid_236416;\n    \n    global_tid_236414 = get_global_id(0);\n    local_tid_236415 = get_local_id(0);\n    group_sizze_236418 = get_local_size(0);\n    wave_sizze_236417 = LOCKSTEP_WIDTH;\n    group_tid_236416 = get_group_id(0);\n    \n    int32_t phys_tid_225714 = global_tid_236414;\n    __local unsigned char *red_arr_mem_236419;\n    \n    red_arr_mem_236419 = (__local unsigned char *) red_arr_mem_236419_backing_0;\n    \n    __local unsigned char *red_arr_mem_236421;\n    \n    red_arr_mem_236421 = (__local unsigned char *) red_arr_mem_236421_backing_1;\n    \n    int32_t phys_group_id_236423;\n    \n    phys_group_id_236423 = get_group_id(0);\n    for (int32_t i_236424 = 0; i_236424 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667 * t_n_m_203740,\n                                          squot64(segred_group_sizze_225706,\n                                                  segment_sizze_nonzzero_236412))) -\n                   phys_group_id_236423, sext_i64_i32(num_groups_225707));\n         i_236424++) {\n        int32_t virt_group_id_236425 = phys_group_id_236423 + i_236424 *\n                sext_i64_i32(num_groups_225707);\n        int64_t slice_236426 = t_n_m_203740;\n        int64_t slice_236427 = partition_sizze_203667 * slic",
            "e_236426;\n        int64_t gtid_225711 = squot64(squot64(sext_i32_i64(local_tid_236415),\n                                              segment_sizze_nonzzero_236412) +\n                                      sext_i32_i64(virt_group_id_236425) *\n                                      squot64(segred_group_sizze_225706,\n                                              segment_sizze_nonzzero_236412),\n                                      slice_236426);\n        int64_t remnant_236428 = squot64(sext_i32_i64(local_tid_236415),\n                                         segment_sizze_nonzzero_236412) +\n                sext_i32_i64(virt_group_id_236425) *\n                squot64(segred_group_sizze_225706,\n                        segment_sizze_nonzzero_236412) - gtid_225711 *\n                slice_236426;\n        int64_t gtid_225712 = remnant_236428;\n        int64_t remnant_236429 = remnant_236428 - gtid_225712;\n        int64_t gtid_225713 = srem64(sext_i32_i64(local_tid_236415),\n                                     q_t_203576);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203576) && ((slt64(gtid_225711,\n                                                          partition_sizze_203667) &&\n                                                    slt64(gtid_225712,\n                                                          t_n_m_203740)) &&\n                                                   slt64(sext_i32_i64(local_tid_236415),\n                                                         q_t_203576 *\n                                                         squot64(segred_group_sizze_225706,\n                                                                 segment_sizze_nonzzero_236412)))) {\n                int64_t x_225722;\n                \n                x_225722 = ((__global int64_t *) ext_mem_229304)[gtid_225711];\n                \n                int64_t x_225733;\n                \n                x_225733 = ((__global int64_t *) ext_mem_22",
            "9569)[gtid_225711 *\n                                                                 t_n_m_203740 +\n                                                                 gtid_225712];\n                \n                double x_225734;\n                \n                x_225734 = ((__global double *) ext_mem_229568)[gtid_225711 *\n                                                                t_n_m_203740 +\n                                                                gtid_225712];\n                \n                int64_t binop_y_228765 = mul64(jump_t_203582, gtid_225712);\n                int64_t binop_y_228766 = smin64(i_203760, binop_y_228765);\n                int64_t index_primexp_228767 = add64((int64_t) 1,\n                                                     binop_y_228766);\n                double a12_225736;\n                \n                a12_225736 = ((__global double *) mem_231467)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b12_225737;\n                \n                b12_225737 = ((__global double *) mem_231471)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double c12_225738;\n                \n                c12_225738 = ((__global double *) mem_231475)[gtid_225711 *\n                                                              t_n_m_203740 +\n                                                              gtid_225712];\n                \n                double b2_225739;\n                \n                b2_225739 = ((__global double *) mem_231479)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                double c2_2",
            "25740;\n                \n                c2_225740 = ((__global double *) mem_231483)[gtid_225711 *\n                                                             t_n_m_203740 +\n                                                             gtid_225712];\n                \n                bool cond_225742 = sle64(x_225722, gtid_225713);\n                int64_t defunc_0_f_res_225743;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225743 = (int64_t) 0;\n                } else {\n                    int64_t i_225744 = add64(gtid_225713, x_225733);\n                    int64_t defunc_0_add_arg_225745;\n                    \n                    defunc_0_add_arg_225745 = ((__global\n                                                int64_t *) ext_mem_229305)[gtid_225711 *\n                                                                           n_203572 +\n                                                                           i_225744];\n                    \n                    int64_t defunc_1_add_res_225746 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225745);\n                    \n                    defunc_0_f_res_225743 = defunc_1_add_res_225746;\n                }\n                \n                double defunc_0_f_res_225747;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225747 = 0.0;\n                } else {\n                    int64_t i_225748 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225749;\n                    \n                    defunc_0_add_arg_225749 = ((__global\n                                                double *) mem_231428)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225748];\n                    defunc_0_f_res_225747 = defunc_0_add_arg_225749;\n                }\n                \n",
            "                int64_t binop_p_225750 = sub64(defunc_0_f_res_225743,\n                                               index_primexp_228767);\n                double defunc_0_f_res_225751 = sitofp_i64_f64(binop_p_225750);\n                double abs_res_225752 = fabs(defunc_0_f_res_225751);\n                double tmp1_225753 = abs_res_225752 / x_225734;\n                double x_225754 = tmp1_225753 * tmp1_225753;\n                double y_225755 = tmp1_225753 * x_225754;\n                double tmp2_225756 = 1.0 - y_225755;\n                double x_225757 = tmp2_225756 * tmp2_225756;\n                double tmp3_225758 = tmp2_225756 * x_225757;\n                double tmp4_225759 = defunc_0_f_res_225747 * tmp3_225758;\n                double defunc_1_f_res_225760 = defunc_0_f_res_225751 *\n                       tmp4_225759;\n                double defunc_1_f_res_225761 = defunc_0_f_res_225751 *\n                       defunc_1_f_res_225760;\n                double defunc_0_f_res_225762;\n                \n                if (cond_225742) {\n                    defunc_0_f_res_225762 = 0.0;\n                } else {\n                    int64_t i_225763 = add64(gtid_225713, x_225733);\n                    double defunc_0_add_arg_225764;\n                    \n                    defunc_0_add_arg_225764 = ((__global\n                                                double *) mem_231432)[gtid_225711 *\n                                                                      n_203572 +\n                                                                      i_225763];\n                    defunc_0_f_res_225762 = defunc_0_add_arg_225764;\n                }\n                \n                double x_225765 = a12_225736 * tmp4_225759;\n                double y_225766 = b12_225737 * defunc_1_f_res_225760;\n                double x_225767 = x_225765 + y_225766;\n                double y_225768 = c12_225738 * defunc_1_f_res_225761;\n                double x_225769 = x_225767 + y_225768;\n                double de",
            "func_9_fit_fun_res_225770 = defunc_0_f_res_225762 *\n                       x_225769;\n                double x_225771 = b12_225737 * tmp4_225759;\n                double y_225772 = b2_225739 * defunc_1_f_res_225760;\n                double x_225773 = x_225771 + y_225772;\n                double y_225774 = c2_225740 * defunc_1_f_res_225761;\n                double x_225775 = x_225773 + y_225774;\n                double defunc_9_slope_fun_res_225776 = defunc_0_f_res_225762 *\n                       x_225775;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)] =\n                        defunc_9_fit_fun_res_225770;\n                    ((__local\n                      double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)] =\n                        defunc_9_slope_fun_res_225776;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203576)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225715;\n                double x_225716;\n                double x_225717;\n                double x_225718;\n                double x_236430;\n                double x_236431;\n                double x_236432;\n                double x_236433;\n                bool ltid_in_bounds_236436 =\n                     slt64(sext_i32_i64(local_tid_236415), q_t_203576 *\n                           squot64(segred_group_sizze_225706,\n                                   segment_sizze_nonzzero_236412));\n                i",
            "nt32_t skip_threads_236437;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236436) {\n                        x_225717 = ((volatile __local\n                                     double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)];\n                        x_225718 = ((volatile __local\n                                     double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)];\n                        if ((local_tid_236415 - squot32(local_tid_236415, 32) *\n                             32) == 0) {\n                            x_225715 = x_225717;\n                            x_225716 = x_225718;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236437 = 1;\n                    while (slt32(skip_threads_236437, 32)) {\n                        bool thread_active_236438 = sle32(skip_threads_236437,\n                                                          local_tid_236415 -\n                                                          squot32(local_tid_236415,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236436;\n                        \n                        if (thread_active_236438) {\n                            // read operands\n                            {\n                                x_225715 = ((volatile __local\n                                             double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415) -\n                                                                           sext_i32_i64(skip_threads_236437)];\n                                x_225716 = ((volatile __local\n                                             double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415) -\n                                                                           sext_i32_i",
            "64(skip_threads_236437)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236439 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236415),\n                                              q_t_203576),\n                                       sext_i32_i64(local_tid_236415) -\n                                       sext_i32_i64(local_tid_236415 -\n                                       skip_threads_236437));\n                            \n                            if (thread_active_236438 && inactive_236439) {\n                                x_225715 = x_225717;\n                                x_225716 = x_225718;\n                            }\n                            if (thread_active_236438) {\n                                if (!inactive_236439) {\n                                    double defunc_1_op_res_225719 = x_225715 +\n                                           x_225717;\n                                    double defunc_1_op_res_225720 = x_225716 +\n                                           x_225718;\n                                    \n                                    x_225715 = defunc_1_op_res_225719;\n                                    x_225716 = defunc_1_op_res_225720;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236417, skip_threads_236437)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236438) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)] =\n                                    x_225715;\n                                x_225717 = x_225715;\n                                ((",
            "volatile __local\n                                  double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)] =\n                                    x_225716;\n                                x_225718 = x_225716;\n                            }\n                        }\n                        if (sle32(wave_sizze_236417, skip_threads_236437)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236437 *= 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_236415 - squot32(local_tid_236415, 32) *\n                         32) == 31 && ltid_in_bounds_236436) {\n                        ((volatile __local\n                          double *) red_arr_mem_236419)[sext_i32_i64(squot32(local_tid_236415,\n                                                                             32))] =\n                            x_225715;\n                        ((volatile __local\n                          double *) red_arr_mem_236421)[sext_i32_i64(squot32(local_tid_236415,\n                                                                             32))] =\n                            x_225716;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_236440;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236415, 32) == 0 &&\n                            ltid_in_bounds_236436) {\n                            x_236432 = ((volatile __local\n                                         double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)];\n                            x_236433 = ((volatile _",
            "_local\n                                         double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)];\n                            if ((local_tid_236415 - squot32(local_tid_236415,\n                                                            32) * 32) == 0) {\n                                x_236430 = x_236432;\n                                x_236431 = x_236433;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236440 = 1;\n                        while (slt32(skip_threads_236440, 32)) {\n                            bool thread_active_236441 =\n                                 sle32(skip_threads_236440, local_tid_236415 -\n                                       squot32(local_tid_236415, 32) * 32) &&\n                                 (squot32(local_tid_236415, 32) == 0 &&\n                                  ltid_in_bounds_236436);\n                            \n                            if (thread_active_236441) {\n                                // read operands\n                                {\n                                    x_236430 = ((volatile __local\n                                                 double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415) -\n                                                                               sext_i32_i64(skip_threads_236440)];\n                                    x_236431 = ((volatile __local\n                                                 double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415) -\n                                                                               sext_i32_i64(skip_threads_236440)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236442 =\n                                     slt64(srem64(",
            "sext_i32_i64(local_tid_236415 *\n                                                  32 + 32 - 1), q_t_203576),\n                                           sext_i32_i64(local_tid_236415 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236415 -\n                                                         skip_threads_236440) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236441 && inactive_236442) {\n                                    x_236430 = x_236432;\n                                    x_236431 = x_236433;\n                                }\n                                if (thread_active_236441) {\n                                    if (!inactive_236442) {\n                                        double defunc_1_op_res_236434 =\n                                               x_236430 + x_236432;\n                                        double defunc_1_op_res_236435 =\n                                               x_236431 + x_236433;\n                                        \n                                        x_236430 = defunc_1_op_res_236434;\n                                        x_236431 = defunc_1_op_res_236435;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236417, skip_threads_236440)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236441) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)] =\n                                        x_236430;\n                                    x_236432 = x_236430;\n                ",
            "                    ((volatile __local\n                                      double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)] =\n                                        x_236431;\n                                    x_236433 = x_236431;\n                                }\n                            }\n                            if (sle32(wave_sizze_236417, skip_threads_236440)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236440 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236443 = squot32(local_tid_236415, 32) == 0 ||\n                     !ltid_in_bounds_236436;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236443) {\n                            x_225717 = x_225715;\n                            x_225718 = x_225716;\n                            x_225715 = ((__local\n                                         double *) red_arr_mem_236419)[sext_i32_i64(squot32(local_tid_236415,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225716 = ((__local\n                                         double *) red_arr_mem_236421)[sext_i32_i64(squot32(local_tid_236415,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236444 =\n                             slt64(srem64(sext_i32_i64(loca",
            "l_tid_236415),\n                                          q_t_203576),\n                                   sext_i32_i64(local_tid_236415) -\n                                   sext_i32_i64(squot32(local_tid_236415, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236443) {\n                            if (inactive_236444) {\n                                x_225715 = x_225717;\n                                x_225716 = x_225718;\n                            }\n                        }\n                        if (!no_carry_in_236443) {\n                            if (!inactive_236444) {\n                                double defunc_1_op_res_225719 = x_225715 +\n                                       x_225717;\n                                double defunc_1_op_res_225720 = x_225716 +\n                                       x_225718;\n                                \n                                x_225715 = defunc_1_op_res_225719;\n                                x_225716 = defunc_1_op_res_225720;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236443) {\n                            ((__local\n                              double *) red_arr_mem_236419)[sext_i32_i64(local_tid_236415)] =\n                                x_225715;\n                            ((__local\n                              double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)] =\n                                x_225716;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236415, 32) == 0 &&\n                        ltid_in_bounds_236436) {\n                        ((__local\n                          double *) red_arr_mem_236419)[",
            "sext_i32_i64(local_tid_236415)] =\n                            x_225717;\n                        ((__local\n                          double *) red_arr_mem_236421)[sext_i32_i64(local_tid_236415)] =\n                            x_225718;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_236425) *\n                      squot64(segred_group_sizze_225706,\n                              segment_sizze_nonzzero_236412) +\n                      sext_i32_i64(local_tid_236415), partition_sizze_203667 *\n                      t_n_m_203740) && slt64(sext_i32_i64(local_tid_236415),\n                                             squot64(segred_group_sizze_225706,\n                                                     segment_sizze_nonzzero_236412))) {\n                double tmp_236445;\n                \n                tmp_236445 = ((__local\n                               double *) red_arr_mem_236419)[(sext_i32_i64(local_tid_236415) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236412 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231488)[squot64(sext_i32_i64(virt_group_id_236425) *\n                                                squot64(segred_group_sizze_225706,\n                                                        segment_sizze_nonzzero_236412) +\n                                                sext_i32_i64(local_tid_236415),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236425) *\n                                         squot64(segred_group_sizze_225706,\n                                    ",
            "             segment_sizze_nonzzero_236412) +\n                                         sext_i32_i64(local_tid_236415) -\n                                         squot64(sext_i32_i64(virt_group_id_236425) *\n                                                 squot64(segred_group_sizze_225706,\n                                                         segment_sizze_nonzzero_236412) +\n                                                 sext_i32_i64(local_tid_236415),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236445;\n                \n                double tmp_236446;\n                \n                tmp_236446 = ((__local\n                               double *) red_arr_mem_236421)[(sext_i32_i64(local_tid_236415) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236412 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231492)[squot64(sext_i32_i64(virt_group_id_236425) *\n                                                squot64(segred_group_sizze_225706,\n                                                        segment_sizze_nonzzero_236412) +\n                                                sext_i32_i64(local_tid_236415),\n                                                t_n_m_203740) * t_n_m_203740 +\n                                        (sext_i32_i64(virt_group_id_236425) *\n                                         squot64(segred_group_sizze_225706,\n                                                 segment_sizze_nonzzero_236412) +\n                                         sext_i32_i64(local_tid_236415) -\n                                         squot64(sext_i32_i64(virt_group_id_236425) *\n                                                 squot64(segred_group_sizze_225706,\n                                 ",
            "                        segment_sizze_nonzzero_236412) +\n                                                 sext_i32_i64(local_tid_236415),\n                                                 t_n_m_203740) *\n                                         t_n_m_203740)] = tmp_236446;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_225706\n}\n__kernel void mainzisegred_small_228180(__global int *global_failure,\n                                        uint red_arr_mem_237086_backing_offset_0,\n                                        int64_t n_203572,\n                                        int64_t partition_sizze_203667,\n                                        int64_t stl_res_203754,\n                                        int64_t j_m_i_204223,\n                                        int64_t num_groups_228175,\n                                        int64_t segment_sizze_nonzzero_237079,\n                                        __global unsigned char *ext_mem_231924,\n                                        __global unsigned char *mem_231941)\n{\n    #define segred_group_sizze_228174 (mainzisegred_group_sizze_228157)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *red_arr_mem_237086_backing_0 =\n                           &shared_mem[red_arr_mem_237086_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_237081;\n    int32_t local_tid_237082;\n    int64_t group_sizze_237085;\n    int32_t wave_sizze_237084;\n    int32_t group_tid_237083;\n    \n    global_tid_237081 = get_global_id(0);\n    local_tid_237082 = get_local_id(0);\n    group_sizze_237085 = get_local_size(0);\n    wave_sizze_237084 = LOCKSTEP_WIDTH;\n    group_tid_237083 = get_group_id(0);\n    \n    int32_t phys_tid_228180 = global_tid_237081;\n    __local unsigned char *red_arr_mem_23",
            "7086;\n    \n    red_arr_mem_237086 = (__local unsigned char *) red_arr_mem_237086_backing_0;\n    \n    int32_t phys_group_id_237088;\n    \n    phys_group_id_237088 = get_group_id(0);\n    for (int32_t i_237089 = 0; i_237089 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203667,\n                                          squot64(segred_group_sizze_228174,\n                                                  segment_sizze_nonzzero_237079))) -\n                   phys_group_id_237088, sext_i64_i32(num_groups_228175));\n         i_237089++) {\n        int32_t virt_group_id_237090 = phys_group_id_237088 + i_237089 *\n                sext_i64_i32(num_groups_228175);\n        int64_t slice_237091 = partition_sizze_203667;\n        int64_t gtid_228178 = squot64(sext_i32_i64(local_tid_237082),\n                                      segment_sizze_nonzzero_237079) +\n                sext_i32_i64(virt_group_id_237090) *\n                squot64(segred_group_sizze_228174,\n                        segment_sizze_nonzzero_237079);\n        int64_t remnant_237092 = squot64(sext_i32_i64(local_tid_237082),\n                                         segment_sizze_nonzzero_237079) +\n                sext_i32_i64(virt_group_id_237090) *\n                squot64(segred_group_sizze_228174,\n                        segment_sizze_nonzzero_237079) - gtid_228178;\n        int64_t gtid_228179 = srem64(sext_i32_i64(local_tid_237082),\n                                     j_m_i_204223);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, j_m_i_204223) && (slt64(gtid_228178,\n                                                           partition_sizze_203667) &&\n                                                     slt64(sext_i32_i64(local_tid_237082),\n                                                           j_m_i_204223 *\n                                                           squot64(segred_group_sizze_228174,\n                                                     ",
            "              segment_sizze_nonzzero_237079)))) {\n                int64_t slice_228309 = stl_res_203754 + gtid_228179;\n                double x_228185;\n                \n                x_228185 = ((__global double *) ext_mem_231924)[gtid_228178 *\n                                                                n_203572 +\n                                                                slice_228309];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)] =\n                        x_228185;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, j_m_i_204223)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_228181;\n                double x_228182;\n                double x_237093;\n                double x_237094;\n                bool ltid_in_bounds_237096 =\n                     slt64(sext_i32_i64(local_tid_237082), j_m_i_204223 *\n                           squot64(segred_group_sizze_228174,\n                                   segment_sizze_nonzzero_237079));\n                int32_t skip_threads_237097;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_237096) {\n                        x_228182 = ((volatile __local\n                                     double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)];\n                        if ((local_tid_237082 - squot32(local_tid_237082, 32) *\n                             32) == 0) {\n                            x_228181 = x_228182;\n                        }\n                    }\n                }\n                // in-",
            "block scan (hopefully no barriers needed)\n                {\n                    skip_threads_237097 = 1;\n                    while (slt32(skip_threads_237097, 32)) {\n                        bool thread_active_237098 = sle32(skip_threads_237097,\n                                                          local_tid_237082 -\n                                                          squot32(local_tid_237082,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_237096;\n                        \n                        if (thread_active_237098) {\n                            // read operands\n                            {\n                                x_228181 = ((volatile __local\n                                             double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082) -\n                                                                           sext_i32_i64(skip_threads_237097)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_237099 =\n                                 slt64(srem64(sext_i32_i64(local_tid_237082),\n                                              j_m_i_204223),\n                                       sext_i32_i64(local_tid_237082) -\n                                       sext_i32_i64(local_tid_237082 -\n                                       skip_threads_237097));\n                            \n                            if (thread_active_237098 && inactive_237099) {\n                                x_228181 = x_228182;\n                            }\n                            if (thread_active_237098) {\n                                if (!inactive_237099) {\n                                    double defunc_1_op_res_228183 = x_228181 +\n                                           x_228182;\n                                    \n                                    x_22",
            "8181 = defunc_1_op_res_228183;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_237084, skip_threads_237097)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_237098) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)] =\n                                    x_228181;\n                                x_228182 = x_228181;\n                            }\n                        }\n                        if (sle32(wave_sizze_237084, skip_threads_237097)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_237097 *= 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_237082 - squot32(local_tid_237082, 32) *\n                         32) == 31 && ltid_in_bounds_237096) {\n                        ((volatile __local\n                          double *) red_arr_mem_237086)[sext_i32_i64(squot32(local_tid_237082,\n                                                                             32))] =\n                            x_228181;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_237100;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_237082, 32) == 0 &&\n                            ltid_in_bounds_237096) {\n                            x_23",
            "7094 = ((volatile __local\n                                         double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)];\n                            if ((local_tid_237082 - squot32(local_tid_237082,\n                                                            32) * 32) == 0) {\n                                x_237093 = x_237094;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_237100 = 1;\n                        while (slt32(skip_threads_237100, 32)) {\n                            bool thread_active_237101 =\n                                 sle32(skip_threads_237100, local_tid_237082 -\n                                       squot32(local_tid_237082, 32) * 32) &&\n                                 (squot32(local_tid_237082, 32) == 0 &&\n                                  ltid_in_bounds_237096);\n                            \n                            if (thread_active_237101) {\n                                // read operands\n                                {\n                                    x_237093 = ((volatile __local\n                                                 double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082) -\n                                                                               sext_i32_i64(skip_threads_237100)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_237102 =\n                                     slt64(srem64(sext_i32_i64(local_tid_237082 *\n                                                  32 + 32 - 1), j_m_i_204223),\n                                           sext_i32_i64(local_tid_237082 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_237082 -\n       ",
            "                                                  skip_threads_237100) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_237101 && inactive_237102) {\n                                    x_237093 = x_237094;\n                                }\n                                if (thread_active_237101) {\n                                    if (!inactive_237102) {\n                                        double defunc_1_op_res_237095 =\n                                               x_237093 + x_237094;\n                                        \n                                        x_237093 = defunc_1_op_res_237095;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_237084, skip_threads_237100)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_237101) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)] =\n                                        x_237093;\n                                    x_237094 = x_237093;\n                                }\n                            }\n                            if (sle32(wave_sizze_237084, skip_threads_237100)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_237100 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_237103 = squot32(local_tid_237082, 32) == 0 ||\n                     !ltid_in_bounds_237096;\n                \n                // carry-in for every block except ",
            "the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_237103) {\n                            x_228182 = x_228181;\n                            x_228181 = ((__local\n                                         double *) red_arr_mem_237086)[sext_i32_i64(squot32(local_tid_237082,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_237104 =\n                             slt64(srem64(sext_i32_i64(local_tid_237082),\n                                          j_m_i_204223),\n                                   sext_i32_i64(local_tid_237082) -\n                                   sext_i32_i64(squot32(local_tid_237082, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_237103) {\n                            if (inactive_237104) {\n                                x_228181 = x_228182;\n                            }\n                        }\n                        if (!no_carry_in_237103) {\n                            if (!inactive_237104) {\n                                double defunc_1_op_res_228183 = x_228181 +\n                                       x_228182;\n                                \n                                x_228181 = defunc_1_op_res_228183;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_237103) {\n                            ((__local\n                              double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)] =\n                                x_228181;\n                        }\n                    }\n          ",
            "      }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_237082, 32) == 0 &&\n                        ltid_in_bounds_237096) {\n                        ((__local\n                          double *) red_arr_mem_237086)[sext_i32_i64(local_tid_237082)] =\n                            x_228182;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_237090) *\n                      squot64(segred_group_sizze_228174,\n                              segment_sizze_nonzzero_237079) +\n                      sext_i32_i64(local_tid_237082), partition_sizze_203667) &&\n                slt64(sext_i32_i64(local_tid_237082),\n                      squot64(segred_group_sizze_228174,\n                              segment_sizze_nonzzero_237079))) {\n                double tmp_237105;\n                \n                tmp_237105 = ((__local\n                               double *) red_arr_mem_237086)[(sext_i32_i64(local_tid_237082) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_237079 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231941)[sext_i32_i64(virt_group_id_237090) *\n                                        squot64(segred_group_sizze_228174,\n                                                segment_sizze_nonzzero_237079) +\n                                        sext_i32_i64(local_tid_237082)] =\n                    tmp_237105;\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    #und",
            "ef segred_group_sizze_228174\n}\n__kernel void mainzisegscan_206957(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_232394_backing_offset_0,\n                                   int64_t m_203571, int64_t n_203572,\n                                   int64_t n_p_203574,\n                                   int64_t defunc_0_f_res_203592,\n                                   int64_t num_threads_232195, __global\n                                   unsigned char *mem_229242, __global\n                                   unsigned char *mem_229260, __global\n                                   unsigned char *mem_229263, __global\n                                   unsigned char *mem_229265, __global\n                                   unsigned char *color_232074, __global\n                                   unsigned char *mainziid_counter_mem_232365,\n                                   __global\n                                   unsigned char *status_flags_mem_232367,\n                                   __global\n                                   unsigned char *aggregates_mem_232369,\n                                   __global\n                                   unsigned char *incprefixes_mem_232371)\n{\n    #define segscan_group_sizze_206952 (mainzisegscan_group_sizze_206951)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_232394_backing_0 =\n                           &shared_mem[local_mem_232394_backing_offset_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_232385;\n    int32_t local_tid_232386;\n    int64_t group_sizze_232389;\n  ",
            "  int32_t wave_sizze_232388;\n    int32_t group_tid_232387;\n    \n    global_tid_232385 = get_global_id(0);\n    local_tid_232386 = get_local_id(0);\n    group_sizze_232389 = get_local_size(0);\n    wave_sizze_232388 = LOCKSTEP_WIDTH;\n    group_tid_232387 = get_group_id(0);\n    \n    int32_t phys_tid_206957 = global_tid_232385;\n    int64_t byte_offsets_232390 = (int64_t) 0;\n    int64_t byte_offsets_232391 = segscan_group_sizze_206952 * (int64_t) 8;\n    int64_t warp_byte_offset_232392 = (int64_t) 32;\n    int64_t warp_byte_offset_232393 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_232394;\n    \n    local_mem_232394 = (__local unsigned char *) local_mem_232394_backing_0;\n    \n    int64_t trans_arr_len_232395 = (int64_t) 11 * segscan_group_sizze_206952;\n    int32_t dynamic_id_232401;\n    \n    if (local_tid_232386 == 0) {\n        dynamic_id_232401 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_232365)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_232394)[(int64_t) 0] = dynamic_id_232401;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_232401 = ((__local int32_t *) local_mem_232394)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_232402 = sext_i32_i64(dynamic_id_232401) * (int64_t) 11 *\n            segscan_group_sizze_206952;\n    int64_t sgm_idx_232403 = smod64(blockOff_232402, m_203571);\n    int32_t boundary_232404 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_206952,\n                                                  m_203571 - sgm_idx_232403));\n    int32_t segsizze_compact_232405 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_206952,\n                                                          m_203571));\n    int6",
            "4_t private_mem_232406[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_232408 = 0; i_232408 < (int64_t) 11; i_232408++) {\n            int64_t phys_tid_232409 = blockOff_232402 +\n                    sext_i32_i64(local_tid_232386) + i_232408 *\n                    segscan_group_sizze_206952;\n            int64_t slice_232410 = m_203571;\n            int64_t gtid_206956 = phys_tid_232409;\n            int64_t remnant_232411 = phys_tid_232409 - gtid_206956;\n            \n            if (slt64(phys_tid_232409, m_203571)) {\n                bool defunc_2_reduce_res_203634;\n                bool redout_228738 = 0;\n                \n                for (int64_t i_228739 = 0; i_228739 < n_p_203574; i_228739++) {\n                    for (int64_t i_229013 = 0; i_229013 < defunc_0_f_res_203592;\n                         i_229013++) {\n                        int64_t x_203641 = mul64(n_p_203574, i_229013);\n                        int64_t idx_203642 = add64(x_203641, i_228739);\n                        bool cond_203643 = sle64(n_203572, idx_203642);\n                        bool defunc_0_f_res_203644;\n                        \n                        if (cond_203643) {\n                            defunc_0_f_res_203644 = 1;\n                        } else {\n                            bool x_203645 = sle64((int64_t) 0, idx_203642);\n                            bool y_203646 = slt64(idx_203642, n_203572);\n                            bool bounds_check_203647 = x_203645 && y_203646;\n                            bool index_certs_203648;\n                            \n                            if (!bounds_check_203647) {\n                                {\n                                    if (atomic_cmpxchg_i32_global(global_failure,\n                                                                  -1, 0) ==\n                                        -1) {\n                                        global_failure_args[0] =\n                                            (int64_t) idx_20364",
            "2;\n                                        global_failure_args[1] =\n                                            (int64_t) n_203572;\n                                        ;\n                                    }\n                                    local_failure = true;\n                                    goto error_0;\n                                }\n                            }\n                            \n                            double isnan_arg_203649;\n                            \n                            isnan_arg_203649 = ((__global\n                                                 double *) mem_229242)[idx_203642 *\n                                                                       m_203571 +\n                                                                       gtid_206956];\n                            \n                            bool isnan_res_203650;\n                            \n                            isnan_res_203650 = futrts_isnan64(isnan_arg_203649);\n                            defunc_0_f_res_203644 = isnan_res_203650;\n                        }\n                        ((__global bool *) color_232074)[phys_tid_206957 +\n                                                         i_229013 *\n                                                         num_threads_232195] =\n                            defunc_0_f_res_203644;\n                    }\n                    \n                    bool defunc_2_reduce_res_203652;\n                    bool redout_229015 = 1;\n                    \n                    for (int64_t i_229016 = 0; i_229016 < defunc_0_f_res_203592;\n                         i_229016++) {\n                        bool x_203656;\n                        \n                        x_203656 = ((__global\n                                     bool *) color_232074)[phys_tid_206957 +\n                                                           i_229016 *\n                                                           num_threads_232195];\n                   ",
            "     \n                        bool x_203655 = x_203656 && redout_229015;\n                        bool redout_tmp_232414 = x_203655;\n                        \n                        redout_229015 = redout_tmp_232414;\n                    }\n                    defunc_2_reduce_res_203652 = redout_229015;\n                    \n                    bool defunc_1_op_res_203637 = defunc_2_reduce_res_203652 ||\n                         redout_228738;\n                    bool redout_tmp_232412 = defunc_1_op_res_203637;\n                    \n                    redout_228738 = redout_tmp_232412;\n                }\n                defunc_2_reduce_res_203634 = redout_228738;\n                \n                int64_t defunc_2_lifted_lambda_res_203657 =\n                        btoi_bool_i64(defunc_2_reduce_res_203634);\n                bool is_i_203658 = defunc_2_lifted_lambda_res_203657 ==\n                     (int64_t) 0;\n                bool cond_neg_203659 = !is_i_203658;\n                int64_t part_res_203660 = btoi_bool_i64(cond_neg_203659);\n                int64_t part_res_203661 = btoi_bool_i64(is_i_203658);\n                \n                ((__global int64_t *) mem_229263)[gtid_206956] =\n                    part_res_203660;\n                ((__global bool *) mem_229265)[gtid_206956] =\n                    defunc_2_reduce_res_203634;\n                private_mem_232406[i_232408] = part_res_203661;\n            } else {\n                private_mem_232406[i_232408] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232415 = 0; i_232415 < (int64_t) 11; i_232415++) {\n            int64_t sharedIdx_232416 = sext_i32_i64(local_tid_232386) +\n                    i_232415 * segscan_group_sizze_206952;\n            int64_t tmp_232417;\n            \n            tmp_232417 = private_mem_232406[i_232415];\n            ((__local int64_t *) local_mem_232394)[sharedIdx_232416] =\n                tmp_232417;\n      ",
            "  }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_232418 = 0; i_232418 < 11; i_232418++) {\n            int32_t sharedIdx_232419 = local_tid_232386 * 11 + i_232418;\n            int64_t tmp_232420;\n            \n            tmp_232420 = ((__local\n                           int64_t *) local_mem_232394)[sext_i32_i64(sharedIdx_232419)];\n            private_mem_232406[sext_i32_i64(i_232418)] = tmp_232420;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_232421 = local_tid_232386 * 11 + 1;\n        \n        for (int64_t i_232422 = 0; i_232422 < (int64_t) 10; i_232422++) {\n            int64_t x_203630;\n            int64_t y_203631;\n            \n            x_203630 = private_mem_232406[i_232422];\n            y_203631 = private_mem_232406[i_232422 + (int64_t) 1];\n            \n            int64_t zz_203632 = x_203630 + y_203631;\n            \n            private_mem_232406[i_232422 + (int64_t) 1] = zz_203632;\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_232423;\n        \n        tmp_232423 = private_mem_232406[(int64_t) 10];\n        ((__local int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232386)] =\n            tmp_232423;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_232427;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_232424;\n        int64_t y_232425;\n        int64_t x_232428;\n        int64_t y_232429;\n        bool ltid_in_bounds_232431 = slt64(sext_i32_i64(local_tid_232386),\n                                           segscan_group_sizze_206952);\n        int32_t skip_threads_232432;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_232431) {\n                y_232425 = ((volatile __local\n                             int64_t *) local_mem_232394)[sq",
            "uot64(byte_offsets_232390,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_232386)];\n                if ((local_tid_232386 - squot32(local_tid_232386, 32) * 32) ==\n                    0) {\n                    x_232424 = y_232425;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232432 = 1;\n            while (slt32(skip_threads_232432, 32)) {\n                bool thread_active_232433 = sle32(skip_threads_232432,\n                                                  local_tid_232386 -\n                                                  squot32(local_tid_232386,\n                                                          32) * 32) &&\n                     ltid_in_bounds_232431;\n                \n                if (thread_active_232433) {\n                    // read operands\n                    {\n                        x_232424 = ((volatile __local\n                                     int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_232386) -\n                                                                   sext_i32_i64(skip_threads_232432))];\n                    }\n                }\n                // perform operation\n                {\n                    if (thread_active_232433) {\n                        int64_t zz_232426 = x_232424 + y_232425;\n                        \n                        x_232424 = zz_232426;\n                    }\n                }\n                if (sle32(wave_sizze_232388, skip_threads_232432)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232433) {\n                    // write result\n                    {\n       ",
            "                 ((volatile __local\n                          int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_232386)] =\n                            x_232424;\n                        y_232425 = x_232424;\n                    }\n                }\n                if (sle32(wave_sizze_232388, skip_threads_232432)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232432 *= 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_232386 - squot32(local_tid_232386, 32) * 32) == 31 &&\n                ltid_in_bounds_232431) {\n                ((volatile __local\n                  int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_232386,\n                                                                    32))] =\n                    x_232424;\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_232434;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_232386, 32) == 0 &&\n                    ltid_in_bounds_232431) {\n                    y_232429 = ((volatile __local\n                                 int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_232386)];\n                    if ((local_tid_232386 - squot32(local_tid_232386, 32) *\n  ",
            "                       32) == 0) {\n                        x_232428 = y_232429;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232434 = 1;\n                while (slt32(skip_threads_232434, 32)) {\n                    bool thread_active_232435 = sle32(skip_threads_232434,\n                                                      local_tid_232386 -\n                                                      squot32(local_tid_232386,\n                                                              32) * 32) &&\n                         (squot32(local_tid_232386, 32) == 0 &&\n                          ltid_in_bounds_232431);\n                    \n                    if (thread_active_232435) {\n                        // read operands\n                        {\n                            x_232428 = ((volatile __local\n                                         int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_232386) -\n                                                                       sext_i32_i64(skip_threads_232434))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        if (thread_active_232435) {\n                            int64_t zz_232430 = x_232428 + y_232429;\n                            \n                            x_232428 = zz_232430;\n                        }\n                    }\n                    if (sle32(wave_sizze_232388, skip_threads_232434)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232435) {\n                        // write result\n                        {\n                            ((volatile __local\n          ",
            "                    int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_232386)] =\n                                x_232428;\n                            y_232429 = x_232428;\n                        }\n                    }\n                    if (sle32(wave_sizze_232388, skip_threads_232434)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232434 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_232436 = squot32(local_tid_232386, 32) == 0 ||\n             !ltid_in_bounds_232431;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_232436) {\n                    y_232425 = x_232424;\n                    x_232424 = ((__local\n                                 int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_232386,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                if (!no_carry_in_232436) {\n                    int64_t zz_232426 = x_232424 + y_232425;\n                    \n                    x_232424 = zz_232426;\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_232436) {\n                    ((__local\n                      int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                 ",
            "          (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232386)] =\n                        x_232424;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_232386, 32) == 0 && ltid_in_bounds_232431) {\n                ((__local\n                  int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232386)] =\n                    y_232425;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_232386 == 0) {\n            acc_232427 = ((__local\n                           int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_206952 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_232427 = ((__local\n                           int64_t *) local_mem_232394)[squot64(byte_offsets_232390,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_232386) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_232437 = (int64_t) 0;\n    bool block_new_sgm_232438 = sgm_idx_232403 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_232438 && local_tid_232386 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_232371)[dynamic_id_232401] =\n                acc_232427;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) statu",
            "s_flags_mem_232367)[dynamic_id_232401] =\n                (int8_t) 2;\n            acc_232427 = (int64_t) 0;\n        }\n        if (!block_new_sgm_232438 && slt32(local_tid_232386,\n                                           wave_sizze_232388)) {\n            if (local_tid_232386 == 0) {\n                ((volatile __global\n                  int64_t *) aggregates_mem_232369)[dynamic_id_232401] =\n                    acc_232427;\n                mem_fence_global();\n                ((volatile __global\n                  int8_t *) status_flags_mem_232367)[dynamic_id_232401] =\n                    (int8_t) 1;\n                \n                int8_t tmp_232439;\n                \n                tmp_232439 = ((volatile __global\n                               int8_t *) status_flags_mem_232367)[dynamic_id_232401 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_232394)[(int64_t) 0] =\n                    tmp_232439;\n            }\n            mem_fence_local();\n            \n            int8_t status_232440;\n            \n            status_232440 = ((__local int8_t *) local_mem_232394)[(int64_t) 0];\n            if (status_232440 == (int8_t) 2) {\n                if (local_tid_232386 == 0) {\n                    prefix_232437 = ((volatile __global\n                                      int64_t *) incprefixes_mem_232371)[dynamic_id_232401 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_232441 = dynamic_id_232401 -\n                        sext_i32_i64(wave_sizze_232388);\n                \n                while (slt32(wave_sizze_232388 * -1, readOffset_232441)) {\n                    int32_t read_i_232442 = readOffset_232441 +\n                            local_tid_232386;\n                    int64_t aggr_232443 = (int64_t) 0;\n                    int8_t flag_232444 = (int8_t) 0;\n                    ",
            "\n                    if (sle32(0, read_i_232442)) {\n                        flag_232444 = ((volatile __global\n                                        int8_t *) status_flags_mem_232367)[sext_i32_i64(read_i_232442)];\n                        if (flag_232444 == (int8_t) 2) {\n                            aggr_232443 = ((volatile __global\n                                            int64_t *) incprefixes_mem_232371)[sext_i32_i64(read_i_232442)];\n                        } else {\n                            if (flag_232444 == (int8_t) 1) {\n                                aggr_232443 = ((volatile __global\n                                                int64_t *) aggregates_mem_232369)[sext_i32_i64(read_i_232442)];\n                            }\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232386)] =\n                        aggr_232443;\n                    ((__local\n                      int8_t *) local_mem_232394)[sext_i32_i64(local_tid_232386)] =\n                        flag_232444;\n                    flag_232444 = ((__local\n                                    int8_t *) local_mem_232394)[sext_i32_i64(wave_sizze_232388) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_232444, (int8_t) 2)) {\n                        int8_t flg_x_232448;\n                        int8_t flg_y_232449;\n                        int64_t x_232445;\n                        int64_t y_232446;\n                        int32_t skip_threads_232450;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_232449 = ((volatile __local\n                                             int8_t *) local_mem_232394)[",
            "sext_i32_i64(local_tid_232386)];\n                            y_232446 = ((volatile __local\n                                         int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_232386)];\n                            if ((local_tid_232386 - squot32(local_tid_232386,\n                                                            32) * 32) == 0) {\n                                x_232445 = y_232446;\n                                flg_x_232448 = flg_y_232449;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_232450 = 1;\n                            while (slt32(skip_threads_232450, 32)) {\n                                if (sle32(skip_threads_232450,\n                                          local_tid_232386 -\n                                          squot32(local_tid_232386, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_232448 = ((volatile __local\n                                                         int8_t *) local_mem_232394)[sext_i32_i64(local_tid_232386) -\n                                                                                     sext_i32_i64(skip_threads_232450)];\n                                        x_232445 = ((volatile __local\n                                                     int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_232386) -\n                                                 ",
            "                                  sext_i32_i64(skip_threads_232450))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_232449 == (int8_t) 2 ||\n                                            flg_y_232449 == (int8_t) 0) {\n                                            flg_x_232448 = flg_y_232449;\n                                            x_232445 = y_232446;\n                                        } else {\n                                            int64_t zz_232447 = x_232445 +\n                                                    y_232446;\n                                            \n                                            x_232445 = zz_232447;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_232394)[sext_i32_i64(local_tid_232386)] =\n                                            flg_x_232448;\n                                        flg_y_232449 = flg_x_232448;\n                                        ((volatile __local\n                                          int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_232386)] =\n                                            x_232445;\n                                        y_232446 = x_232445;\n                                    }\n                                }\n                                skip_threads_232450 *= 2;\n                            }\n                        }\n                    }\n                    flag_232444 = ((__local\n                        ",
            "            int8_t *) local_mem_232394)[sext_i32_i64(wave_sizze_232388) -\n                                                                (int64_t) 1];\n                    aggr_232443 = ((__local\n                                    int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_232388) -\n                                                                  (int64_t) 1)];\n                    if (flag_232444 == (int8_t) 2) {\n                        readOffset_232441 = wave_sizze_232388 * -1;\n                    } else {\n                        if (flag_232444 == (int8_t) 1) {\n                            readOffset_232441 -= wave_sizze_232388;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_232444)) {\n                        int64_t x_232451 = aggr_232443;\n                        int64_t y_232452 = prefix_232437;\n                        int64_t zz_232453 = x_232451 + y_232452;\n                        \n                        prefix_232437 = zz_232453;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_232386 == 0) {\n                if (boundary_232404 == sext_i64_i32(segscan_group_sizze_206952 *\n                    (int64_t) 11)) {\n                    int64_t x_232454 = prefix_232437;\n                    int64_t y_232455 = acc_232427;\n                    int64_t zz_232456 = x_232454 + y_232455;\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232371)[dynamic_id_232401] =\n                        zz_232456;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232367)[dynamic_id_232401] =\n                        (int8_t) 2;\n                ",
            "}\n                ((__local\n                  int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                       (int64_t) 8)] =\n                    prefix_232437;\n                acc_232427 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_232401 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_232437 = ((__local\n                              int64_t *) local_mem_232394)[squot64(warp_byte_offset_232392,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_232457;\n        int64_t y_232458;\n        int64_t x_232460 = prefix_232437;\n        int64_t y_232461 = acc_232427;\n        \n        if (slt32(local_tid_232386 * 11, boundary_232404) &&\n            !block_new_sgm_232438) {\n            int64_t zz_232462 = x_232460 + y_232461;\n            \n            x_232457 = zz_232462;\n        } else {\n            x_232457 = acc_232427;\n        }\n        \n        int32_t stopping_point_232463 = segsizze_compact_232405 -\n                srem32(local_tid_232386 * 11 - 1 + segsizze_compact_232405 -\n                       boundary_232404, segsizze_compact_232405);\n        \n        for (int64_t i_232464 = 0; i_232464 < (int64_t) 11; i_232464++) {\n            if (slt32(sext_i64_i32(i_232464), stopping_point_232463 - 1)) {\n                y_232458 = private_mem_232406[i_232464];\n                \n                int64_t zz_232459 = x_232457 + y_232458;\n                \n                private_mem_232406[i_232464] = zz_232459;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_232465 = 0; i_232465 < (int64_t) 11; i_232465++) {\n            int64_t sharedIdx_232466 = sext_i32_i64(local_tid_232386 * 11) +\n                    i_232465;\n            int64_t tmp_232467;\n           ",
            " \n            tmp_232467 = private_mem_232406[i_232465];\n            ((__local int64_t *) local_mem_232394)[sharedIdx_232466] =\n                tmp_232467;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232468 = 0; i_232468 < (int64_t) 11; i_232468++) {\n            int64_t flat_idx_232469 = blockOff_232402 +\n                    segscan_group_sizze_206952 * i_232468 +\n                    sext_i32_i64(local_tid_232386);\n            int64_t slice_232470 = m_203571;\n            int64_t gtid_206956 = flat_idx_232469;\n            int64_t remnant_232471 = flat_idx_232469 - gtid_206956;\n            \n            if (slt64(flat_idx_232469, m_203571)) {\n                int64_t tmp_232472;\n                \n                tmp_232472 = ((__local\n                               int64_t *) local_mem_232394)[flat_idx_232469 -\n                                                            blockOff_232402];\n                ((__global int64_t *) mem_229260)[gtid_206956] = tmp_232472;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_232401 == sdiv_up64(m_203571,\n                                           segscan_group_sizze_206952 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_232365)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_206952\n}\n__kernel void mainzisegscan_207097(__global int *global_failure,\n                                   uint local_mem_232532_backing_offset_0,\n                                   int64_t n_203572,\n                                   int64_t partition_sizze_203667, __global\n                                   unsigned char *mem_229269, __global\n                                   unsigned char *mem_229294, __global\n                                   unsigned char *mainziid_counter_mem_232515,\n                  ",
            "                 __global\n                                   unsigned char *status_flags_mem_232517,\n                                   __global\n                                   unsigned char *aggregates_mem_232519,\n                                   __global\n                                   unsigned char *incprefixes_mem_232521)\n{\n    #define segscan_group_sizze_207091 (mainzisegscan_group_sizze_207071)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_232532_backing_0 =\n                           &shared_mem[local_mem_232532_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232523;\n    int32_t local_tid_232524;\n    int64_t group_sizze_232527;\n    int32_t wave_sizze_232526;\n    int32_t group_tid_232525;\n    \n    global_tid_232523 = get_global_id(0);\n    local_tid_232524 = get_local_id(0);\n    group_sizze_232527 = get_local_size(0);\n    wave_sizze_232526 = LOCKSTEP_WIDTH;\n    group_tid_232525 = get_group_id(0);\n    \n    int32_t phys_tid_207097 = global_tid_232523;\n    int64_t byte_offsets_232528 = (int64_t) 0;\n    int64_t byte_offsets_232529 = segscan_group_sizze_207091 * (int64_t) 8;\n    int64_t warp_byte_offset_232530 = (int64_t) 32;\n    int64_t warp_byte_offset_232531 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_232532;\n    \n    local_mem_232532 = (__local unsigned char *) local_mem_232532_backing_0;\n    \n    int64_t trans_arr_len_232533 = (int64_t) 11 * segscan_group_sizze_207091;\n    int32_t dynamic_id_232539;\n    \n    if (local_tid_232524 == 0) {\n        dynamic_id_232539 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_232515)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_232532)[(int64_t) 0] = dynamic_id_232539;\n    }\n  ",
            "  barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_232539 = ((__local int32_t *) local_mem_232532)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_232540 = sext_i32_i64(dynamic_id_232539) * (int64_t) 11 *\n            segscan_group_sizze_207091;\n    int64_t sgm_idx_232541 = smod64(blockOff_232540, n_203572);\n    int32_t boundary_232542 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_207091,\n                                                  n_203572 - sgm_idx_232541));\n    int32_t segsizze_compact_232543 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_207091,\n                                                          n_203572));\n    int64_t private_mem_232544[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_232546 = 0; i_232546 < (int64_t) 11; i_232546++) {\n            int64_t phys_tid_232547 = blockOff_232540 +\n                    sext_i32_i64(local_tid_232524) + i_232546 *\n                    segscan_group_sizze_207091;\n            int64_t slice_232548 = n_203572;\n            int64_t slice_232549 = partition_sizze_203667 * slice_232548;\n            int64_t gtid_207095 = squot64(phys_tid_232547, slice_232548);\n            int64_t remnant_232550 = phys_tid_232547 - gtid_207095 *\n                    slice_232548;\n            int64_t gtid_207096 = remnant_232550;\n            int64_t remnant_232551 = remnant_232550 - gtid_207096;\n            \n            if (slt64(phys_tid_232547, partition_sizze_203667 * n_203572)) {\n                double x_207102;\n                \n                x_207102 = ((__global double *) mem_229269)[gtid_207095 *\n                                                            n_203572 +\n                                                            gtid_207096];\n                \n                bool isnan_res_207103;\n                \n                isnan_res_207103 = futrts_isnan64(x_20",
            "7102);\n                \n                bool defunc_0_p_res_207104 = !isnan_res_207103;\n                int64_t defunc_0_f_res_207105 =\n                        btoi_bool_i64(defunc_0_p_res_207104);\n                \n                private_mem_232544[i_232546] = defunc_0_f_res_207105;\n            } else {\n                private_mem_232544[i_232546] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232552 = 0; i_232552 < (int64_t) 11; i_232552++) {\n            int64_t sharedIdx_232553 = sext_i32_i64(local_tid_232524) +\n                    i_232552 * segscan_group_sizze_207091;\n            int64_t tmp_232554;\n            \n            tmp_232554 = private_mem_232544[i_232552];\n            ((__local int64_t *) local_mem_232532)[sharedIdx_232553] =\n                tmp_232554;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_232555 = 0; i_232555 < 11; i_232555++) {\n            int32_t sharedIdx_232556 = local_tid_232524 * 11 + i_232555;\n            int64_t tmp_232557;\n            \n            tmp_232557 = ((__local\n                           int64_t *) local_mem_232532)[sext_i32_i64(sharedIdx_232556)];\n            private_mem_232544[sext_i32_i64(i_232555)] = tmp_232557;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_232558 = local_tid_232524 * 11 + 1;\n        \n        for (int64_t i_232559 = 0; i_232559 < (int64_t) 10; i_232559++) {\n            bool new_sgm_232560 = smod32(gidx_232558 + sext_i64_i32(i_232559) -\n                                         boundary_232542,\n                                         segsizze_compact_232543) == 0;\n            \n            if (!new_sgm_232560) {\n                int64_t x_207098;\n                int64_t x_207099;\n                \n                x_207098 = private_mem_232544[i_232559];\n                x_207099 = private_mem_232544[i_232559 + (int64_t) 1];\n          ",
            "      \n                int64_t defunc_1_op_res_207100 = add64(x_207098, x_207099);\n                \n                private_mem_232544[i_232559 + (int64_t) 1] =\n                    defunc_1_op_res_207100;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_232561;\n        \n        tmp_232561 = private_mem_232544[(int64_t) 10];\n        ((__local int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232524)] =\n            tmp_232561;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_232565;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_232562;\n        int64_t x_232563;\n        int64_t x_232566;\n        int64_t x_232567;\n        bool ltid_in_bounds_232569 = slt64(sext_i32_i64(local_tid_232524),\n                                           segscan_group_sizze_207091);\n        int32_t skip_threads_232570;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_232569) {\n                x_232563 = ((volatile __local\n                             int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_232524)];\n                if ((local_tid_232524 - squot32(local_tid_232524, 32) * 32) ==\n                    0) {\n                    x_232562 = x_232563;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232570 = 1;\n            while (slt32(skip_threads_232570, 32)) {\n                bool thread_active_232571 = sle32(skip_threads_232570,\n                                                  local_tid_232524 -\n                                                  squot32(local_tid_232524,\n   ",
            "                                                       32) * 32) &&\n                     ltid_in_bounds_232569;\n                \n                if (thread_active_232571) {\n                    // read operands\n                    {\n                        x_232562 = ((volatile __local\n                                     int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_232524) -\n                                                                   sext_i32_i64(skip_threads_232570))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232572 = slt32(smod32((local_tid_232524 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_232543 -\n                                                        boundary_232542,\n                                                        segsizze_compact_232543),\n                                                 (local_tid_232524 + 1) * 11 -\n                                                 1 - ((local_tid_232524 -\n                                                       skip_threads_232570 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_232571 && inactive_232572) {\n                        x_232562 = x_232563;\n                    }\n                    if (thread_active_232571) {\n                        if (!inactive_232572) {\n                            int64_t defunc_1_op_res_232564 = add64(x_232562,\n                                                                   x_232563);\n                            \n                            x_232562 = defunc_1_op_res_232564;\n                        }\n                    }\n  ",
            "              }\n                if (sle32(wave_sizze_232526, skip_threads_232570)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232571) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_232524)] =\n                            x_232562;\n                        x_232563 = x_232562;\n                    }\n                }\n                if (sle32(wave_sizze_232526, skip_threads_232570)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232570 *= 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_232524 - squot32(local_tid_232524, 32) * 32) == 31 &&\n                ltid_in_bounds_232569) {\n                ((volatile __local\n                  int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_232524,\n                                                                    32))] =\n                    x_232562;\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_232573;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_232524, 32) == 0 &&\n                    ltid_in_bounds_232569) {\n                    x_232567 = ((volatile __local\n                                 int64_t *) local_mem_232532)[squot64(byte_offsets_2325",
            "28,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_232524)];\n                    if ((local_tid_232524 - squot32(local_tid_232524, 32) *\n                         32) == 0) {\n                        x_232566 = x_232567;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232573 = 1;\n                while (slt32(skip_threads_232573, 32)) {\n                    bool thread_active_232574 = sle32(skip_threads_232573,\n                                                      local_tid_232524 -\n                                                      squot32(local_tid_232524,\n                                                              32) * 32) &&\n                         (squot32(local_tid_232524, 32) == 0 &&\n                          ltid_in_bounds_232569);\n                    \n                    if (thread_active_232574) {\n                        // read operands\n                        {\n                            x_232566 = ((volatile __local\n                                         int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_232524) -\n                                                                       sext_i32_i64(skip_threads_232573))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232575 = slt32(smod32((local_tid_232524 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_",
            "232543 -\n                                                            boundary_232542,\n                                                            segsizze_compact_232543),\n                                                     (local_tid_232524 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_232524 -\n                                                        skip_threads_232573) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_232574 && inactive_232575) {\n                            x_232566 = x_232567;\n                        }\n                        if (thread_active_232574) {\n                            if (!inactive_232575) {\n                                int64_t defunc_1_op_res_232568 = add64(x_232566,\n                                                                       x_232567);\n                                \n                                x_232566 = defunc_1_op_res_232568;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232526, skip_threads_232573)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232574) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_232524)] =\n                                x_232566;\n                            x_232567 = x_232566;\n                        }\n                    }\n                    if (sle32(wave_sizze_232526, skip",
            "_threads_232573)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232573 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_232576 = squot32(local_tid_232524, 32) == 0 ||\n             !ltid_in_bounds_232569;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_232576) {\n                    x_232563 = x_232562;\n                    x_232562 = ((__local\n                                 int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_232524,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232577 = slt32(smod32((local_tid_232524 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_232543 -\n                                                    boundary_232542,\n                                                    segsizze_compact_232543),\n                                             (local_tid_232524 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_232524, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_232576) {\n                    if (inactive_232577) {\n                        x_232562 = x_232563;\n                    }\n                }\n                if (!no_carry_in_232576) {\n                    if (!inactive_232577) {\n                        int",
            "64_t defunc_1_op_res_232564 = add64(x_232562,\n                                                               x_232563);\n                        \n                        x_232562 = defunc_1_op_res_232564;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_232576) {\n                    ((__local\n                      int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232524)] =\n                        x_232562;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_232524, 32) == 0 && ltid_in_bounds_232569) {\n                ((__local\n                  int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232524)] =\n                    x_232563;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_232524 == 0) {\n            acc_232565 = ((__local\n                           int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_207091 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_232565 = ((__local\n                           int64_t *) local_mem_232532)[squot64(byte_offsets_232528,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_232524) -\n                                              ",
            "           (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_232578 = (int64_t) 0;\n    bool block_new_sgm_232579 = sgm_idx_232541 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_232579 && local_tid_232524 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_232521)[dynamic_id_232539] =\n                acc_232565;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_232517)[dynamic_id_232539] =\n                (int8_t) 2;\n            acc_232565 = (int64_t) 0;\n        }\n        if (!block_new_sgm_232579 && slt32(local_tid_232524,\n                                           wave_sizze_232526)) {\n            if (local_tid_232524 == 0) {\n                if (boundary_232542 == sext_i64_i32(segscan_group_sizze_207091 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_232519)[dynamic_id_232539] =\n                        acc_232565;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232517)[dynamic_id_232539] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232521)[dynamic_id_232539] =\n                        acc_232565;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232517)[dynamic_id_232539] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_232580;\n                \n                tmp_232580 = ((volatile __global\n                               int8_t *) status_flags_mem_232517)[dynamic_id_232539 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_232532)[(int6",
            "4_t) 0] =\n                    tmp_232580;\n            }\n            mem_fence_local();\n            \n            int8_t status_232581;\n            \n            status_232581 = ((__local int8_t *) local_mem_232532)[(int64_t) 0];\n            if (status_232581 == (int8_t) 2) {\n                if (local_tid_232524 == 0) {\n                    prefix_232578 = ((volatile __global\n                                      int64_t *) incprefixes_mem_232521)[dynamic_id_232539 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_232582 = dynamic_id_232539 -\n                        sext_i32_i64(wave_sizze_232526);\n                \n                while (slt32(wave_sizze_232526 * -1, readOffset_232582)) {\n                    int32_t read_i_232583 = readOffset_232582 +\n                            local_tid_232524;\n                    int64_t aggr_232584 = (int64_t) 0;\n                    int8_t flag_232585 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_232583)) {\n                        if (sle64(blockOff_232540 -\n                                  (sext_i32_i64(read_i_232583 + 1) *\n                                   segscan_group_sizze_207091 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_232541)) {\n                            flag_232585 = ((volatile __global\n                                            int8_t *) status_flags_mem_232517)[sext_i32_i64(read_i_232583)];\n                            if (flag_232585 == (int8_t) 2) {\n                                aggr_232584 = ((volatile __global\n                                                int64_t *) incprefixes_mem_232521)[sext_i32_i64(read_i_232583)];\n                            } else {\n                                if (flag_232585 == (int8_t) 1) {\n                                    aggr_232584 = ((volatile __global\n                                                    ",
            "int64_t *) aggregates_mem_232519)[sext_i32_i64(read_i_232583)];\n                                }\n                            }\n                        } else {\n                            flag_232585 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232524)] =\n                        aggr_232584;\n                    ((__local\n                      int8_t *) local_mem_232532)[sext_i32_i64(local_tid_232524)] =\n                        flag_232585;\n                    flag_232585 = ((__local\n                                    int8_t *) local_mem_232532)[sext_i32_i64(wave_sizze_232526) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_232585, (int8_t) 2)) {\n                        int8_t flg_x_232589;\n                        int8_t flg_y_232590;\n                        int64_t x_232586;\n                        int64_t x_232587;\n                        int32_t skip_threads_232591;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_232590 = ((volatile __local\n                                             int8_t *) local_mem_232532)[sext_i32_i64(local_tid_232524)];\n                            x_232587 = ((volatile __local\n                                         int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_232524)];\n                            if ((local_tid_232524 - squot32(local_tid_232524,\n                                                            32",
            ") * 32) == 0) {\n                                x_232586 = x_232587;\n                                flg_x_232589 = flg_y_232590;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_232591 = 1;\n                            while (slt32(skip_threads_232591, 32)) {\n                                if (sle32(skip_threads_232591,\n                                          local_tid_232524 -\n                                          squot32(local_tid_232524, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_232589 = ((volatile __local\n                                                         int8_t *) local_mem_232532)[sext_i32_i64(local_tid_232524) -\n                                                                                     sext_i32_i64(skip_threads_232591)];\n                                        x_232586 = ((volatile __local\n                                                     int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_232524) -\n                                                                                   sext_i32_i64(skip_threads_232591))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_232590 == (int8_t) 2 ||\n                                            flg_y_232590 == (int8_t) 0) {\n                                            flg_x_232589 = flg_y_232590;\n                                            x_232586 = x_232587;\n                                        ",
            "} else {\n                                            int64_t defunc_1_op_res_232588 =\n                                                    add64(x_232586, x_232587);\n                                            \n                                            x_232586 = defunc_1_op_res_232588;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_232532)[sext_i32_i64(local_tid_232524)] =\n                                            flg_x_232589;\n                                        flg_y_232590 = flg_x_232589;\n                                        ((volatile __local\n                                          int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_232524)] =\n                                            x_232586;\n                                        x_232587 = x_232586;\n                                    }\n                                }\n                                skip_threads_232591 *= 2;\n                            }\n                        }\n                    }\n                    flag_232585 = ((__local\n                                    int8_t *) local_mem_232532)[sext_i32_i64(wave_sizze_232526) -\n                                                                (int64_t) 1];\n                    aggr_232584 = ((__local\n                                    int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_232526) -\n                ",
            "                                                  (int64_t) 1)];\n                    if (flag_232585 == (int8_t) 2) {\n                        readOffset_232582 = wave_sizze_232526 * -1;\n                    } else {\n                        if (flag_232585 == (int8_t) 1) {\n                            readOffset_232582 -= wave_sizze_232526;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_232585)) {\n                        int64_t x_232592 = aggr_232584;\n                        int64_t x_232593 = prefix_232578;\n                        int64_t defunc_1_op_res_232594 = add64(x_232592,\n                                                               x_232593);\n                        \n                        prefix_232578 = defunc_1_op_res_232594;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_232524 == 0) {\n                if (boundary_232542 == sext_i64_i32(segscan_group_sizze_207091 *\n                    (int64_t) 11)) {\n                    int64_t x_232595 = prefix_232578;\n                    int64_t x_232596 = acc_232565;\n                    int64_t defunc_1_op_res_232597 = add64(x_232595, x_232596);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232521)[dynamic_id_232539] =\n                        defunc_1_op_res_232597;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232517)[dynamic_id_232539] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                       (int64_t) 8)] =\n                    prefix_232578;\n                acc_232565 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_232539 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE)",
            ";\n            prefix_232578 = ((__local\n                              int64_t *) local_mem_232532)[squot64(warp_byte_offset_232530,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_232598;\n        int64_t x_232599;\n        int64_t x_232601 = prefix_232578;\n        int64_t x_232602 = acc_232565;\n        \n        if (slt32(local_tid_232524 * 11, boundary_232542) &&\n            !block_new_sgm_232579) {\n            int64_t defunc_1_op_res_232603 = add64(x_232601, x_232602);\n            \n            x_232598 = defunc_1_op_res_232603;\n        } else {\n            x_232598 = acc_232565;\n        }\n        \n        int32_t stopping_point_232604 = segsizze_compact_232543 -\n                srem32(local_tid_232524 * 11 - 1 + segsizze_compact_232543 -\n                       boundary_232542, segsizze_compact_232543);\n        \n        for (int64_t i_232605 = 0; i_232605 < (int64_t) 11; i_232605++) {\n            if (slt32(sext_i64_i32(i_232605), stopping_point_232604 - 1)) {\n                x_232599 = private_mem_232544[i_232605];\n                \n                int64_t defunc_1_op_res_232600 = add64(x_232598, x_232599);\n                \n                private_mem_232544[i_232605] = defunc_1_op_res_232600;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_232606 = 0; i_232606 < (int64_t) 11; i_232606++) {\n            int64_t sharedIdx_232607 = sext_i32_i64(local_tid_232524 * 11) +\n                    i_232606;\n            int64_t tmp_232608;\n            \n            tmp_232608 = private_mem_232544[i_232606];\n            ((__local int64_t *) local_mem_232532)[sharedIdx_232607] =\n                tmp_232608;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232609 = 0; i_232609 < (int64_t) 11; i_232609++) {\n            int64_t flat_idx_",
            "232610 = blockOff_232540 +\n                    segscan_group_sizze_207091 * i_232609 +\n                    sext_i32_i64(local_tid_232524);\n            int64_t slice_232611 = n_203572;\n            int64_t slice_232612 = partition_sizze_203667 * slice_232611;\n            int64_t gtid_207095 = squot64(flat_idx_232610, slice_232611);\n            int64_t remnant_232613 = flat_idx_232610 - gtid_207095 *\n                    slice_232611;\n            int64_t gtid_207096 = remnant_232613;\n            int64_t remnant_232614 = remnant_232613 - gtid_207096;\n            \n            if (slt64(flat_idx_232610, partition_sizze_203667 * n_203572)) {\n                int64_t tmp_232615;\n                \n                tmp_232615 = ((__local\n                               int64_t *) local_mem_232532)[flat_idx_232610 -\n                                                            blockOff_232540];\n                ((__global int64_t *) mem_229294)[gtid_207095 * n_203572 +\n                                                  gtid_207096] = tmp_232615;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_232539 == sdiv_up64(partition_sizze_203667 * n_203572,\n                                           segscan_group_sizze_207091 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_232515)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207091\n}\n__kernel void mainzisegscan_207649(__global int *global_failure,\n                                   uint local_mem_232739_backing_offset_0,\n                                   int64_t n_p_203574,\n                                   int64_t partition_sizze_203667,\n                                   int64_t defunc_0_f_res_203721, __global\n                                   unsigned char *mem_229314, __global\n                                 ",
            "  unsigned char *mem_229358, __global\n                                   unsigned char *mainziid_counter_mem_232722,\n                                   __global\n                                   unsigned char *status_flags_mem_232724,\n                                   __global\n                                   unsigned char *aggregates_mem_232726,\n                                   __global\n                                   unsigned char *incprefixes_mem_232728)\n{\n    #define segscan_group_sizze_207642 (mainzisegscan_group_sizze_207509)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_232739_backing_0 =\n                           &shared_mem[local_mem_232739_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232730;\n    int32_t local_tid_232731;\n    int64_t group_sizze_232734;\n    int32_t wave_sizze_232733;\n    int32_t group_tid_232732;\n    \n    global_tid_232730 = get_global_id(0);\n    local_tid_232731 = get_local_id(0);\n    group_sizze_232734 = get_local_size(0);\n    wave_sizze_232733 = LOCKSTEP_WIDTH;\n    group_tid_232732 = get_group_id(0);\n    \n    int32_t phys_tid_207649 = global_tid_232730;\n    int64_t byte_offsets_232735 = (int64_t) 0;\n    int64_t byte_offsets_232736 = segscan_group_sizze_207642 * (int64_t) 8;\n    int64_t warp_byte_offset_232737 = (int64_t) 32;\n    int64_t warp_byte_offset_232738 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_232739;\n    \n    local_mem_232739 = (__local unsigned char *) local_mem_232739_backing_0;\n    \n    int64_t trans_arr_len_232740 = (int64_t) 11 * segscan_group_sizze_207642;\n    int32_t dynamic_id_232746;\n    \n    if (local_tid_232731 == 0) {\n        dynamic_id_232746 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_232722)[(int64_t) 0],\n              ",
            "                                    (int) 1);\n        ((__local int32_t *) local_mem_232739)[(int64_t) 0] = dynamic_id_232746;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_232746 = ((__local int32_t *) local_mem_232739)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_232747 = sext_i32_i64(dynamic_id_232746) * (int64_t) 11 *\n            segscan_group_sizze_207642;\n    int64_t sgm_idx_232748 = smod64(blockOff_232747, defunc_0_f_res_203721);\n    int32_t boundary_232749 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_207642,\n                                                  defunc_0_f_res_203721 -\n                                                  sgm_idx_232748));\n    int32_t segsizze_compact_232750 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_207642,\n                                                          defunc_0_f_res_203721));\n    int64_t private_mem_232751[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_232753 = 0; i_232753 < (int64_t) 11; i_232753++) {\n            int64_t phys_tid_232754 = blockOff_232747 +\n                    sext_i32_i64(local_tid_232731) + i_232753 *\n                    segscan_group_sizze_207642;\n            int64_t slice_232755 = defunc_0_f_res_203721;\n            int64_t slice_232756 = n_p_203574 * slice_232755;\n            int64_t slice_232757 = partition_sizze_203667 * slice_232756;\n            int64_t gtid_207646 = squot64(phys_tid_232754, slice_232756);\n            int64_t remnant_232758 = phys_tid_232754 - gtid_207646 *\n                    slice_232756;\n            int64_t gtid_207647 = squot64(remnant_232758, slice_232755);\n            int64_t remnant_232759 = remnant_232758 - gtid_207647 *\n                    slice_232755;\n            int64_t gtid_207648 = remnant_232759;\n            int64_t remnant_232760 = remnant_232759 - gtid_207648;\n            ",
            "\n            if (slt64(phys_tid_232754, partition_sizze_203667 * n_p_203574 *\n                      defunc_0_f_res_203721)) {\n                double x_207655;\n                \n                x_207655 = ((__global double *) mem_229314)[gtid_207646 *\n                                                            (defunc_0_f_res_203721 *\n                                                             n_p_203574) +\n                                                            gtid_207647 *\n                                                            defunc_0_f_res_203721 +\n                                                            gtid_207648];\n                \n                bool isnan_res_207656;\n                \n                isnan_res_207656 = futrts_isnan64(x_207655);\n                \n                bool defunc_0_p_res_207657 = !isnan_res_207656;\n                int64_t defunc_0_f_res_207658 =\n                        btoi_bool_i64(defunc_0_p_res_207657);\n                \n                private_mem_232751[i_232753] = defunc_0_f_res_207658;\n            } else {\n                private_mem_232751[i_232753] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232761 = 0; i_232761 < (int64_t) 11; i_232761++) {\n            int64_t sharedIdx_232762 = sext_i32_i64(local_tid_232731) +\n                    i_232761 * segscan_group_sizze_207642;\n            int64_t tmp_232763;\n            \n            tmp_232763 = private_mem_232751[i_232761];\n            ((__local int64_t *) local_mem_232739)[sharedIdx_232762] =\n                tmp_232763;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_232764 = 0; i_232764 < 11; i_232764++) {\n            int32_t sharedIdx_232765 = local_tid_232731 * 11 + i_232764;\n            int64_t tmp_232766;\n            \n            tmp_232766 = ((__local\n                           int64_t *) local_mem_232739)[sext_i32_i64(sharedIdx_232765)];\n    ",
            "        private_mem_232751[sext_i32_i64(i_232764)] = tmp_232766;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_232767 = local_tid_232731 * 11 + 1;\n        \n        for (int64_t i_232768 = 0; i_232768 < (int64_t) 10; i_232768++) {\n            bool new_sgm_232769 = smod32(gidx_232767 + sext_i64_i32(i_232768) -\n                                         boundary_232749,\n                                         segsizze_compact_232750) == 0;\n            \n            if (!new_sgm_232769) {\n                int64_t x_207650;\n                int64_t x_207651;\n                \n                x_207650 = private_mem_232751[i_232768];\n                x_207651 = private_mem_232751[i_232768 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_207652 = add64(x_207650, x_207651);\n                \n                private_mem_232751[i_232768 + (int64_t) 1] =\n                    defunc_1_op_res_207652;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_232770;\n        \n        tmp_232770 = private_mem_232751[(int64_t) 10];\n        ((__local int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232731)] =\n            tmp_232770;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_232774;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_232771;\n        int64_t x_232772;\n        int64_t x_232775;\n        int64_t x_232776;\n        bool ltid_in_bounds_232778 = slt64(sext_i32_i64(local_tid_232731),\n                                           segscan_group_sizze_207642);\n        int32_t skip_threads_232779;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_232778) {\n                x_232772 = ((volatile __local\n                             int64_t *) local_mem_23",
            "2739)[squot64(byte_offsets_232735,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_232731)];\n                if ((local_tid_232731 - squot32(local_tid_232731, 32) * 32) ==\n                    0) {\n                    x_232771 = x_232772;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232779 = 1;\n            while (slt32(skip_threads_232779, 32)) {\n                bool thread_active_232780 = sle32(skip_threads_232779,\n                                                  local_tid_232731 -\n                                                  squot32(local_tid_232731,\n                                                          32) * 32) &&\n                     ltid_in_bounds_232778;\n                \n                if (thread_active_232780) {\n                    // read operands\n                    {\n                        x_232771 = ((volatile __local\n                                     int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_232731) -\n                                                                   sext_i32_i64(skip_threads_232779))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232781 = slt32(smod32((local_tid_232731 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_232750 -\n                                                        boundary_232749,\n                                                        segsizze_compact_232750),\n                                                 (local_tid_232731 + 1) * 11 -\n",
            "                                                 1 - ((local_tid_232731 -\n                                                       skip_threads_232779 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_232780 && inactive_232781) {\n                        x_232771 = x_232772;\n                    }\n                    if (thread_active_232780) {\n                        if (!inactive_232781) {\n                            int64_t defunc_1_op_res_232773 = add64(x_232771,\n                                                                   x_232772);\n                            \n                            x_232771 = defunc_1_op_res_232773;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232733, skip_threads_232779)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232780) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_232731)] =\n                            x_232771;\n                        x_232772 = x_232771;\n                    }\n                }\n                if (sle32(wave_sizze_232733, skip_threads_232779)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232779 *= 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_232731 - squot32(local_tid_232731, 32) * 32) == 31 &&\n                ltid_in_bounds_232778) {\n                ((volatile __local\n                  int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n       ",
            "                                                (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_232731,\n                                                                    32))] =\n                    x_232771;\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_232782;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_232731, 32) == 0 &&\n                    ltid_in_bounds_232778) {\n                    x_232776 = ((volatile __local\n                                 int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_232731)];\n                    if ((local_tid_232731 - squot32(local_tid_232731, 32) *\n                         32) == 0) {\n                        x_232775 = x_232776;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232782 = 1;\n                while (slt32(skip_threads_232782, 32)) {\n                    bool thread_active_232783 = sle32(skip_threads_232782,\n                                                      local_tid_232731 -\n                                                      squot32(local_tid_232731,\n                                                              32) * 32) &&\n                         (squot32(local_tid_232731, 32) == 0 &&\n                          ltid_in_bounds_232778);\n                    \n                    if (thread_active_232783) {\n                        // read operands\n                        {\n                            x_232775 = ((volatile __local\n                                         int64_t *) ",
            "local_mem_232739)[squot64(byte_offsets_232735,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_232731) -\n                                                                       sext_i32_i64(skip_threads_232782))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232784 = slt32(smod32((local_tid_232731 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_232750 -\n                                                            boundary_232749,\n                                                            segsizze_compact_232750),\n                                                     (local_tid_232731 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_232731 -\n                                                        skip_threads_232782) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_232783 && inactive_232784) {\n                            x_232775 = x_232776;\n                        }\n                        if (thread_active_232783) {\n                            if (!inactive_232784) {\n                                int64_t defunc_1_op_res_232777 = add64(x_232775,\n                                                                       x_232776);\n                                \n                                x_232775 = defunc_1_op_res_232777;\n                            }\n                        }\n                  ",
            "  }\n                    if (sle32(wave_sizze_232733, skip_threads_232782)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232783) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_232731)] =\n                                x_232775;\n                            x_232776 = x_232775;\n                        }\n                    }\n                    if (sle32(wave_sizze_232733, skip_threads_232782)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232782 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_232785 = squot32(local_tid_232731, 32) == 0 ||\n             !ltid_in_bounds_232778;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_232785) {\n                    x_232772 = x_232771;\n                    x_232771 = ((__local\n                                 int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_232731,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232786 = slt32(smod32((local_tid_232731 + 1) *\n                                                ",
            "    11 - 1 +\n                                                    segsizze_compact_232750 -\n                                                    boundary_232749,\n                                                    segsizze_compact_232750),\n                                             (local_tid_232731 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_232731, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_232785) {\n                    if (inactive_232786) {\n                        x_232771 = x_232772;\n                    }\n                }\n                if (!no_carry_in_232785) {\n                    if (!inactive_232786) {\n                        int64_t defunc_1_op_res_232773 = add64(x_232771,\n                                                               x_232772);\n                        \n                        x_232771 = defunc_1_op_res_232773;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_232785) {\n                    ((__local\n                      int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232731)] =\n                        x_232771;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_232731, 32) == 0 && ltid_in_bounds_232778) {\n                ((__local\n                  int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_232731)] =\n                    x_232772;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier",
            "(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_232731 == 0) {\n            acc_232774 = ((__local\n                           int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_207642 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_232774 = ((__local\n                           int64_t *) local_mem_232739)[squot64(byte_offsets_232735,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_232731) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_232787 = (int64_t) 0;\n    bool block_new_sgm_232788 = sgm_idx_232748 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_232788 && local_tid_232731 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_232728)[dynamic_id_232746] =\n                acc_232774;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_232724)[dynamic_id_232746] =\n                (int8_t) 2;\n            acc_232774 = (int64_t) 0;\n        }\n        if (!block_new_sgm_232788 && slt32(local_tid_232731,\n                                           wave_sizze_232733)) {\n            if (local_tid_232731 == 0) {\n                if (boundary_232749 == sext_i64_i32(segscan_group_sizze_207642 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_232726)[dynamic_id_232746] =\n                        acc_232774;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232724)[dynamic_id_232746] =\n          ",
            "              (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232728)[dynamic_id_232746] =\n                        acc_232774;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232724)[dynamic_id_232746] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_232789;\n                \n                tmp_232789 = ((volatile __global\n                               int8_t *) status_flags_mem_232724)[dynamic_id_232746 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_232739)[(int64_t) 0] =\n                    tmp_232789;\n            }\n            mem_fence_local();\n            \n            int8_t status_232790;\n            \n            status_232790 = ((__local int8_t *) local_mem_232739)[(int64_t) 0];\n            if (status_232790 == (int8_t) 2) {\n                if (local_tid_232731 == 0) {\n                    prefix_232787 = ((volatile __global\n                                      int64_t *) incprefixes_mem_232728)[dynamic_id_232746 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_232791 = dynamic_id_232746 -\n                        sext_i32_i64(wave_sizze_232733);\n                \n                while (slt32(wave_sizze_232733 * -1, readOffset_232791)) {\n                    int32_t read_i_232792 = readOffset_232791 +\n                            local_tid_232731;\n                    int64_t aggr_232793 = (int64_t) 0;\n                    int8_t flag_232794 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_232792)) {\n                        if (sle64(blockOff_232747 -\n                                  (sext_i32_i64(read_i_232792 + 1) *\n             ",
            "                      segscan_group_sizze_207642 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_232748)) {\n                            flag_232794 = ((volatile __global\n                                            int8_t *) status_flags_mem_232724)[sext_i32_i64(read_i_232792)];\n                            if (flag_232794 == (int8_t) 2) {\n                                aggr_232793 = ((volatile __global\n                                                int64_t *) incprefixes_mem_232728)[sext_i32_i64(read_i_232792)];\n                            } else {\n                                if (flag_232794 == (int8_t) 1) {\n                                    aggr_232793 = ((volatile __global\n                                                    int64_t *) aggregates_mem_232726)[sext_i32_i64(read_i_232792)];\n                                }\n                            }\n                        } else {\n                            flag_232794 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_232731)] =\n                        aggr_232793;\n                    ((__local\n                      int8_t *) local_mem_232739)[sext_i32_i64(local_tid_232731)] =\n                        flag_232794;\n                    flag_232794 = ((__local\n                                    int8_t *) local_mem_232739)[sext_i32_i64(wave_sizze_232733) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_232794, (int8_t) 2)) {\n                        int8_t flg_x_232798;\n                        int8_t flg_y_232799;\n                        int64_t x_232795;\n                        int64_t x_232796;\n                        int32_t skip_threads_232800;\n   ",
            "                     \n                        // read input for in-block scan\n                        {\n                            flg_y_232799 = ((volatile __local\n                                             int8_t *) local_mem_232739)[sext_i32_i64(local_tid_232731)];\n                            x_232796 = ((volatile __local\n                                         int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_232731)];\n                            if ((local_tid_232731 - squot32(local_tid_232731,\n                                                            32) * 32) == 0) {\n                                x_232795 = x_232796;\n                                flg_x_232798 = flg_y_232799;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_232800 = 1;\n                            while (slt32(skip_threads_232800, 32)) {\n                                if (sle32(skip_threads_232800,\n                                          local_tid_232731 -\n                                          squot32(local_tid_232731, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_232798 = ((volatile __local\n                                                         int8_t *) local_mem_232739)[sext_i32_i64(local_tid_232731) -\n                                                                                     sext_i32_i64(skip_threads_232800)];\n                                        x_232795 = ((volatile __local\n                                                     int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                               ",
            "                                                           (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_232731) -\n                                                                                   sext_i32_i64(skip_threads_232800))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_232799 == (int8_t) 2 ||\n                                            flg_y_232799 == (int8_t) 0) {\n                                            flg_x_232798 = flg_y_232799;\n                                            x_232795 = x_232796;\n                                        } else {\n                                            int64_t defunc_1_op_res_232797 =\n                                                    add64(x_232795, x_232796);\n                                            \n                                            x_232795 = defunc_1_op_res_232797;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_232739)[sext_i32_i64(local_tid_232731)] =\n                                            flg_x_232798;\n                                        flg_y_232799 = flg_x_232798;\n                                        ((volatile __local\n                                          int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_232731)] =\n                                            x_232795;\n                                        x_232796 = x_232795;\n     ",
            "                               }\n                                }\n                                skip_threads_232800 *= 2;\n                            }\n                        }\n                    }\n                    flag_232794 = ((__local\n                                    int8_t *) local_mem_232739)[sext_i32_i64(wave_sizze_232733) -\n                                                                (int64_t) 1];\n                    aggr_232793 = ((__local\n                                    int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_232733) -\n                                                                  (int64_t) 1)];\n                    if (flag_232794 == (int8_t) 2) {\n                        readOffset_232791 = wave_sizze_232733 * -1;\n                    } else {\n                        if (flag_232794 == (int8_t) 1) {\n                            readOffset_232791 -= wave_sizze_232733;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_232794)) {\n                        int64_t x_232801 = aggr_232793;\n                        int64_t x_232802 = prefix_232787;\n                        int64_t defunc_1_op_res_232803 = add64(x_232801,\n                                                               x_232802);\n                        \n                        prefix_232787 = defunc_1_op_res_232803;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_232731 == 0) {\n                if (boundary_232749 == sext_i64_i32(segscan_group_sizze_207642 *\n                    (int64_t) 11)) {\n                    int64_t x_232804 = prefix_232787;\n                    int64_t x_232805 = acc_232774;\n                    int64_t defunc_1_op_res_232806 = add64(x_232804, x_232805);",
            "\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_232728)[dynamic_id_232746] =\n                        defunc_1_op_res_232806;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_232724)[dynamic_id_232746] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                                                       (int64_t) 8)] =\n                    prefix_232787;\n                acc_232774 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_232746 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_232787 = ((__local\n                              int64_t *) local_mem_232739)[squot64(warp_byte_offset_232737,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_232807;\n        int64_t x_232808;\n        int64_t x_232810 = prefix_232787;\n        int64_t x_232811 = acc_232774;\n        \n        if (slt32(local_tid_232731 * 11, boundary_232749) &&\n            !block_new_sgm_232788) {\n            int64_t defunc_1_op_res_232812 = add64(x_232810, x_232811);\n            \n            x_232807 = defunc_1_op_res_232812;\n        } else {\n            x_232807 = acc_232774;\n        }\n        \n        int32_t stopping_point_232813 = segsizze_compact_232750 -\n                srem32(local_tid_232731 * 11 - 1 + segsizze_compact_232750 -\n                       boundary_232749, segsizze_compact_232750);\n        \n        for (int64_t i_232814 = 0; i_232814 < (int64_t) 11; i_232814++) {\n            if (slt32(sext_i64_i32(i_232814), stopping_point_232813 - 1)) {\n                x_232808 = private_mem_232751[i_232814];\n                \n                int64_t defunc_1_op_res_23",
            "2809 = add64(x_232807, x_232808);\n                \n                private_mem_232751[i_232814] = defunc_1_op_res_232809;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_232815 = 0; i_232815 < (int64_t) 11; i_232815++) {\n            int64_t sharedIdx_232816 = sext_i32_i64(local_tid_232731 * 11) +\n                    i_232815;\n            int64_t tmp_232817;\n            \n            tmp_232817 = private_mem_232751[i_232815];\n            ((__local int64_t *) local_mem_232739)[sharedIdx_232816] =\n                tmp_232817;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_232818 = 0; i_232818 < (int64_t) 11; i_232818++) {\n            int64_t flat_idx_232819 = blockOff_232747 +\n                    segscan_group_sizze_207642 * i_232818 +\n                    sext_i32_i64(local_tid_232731);\n            int64_t slice_232820 = defunc_0_f_res_203721;\n            int64_t slice_232821 = n_p_203574 * slice_232820;\n            int64_t slice_232822 = partition_sizze_203667 * slice_232821;\n            int64_t gtid_207646 = squot64(flat_idx_232819, slice_232821);\n            int64_t remnant_232823 = flat_idx_232819 - gtid_207646 *\n                    slice_232821;\n            int64_t gtid_207647 = squot64(remnant_232823, slice_232820);\n            int64_t remnant_232824 = remnant_232823 - gtid_207647 *\n                    slice_232820;\n            int64_t gtid_207648 = remnant_232824;\n            int64_t remnant_232825 = remnant_232824 - gtid_207648;\n            \n            if (slt64(flat_idx_232819, partition_sizze_203667 * n_p_203574 *\n                      defunc_0_f_res_203721)) {\n                int64_t tmp_232826;\n                \n                tmp_232826 = ((__local\n                               int64_t *) local_mem_232739)[flat_idx_232819 -\n                                                            blockOff_232747];\n                ((__global int64_t *) mem_2",
            "29358)[gtid_207646 *\n                                                  (defunc_0_f_res_203721 *\n                                                   n_p_203574) + gtid_207647 *\n                                                  defunc_0_f_res_203721 +\n                                                  gtid_207648] = tmp_232826;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_232746 == sdiv_up64(partition_sizze_203667 * n_p_203574 *\n                                           defunc_0_f_res_203721,\n                                           segscan_group_sizze_207642 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_232722)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207642\n}\n__kernel void mainzisegscan_218773(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_234427_backing_offset_0,\n                                   int64_t n_p_203574, double i64_res_203589,\n                                   int64_t partition_sizze_203667,\n                                   int64_t C_len_203724,\n                                   int64_t lifted_single_ma_l_arg_204224,\n                                   __global unsigned char *mem_230608, __global\n                                   unsigned char *ext_mem_230620, __global\n                                   unsigned char *mem_230625, __global\n                                   unsigned char *mainziid_counter_mem_234410,\n                                   __global\n                                   unsigned char *status_flags_mem_234412,\n                                   __global\n                                   unsigned char *aggregates_mem_2344",
            "14,\n                                   __global\n                                   unsigned char *incprefixes_mem_234416)\n{\n    #define segscan_group_sizze_218767 (mainzisegscan_group_sizze_218731)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_234427_backing_0 =\n                           &shared_mem[local_mem_234427_backing_offset_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_234418;\n    int32_t local_tid_234419;\n    int64_t group_sizze_234422;\n    int32_t wave_sizze_234421;\n    int32_t group_tid_234420;\n    \n    global_tid_234418 = get_global_id(0);\n    local_tid_234419 = get_local_id(0);\n    group_sizze_234422 = get_local_size(0);\n    wave_sizze_234421 = LOCKSTEP_WIDTH;\n    group_tid_234420 = get_group_id(0);\n    \n    int32_t phys_tid_218773 = global_tid_234418;\n    int64_t byte_offsets_234423 = (int64_t) 0;\n    int64_t byte_offsets_234424 = segscan_group_sizze_218767 * (int64_t) 8;\n    int64_t warp_byte_offset_234425 = (int64_t) 32;\n    int64_t warp_byte_offset_234426 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_234427;\n    \n    local_mem_234427 = (__local unsigned char *) local_mem_234427_backing_0;\n    \n    int64_t trans_arr_len_234428 = (int64_t) 11 * segscan_group_sizze_218767;\n    int32_t dynamic_id_234434;\n    \n    if (local_tid_234419 == 0) {\n        dynamic_id_234434 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_234410)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_234427)[(int64_t) 0] = dynamic_id_234434;\n    }\n    barrier(CLK_LOCAL_MEM_FENC",
            "E);\n    dynamic_id_234434 = ((__local int32_t *) local_mem_234427)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_234435 = sext_i32_i64(dynamic_id_234434) * (int64_t) 11 *\n            segscan_group_sizze_218767;\n    int64_t sgm_idx_234436 = smod64(blockOff_234435,\n                                    lifted_single_ma_l_arg_204224);\n    int32_t boundary_234437 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_218767,\n                                                  lifted_single_ma_l_arg_204224 -\n                                                  sgm_idx_234436));\n    int32_t segsizze_compact_234438 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_218767,\n                                                          lifted_single_ma_l_arg_204224));\n    double private_mem_234439[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_234441 = 0; i_234441 < (int64_t) 11; i_234441++) {\n            int64_t phys_tid_234442 = blockOff_234435 +\n                    sext_i32_i64(local_tid_234419) + i_234441 *\n                    segscan_group_sizze_218767;\n            int64_t slice_234443 = lifted_single_ma_l_arg_204224;\n            int64_t slice_234444 = partition_sizze_203667 * slice_234443;\n            int64_t gtid_218771 = squot64(phys_tid_234442, slice_234443);\n            int64_t remnant_234445 = phys_tid_234442 - gtid_218771 *\n                    slice_234443;\n            int64_t gtid_218772 = remnant_234445;\n            int64_t remnant_234446 = remnant_234445 - gtid_218772;\n            \n            if (slt64(phys_tid_234442, partition_sizze_203667 *\n                      lifted_single_ma_l_arg_204224)) {\n                bool cond_218780 = gtid_218772 == (int64_t) 0;\n                double defunc_0_f_res_218781;\n                \n                if (cond_218780) {\n                    double x_218778;\n              ",
            "      \n                    x_218778 = ((__global\n                                 double *) ext_mem_230620)[gtid_218771];\n                    \n                    double defunc_0_f_res_t_res_218782 = x_218778 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218781 = defunc_0_f_res_t_res_218782;\n                } else {\n                    int64_t x_218783 = add64(n_p_203574, gtid_218772);\n                    int64_t i_218784 = sub64(x_218783, (int64_t) 1);\n                    bool x_218785 = sle64((int64_t) 0, i_218784);\n                    bool y_218786 = slt64(i_218784, C_len_203724);\n                    bool bounds_check_218787 = x_218785 && y_218786;\n                    bool index_certs_218788;\n                    \n                    if (!bounds_check_218787) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          44) == -1) {\n                                global_failure_args[0] = (int64_t) i_218784;\n                                global_failure_args[1] = (int64_t) C_len_203724;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218789;\n                    \n                    x_218789 = ((__global double *) mem_230608)[gtid_218771 *\n                                                                C_len_203724 +\n                                                                i_218784];\n                    \n                    int64_t i_218790 = sub64(gtid_218772, (int64_t) 1);\n                    bool x_218791 = sle64((int64_t) 0, i_218790);\n                    bool y_218792 = slt64(i_218790, C_len_203724);\n                    bool bounds_check_218793 = x_218791 && y_218792;\n                    bool ind",
            "ex_certs_218794;\n                    \n                    if (!bounds_check_218793) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          45) == -1) {\n                                global_failure_args[0] = (int64_t) i_218790;\n                                global_failure_args[1] = (int64_t) C_len_203724;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218795;\n                    \n                    y_218795 = ((__global double *) mem_230608)[gtid_218771 *\n                                                                C_len_203724 +\n                                                                i_218790];\n                    \n                    double x_218796 = x_218789 - y_218795;\n                    double defunc_0_f_res_f_res_218797 = x_218796 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218781 = defunc_0_f_res_f_res_218797;\n                }\n                private_mem_234439[i_234441] = defunc_0_f_res_218781;\n            } else {\n                private_mem_234439[i_234441] = 0.0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234447 = 0; i_234447 < (int64_t) 11; i_234447++) {\n            int64_t sharedIdx_234448 = sext_i32_i64(local_tid_234419) +\n                    i_234447 * segscan_group_sizze_218767;\n            double tmp_234449;\n            \n            tmp_234449 = private_mem_234439[i_234447];\n            ((__local double *) local_mem_234427)[sharedIdx_234448] =\n                tmp_234449;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_234450 = 0; i_234450 < 11; i_234450++) {\n   ",
            "         int32_t sharedIdx_234451 = local_tid_234419 * 11 + i_234450;\n            double tmp_234452;\n            \n            tmp_234452 = ((__local\n                           double *) local_mem_234427)[sext_i32_i64(sharedIdx_234451)];\n            private_mem_234439[sext_i32_i64(i_234450)] = tmp_234452;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_234453 = local_tid_234419 * 11 + 1;\n        \n        for (int64_t i_234454 = 0; i_234454 < (int64_t) 10; i_234454++) {\n            bool new_sgm_234455 = smod32(gidx_234453 + sext_i64_i32(i_234454) -\n                                         boundary_234437,\n                                         segsizze_compact_234438) == 0;\n            \n            if (!new_sgm_234455) {\n                double x_218774;\n                double x_218775;\n                \n                x_218774 = private_mem_234439[i_234454];\n                x_218775 = private_mem_234439[i_234454 + (int64_t) 1];\n                \n                double defunc_1_op_res_218776 = x_218774 + x_218775;\n                \n                private_mem_234439[i_234454 + (int64_t) 1] =\n                    defunc_1_op_res_218776;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        double tmp_234456;\n        \n        tmp_234456 = private_mem_234439[(int64_t) 10];\n        ((__local double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234419)] =\n            tmp_234456;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double acc_234460;\n    \n    // Scan results (with warp scan)\n    {\n        double x_234457;\n        double x_234458;\n        double x_234461;\n        double x_234462;\n        bool ltid_in_bounds_234464 = slt64(sext_i32_i64(local_tid_234419),\n                                           segscan_group_sizze_218767);\n        int3",
            "2_t skip_threads_234465;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_234464) {\n                x_234458 = ((volatile __local\n                             double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                                 (int64_t) 8) +\n                                                         sext_i32_i64(local_tid_234419)];\n                if ((local_tid_234419 - squot32(local_tid_234419, 32) * 32) ==\n                    0) {\n                    x_234457 = x_234458;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234465 = 1;\n            while (slt32(skip_threads_234465, 32)) {\n                bool thread_active_234466 = sle32(skip_threads_234465,\n                                                  local_tid_234419 -\n                                                  squot32(local_tid_234419,\n                                                          32) * 32) &&\n                     ltid_in_bounds_234464;\n                \n                if (thread_active_234466) {\n                    // read operands\n                    {\n                        x_234457 = ((volatile __local\n                                     double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(local_tid_234419) -\n                                                                  sext_i32_i64(skip_threads_234465))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234467 = slt32(smod32((local_tid_234419 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_234438 -\n                  ",
            "                                      boundary_234437,\n                                                        segsizze_compact_234438),\n                                                 (local_tid_234419 + 1) * 11 -\n                                                 1 - ((local_tid_234419 -\n                                                       skip_threads_234465 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_234466 && inactive_234467) {\n                        x_234457 = x_234458;\n                    }\n                    if (thread_active_234466) {\n                        if (!inactive_234467) {\n                            double defunc_1_op_res_234459 = x_234457 + x_234458;\n                            \n                            x_234457 = defunc_1_op_res_234459;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234421, skip_threads_234465)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234466) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_234419)] =\n                            x_234457;\n                        x_234458 = x_234457;\n                    }\n                }\n                if (sle32(wave_sizze_234421, skip_threads_234465)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234465 *= 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_234419 - squot32(local_tid_234419, 32) * 32) == 31 &&\n                ltid",
            "_in_bounds_234464) {\n                ((volatile __local\n                  double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_234419,\n                                                                   32))] =\n                    x_234457;\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_234468;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_234419, 32) == 0 &&\n                    ltid_in_bounds_234464) {\n                    x_234462 = ((volatile __local\n                                 double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                                     (int64_t) 8) +\n                                                             sext_i32_i64(local_tid_234419)];\n                    if ((local_tid_234419 - squot32(local_tid_234419, 32) *\n                         32) == 0) {\n                        x_234461 = x_234462;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234468 = 1;\n                while (slt32(skip_threads_234468, 32)) {\n                    bool thread_active_234469 = sle32(skip_threads_234468,\n                                                      local_tid_234419 -\n                                                      squot32(local_tid_234419,\n                                                              32) * 32) &&\n                         (squot32(local_tid_234419, 32) == 0 &&\n                          ltid_in_bounds_234464);\n                    \n                    if (thread_active_234469) {\n                        // read operands\n    ",
            "                    {\n                            x_234461 = ((volatile __local\n                                         double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                                             (int64_t) 8) +\n                                                                     (sext_i32_i64(local_tid_234419) -\n                                                                      sext_i32_i64(skip_threads_234468))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234470 = slt32(smod32((local_tid_234419 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_234438 -\n                                                            boundary_234437,\n                                                            segsizze_compact_234438),\n                                                     (local_tid_234419 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_234419 -\n                                                        skip_threads_234468) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_234469 && inactive_234470) {\n                            x_234461 = x_234462;\n                        }\n                        if (thread_active_234469) {\n                            if (!inactive_234470) {\n                                double defunc_1_op_res_234463 = x_234461 +\n                                       x_234462;\n                                \n                                x_234461 = defunc_1_",
            "op_res_234463;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234421, skip_threads_234468)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234469) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_234419)] =\n                                x_234461;\n                            x_234462 = x_234461;\n                        }\n                    }\n                    if (sle32(wave_sizze_234421, skip_threads_234468)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234468 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_234471 = squot32(local_tid_234419, 32) == 0 ||\n             !ltid_in_bounds_234464;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_234471) {\n                    x_234458 = x_234457;\n                    x_234457 = ((__local\n                                 double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                                     (int64_t) 8) +\n                                                             (sext_i32_i64(squot32(local_tid_234419,\n                                                                                   32)) -\n                                                              (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234472 = slt32",
            "(smod32((local_tid_234419 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_234438 -\n                                                    boundary_234437,\n                                                    segsizze_compact_234438),\n                                             (local_tid_234419 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_234419, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_234471) {\n                    if (inactive_234472) {\n                        x_234457 = x_234458;\n                    }\n                }\n                if (!no_carry_in_234471) {\n                    if (!inactive_234472) {\n                        double defunc_1_op_res_234459 = x_234457 + x_234458;\n                        \n                        x_234457 = defunc_1_op_res_234459;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_234471) {\n                    ((__local\n                      double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234419)] =\n                        x_234457;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_234419, 32) == 0 && ltid_in_bounds_234464) {\n                ((__local\n                  double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234419)] =\n                    x_234458;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        ba",
            "rrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_234419 == 0) {\n            acc_234460 = ((__local\n                           double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                               (int64_t) 8) +\n                                                       (segscan_group_sizze_218767 -\n                                                        (int64_t) 1)];\n        } else {\n            acc_234460 = ((__local\n                           double *) local_mem_234427)[squot64(byte_offsets_234423,\n                                                               (int64_t) 8) +\n                                                       (sext_i32_i64(local_tid_234419) -\n                                                        (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double prefix_234473 = 0.0;\n    bool block_new_sgm_234474 = sgm_idx_234436 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_234474 && local_tid_234419 == 0) {\n            ((volatile __global\n              double *) incprefixes_mem_234416)[dynamic_id_234434] = acc_234460;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_234412)[dynamic_id_234434] =\n                (int8_t) 2;\n            acc_234460 = 0.0;\n        }\n        if (!block_new_sgm_234474 && slt32(local_tid_234419,\n                                           wave_sizze_234421)) {\n            if (local_tid_234419 == 0) {\n                if (boundary_234437 == sext_i64_i32(segscan_group_sizze_218767 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      double *) aggregates_mem_234414)[dynamic_id_234434] =\n                        acc_234460;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234412)[dynamic_id_234434] =\n                        (int8_t) 1;\n            ",
            "    } else {\n                    ((volatile __global\n                      double *) incprefixes_mem_234416)[dynamic_id_234434] =\n                        acc_234460;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234412)[dynamic_id_234434] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_234475;\n                \n                tmp_234475 = ((volatile __global\n                               int8_t *) status_flags_mem_234412)[dynamic_id_234434 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_234427)[(int64_t) 0] =\n                    tmp_234475;\n            }\n            mem_fence_local();\n            \n            int8_t status_234476;\n            \n            status_234476 = ((__local int8_t *) local_mem_234427)[(int64_t) 0];\n            if (status_234476 == (int8_t) 2) {\n                if (local_tid_234419 == 0) {\n                    prefix_234473 = ((volatile __global\n                                      double *) incprefixes_mem_234416)[dynamic_id_234434 -\n                                                                        (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_234477 = dynamic_id_234434 -\n                        sext_i32_i64(wave_sizze_234421);\n                \n                while (slt32(wave_sizze_234421 * -1, readOffset_234477)) {\n                    int32_t read_i_234478 = readOffset_234477 +\n                            local_tid_234419;\n                    double aggr_234479 = 0.0;\n                    int8_t flag_234480 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_234478)) {\n                        if (sle64(blockOff_234435 -\n                                  (sext_i32_i64(read_i_234478 + 1) *\n                                   segscan_group_sizze_218767 *",
            " (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_234436)) {\n                            flag_234480 = ((volatile __global\n                                            int8_t *) status_flags_mem_234412)[sext_i32_i64(read_i_234478)];\n                            if (flag_234480 == (int8_t) 2) {\n                                aggr_234479 = ((volatile __global\n                                                double *) incprefixes_mem_234416)[sext_i32_i64(read_i_234478)];\n                            } else {\n                                if (flag_234480 == (int8_t) 1) {\n                                    aggr_234479 = ((volatile __global\n                                                    double *) aggregates_mem_234414)[sext_i32_i64(read_i_234478)];\n                                }\n                            }\n                        } else {\n                            flag_234480 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234419)] =\n                        aggr_234479;\n                    ((__local\n                      int8_t *) local_mem_234427)[sext_i32_i64(local_tid_234419)] =\n                        flag_234480;\n                    flag_234480 = ((__local\n                                    int8_t *) local_mem_234427)[sext_i32_i64(wave_sizze_234421) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_234480, (int8_t) 2)) {\n                        int8_t flg_x_234484;\n                        int8_t flg_y_234485;\n                        double x_234481;\n                        double x_234482;\n                        int32_t skip_threads_234486;\n                        \n                        // read inp",
            "ut for in-block scan\n                        {\n                            flg_y_234485 = ((volatile __local\n                                             int8_t *) local_mem_234427)[sext_i32_i64(local_tid_234419)];\n                            x_234482 = ((volatile __local\n                                         double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                                             (int64_t) 8) +\n                                                                     sext_i32_i64(local_tid_234419)];\n                            if ((local_tid_234419 - squot32(local_tid_234419,\n                                                            32) * 32) == 0) {\n                                x_234481 = x_234482;\n                                flg_x_234484 = flg_y_234485;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_234486 = 1;\n                            while (slt32(skip_threads_234486, 32)) {\n                                if (sle32(skip_threads_234486,\n                                          local_tid_234419 -\n                                          squot32(local_tid_234419, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_234484 = ((volatile __local\n                                                         int8_t *) local_mem_234427)[sext_i32_i64(local_tid_234419) -\n                                                                                     sext_i32_i64(skip_threads_234486)];\n                                        x_234481 = ((volatile __local\n                                                     double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                                                         (in",
            "t64_t) 8) +\n                                                                                 (sext_i32_i64(local_tid_234419) -\n                                                                                  sext_i32_i64(skip_threads_234486))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_234485 == (int8_t) 2 ||\n                                            flg_y_234485 == (int8_t) 0) {\n                                            flg_x_234484 = flg_y_234485;\n                                            x_234481 = x_234482;\n                                        } else {\n                                            double defunc_1_op_res_234483 =\n                                                   x_234481 + x_234482;\n                                            \n                                            x_234481 = defunc_1_op_res_234483;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_234427)[sext_i32_i64(local_tid_234419)] =\n                                            flg_x_234484;\n                                        flg_y_234485 = flg_x_234484;\n                                        ((volatile __local\n                                          double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_234419)] =\n                                            x_234481;\n                                        x_234482 = x_234481;\n                                    }\n                                }\n        ",
            "                        skip_threads_234486 *= 2;\n                            }\n                        }\n                    }\n                    flag_234480 = ((__local\n                                    int8_t *) local_mem_234427)[sext_i32_i64(wave_sizze_234421) -\n                                                                (int64_t) 1];\n                    aggr_234479 = ((__local\n                                    double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(wave_sizze_234421) -\n                                                                 (int64_t) 1)];\n                    if (flag_234480 == (int8_t) 2) {\n                        readOffset_234477 = wave_sizze_234421 * -1;\n                    } else {\n                        if (flag_234480 == (int8_t) 1) {\n                            readOffset_234477 -= wave_sizze_234421;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_234480)) {\n                        double x_234487 = aggr_234479;\n                        double x_234488 = prefix_234473;\n                        double defunc_1_op_res_234489 = x_234487 + x_234488;\n                        \n                        prefix_234473 = defunc_1_op_res_234489;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_234419 == 0) {\n                if (boundary_234437 == sext_i64_i32(segscan_group_sizze_218767 *\n                    (int64_t) 11)) {\n                    double x_234490 = prefix_234473;\n                    double x_234491 = acc_234460;\n                    double defunc_1_op_res_234492 = x_234490 + x_234491;\n                    \n                    ((volatile __global\n                      double *) incprefixes_mem_234416)[dynamic_id_234434] =\n                     ",
            "   defunc_1_op_res_234492;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234412)[dynamic_id_234434] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                      (int64_t) 8)] =\n                    prefix_234473;\n                acc_234460 = 0.0;\n            }\n        }\n        if (!(dynamic_id_234434 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_234473 = ((__local\n                              double *) local_mem_234427)[squot64(warp_byte_offset_234425,\n                                                                  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        double x_234493;\n        double x_234494;\n        double x_234496 = prefix_234473;\n        double x_234497 = acc_234460;\n        \n        if (slt32(local_tid_234419 * 11, boundary_234437) &&\n            !block_new_sgm_234474) {\n            double defunc_1_op_res_234498 = x_234496 + x_234497;\n            \n            x_234493 = defunc_1_op_res_234498;\n        } else {\n            x_234493 = acc_234460;\n        }\n        \n        int32_t stopping_point_234499 = segsizze_compact_234438 -\n                srem32(local_tid_234419 * 11 - 1 + segsizze_compact_234438 -\n                       boundary_234437, segsizze_compact_234438);\n        \n        for (int64_t i_234500 = 0; i_234500 < (int64_t) 11; i_234500++) {\n            if (slt32(sext_i64_i32(i_234500), stopping_point_234499 - 1)) {\n                x_234494 = private_mem_234439[i_234500];\n                \n                double defunc_1_op_res_234495 = x_234493 + x_234494;\n                \n                private_mem_234439[i_234500] = defunc_1_op_res_234495;\n            }\n        }\n    }\n    // Transpose scan output and Write ",
            "it to global memory in coalesced fashion\n    {\n        for (int64_t i_234501 = 0; i_234501 < (int64_t) 11; i_234501++) {\n            int64_t sharedIdx_234502 = sext_i32_i64(local_tid_234419 * 11) +\n                    i_234501;\n            double tmp_234503;\n            \n            tmp_234503 = private_mem_234439[i_234501];\n            ((__local double *) local_mem_234427)[sharedIdx_234502] =\n                tmp_234503;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234504 = 0; i_234504 < (int64_t) 11; i_234504++) {\n            int64_t flat_idx_234505 = blockOff_234435 +\n                    segscan_group_sizze_218767 * i_234504 +\n                    sext_i32_i64(local_tid_234419);\n            int64_t slice_234506 = lifted_single_ma_l_arg_204224;\n            int64_t slice_234507 = partition_sizze_203667 * slice_234506;\n            int64_t gtid_218771 = squot64(flat_idx_234505, slice_234506);\n            int64_t remnant_234508 = flat_idx_234505 - gtid_218771 *\n                    slice_234506;\n            int64_t gtid_218772 = remnant_234508;\n            int64_t remnant_234509 = remnant_234508 - gtid_218772;\n            \n            if (slt64(flat_idx_234505, partition_sizze_203667 *\n                      lifted_single_ma_l_arg_204224)) {\n                double tmp_234510;\n                \n                tmp_234510 = ((__local\n                               double *) local_mem_234427)[flat_idx_234505 -\n                                                           blockOff_234435];\n                ((__global double *) mem_230625)[gtid_218771 *\n                                                 lifted_single_ma_l_arg_204224 +\n                                                 gtid_218772] = tmp_234510;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_234434 == sdiv_up64(partition_sizze_203667 *\n                                           lifted_single_",
            "ma_l_arg_204224,\n                                           segscan_group_sizze_218767 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_234410)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218767\n}\n__kernel void mainzisegscan_218904(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_234608_backing_offset_0,\n                                   int64_t n_p_203574, double i64_res_203589,\n                                   int64_t partition_sizze_203667,\n                                   int64_t lifted_single_ma_l_arg_204224,\n                                   int64_t dyn_lifted_single_ma_l_arg_204234,\n                                   __global unsigned char *mem_230625, __global\n                                   unsigned char *ext_mem_230637, __global\n                                   unsigned char *mem_230642, __global\n                                   unsigned char *mainziid_counter_mem_234591,\n                                   __global\n                                   unsigned char *status_flags_mem_234593,\n                                   __global\n                                   unsigned char *aggregates_mem_234595,\n                                   __global\n                                   unsigned char *incprefixes_mem_234597)\n{\n    #define segscan_group_sizze_218898 (mainzisegscan_group_sizze_218862)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_234608_backing_0 =\n                           &shared_mem[local_mem_234608_backing_offset_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_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_218904 = global_tid_234599;\n    int64_t byte_offsets_234604 = (int64_t) 0;\n    int64_t byte_offsets_234605 = segscan_group_sizze_218898 * (int64_t) 8;\n    int64_t warp_byte_offset_234606 = (int64_t) 32;\n    int64_t warp_byte_offset_234607 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_234608;\n    \n    local_mem_234608 = (__local unsigned char *) local_mem_234608_backing_0;\n    \n    int64_t trans_arr_len_234609 = (int64_t) 11 * segscan_group_sizze_218898;\n    int32_t dynamic_id_234615;\n    \n    if (local_tid_234600 == 0) {\n        dynamic_id_234615 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_234591)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_234608)[(int64_t) 0] = dynamic_id_234615;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_234615 = ((__local int32_t *) local_mem_234608)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_234616 = sext_i32_i64(dynamic_id_234615) * (int64_t) 11 *\n            segscan_group_sizze_218898;\n    int64_t sgm_idx_234617 = smod64(blockOff_234616,\n                                    dyn_lifted_single_ma_l_arg_204234);\n    int32_t boundary_234618 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_218898,\n                                                  dyn_li",
            "fted_single_ma_l_arg_204234 -\n                                                  sgm_idx_234617));\n    int32_t segsizze_compact_234619 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_218898,\n                                                          dyn_lifted_single_ma_l_arg_204234));\n    double private_mem_234620[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_234622 = 0; i_234622 < (int64_t) 11; i_234622++) {\n            int64_t phys_tid_234623 = blockOff_234616 +\n                    sext_i32_i64(local_tid_234600) + i_234622 *\n                    segscan_group_sizze_218898;\n            int64_t slice_234624 = dyn_lifted_single_ma_l_arg_204234;\n            int64_t slice_234625 = partition_sizze_203667 * slice_234624;\n            int64_t gtid_218902 = squot64(phys_tid_234623, slice_234624);\n            int64_t remnant_234626 = phys_tid_234623 - gtid_218902 *\n                    slice_234624;\n            int64_t gtid_218903 = remnant_234626;\n            int64_t remnant_234627 = remnant_234626 - gtid_218903;\n            \n            if (slt64(phys_tid_234623, partition_sizze_203667 *\n                      dyn_lifted_single_ma_l_arg_204234)) {\n                bool cond_218911 = gtid_218903 == (int64_t) 0;\n                double defunc_0_f_res_218912;\n                \n                if (cond_218911) {\n                    double x_218909;\n                    \n                    x_218909 = ((__global\n                                 double *) ext_mem_230637)[gtid_218902];\n                    \n                    double defunc_0_f_res_t_res_218913 = x_218909 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218912 = defunc_0_f_res_t_res_218913;\n                } else {\n                    int64_t x_218914 = add64(n_p_203574, gtid_218903);\n                    int64_t i_218915 = sub64(x_218914, (int64_t) 1);\n                    bool x_218",
            "916 = sle64((int64_t) 0, i_218915);\n                    bool y_218917 = slt64(i_218915,\n                                          lifted_single_ma_l_arg_204224);\n                    bool bounds_check_218918 = x_218916 && y_218917;\n                    bool index_certs_218919;\n                    \n                    if (!bounds_check_218918) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          46) == -1) {\n                                global_failure_args[0] = (int64_t) i_218915;\n                                global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204224;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218920;\n                    \n                    x_218920 = ((__global double *) mem_230625)[gtid_218902 *\n                                                                lifted_single_ma_l_arg_204224 +\n                                                                i_218915];\n                    \n                    int64_t i_218921 = sub64(gtid_218903, (int64_t) 1);\n                    bool x_218922 = sle64((int64_t) 0, i_218921);\n                    bool y_218923 = slt64(i_218921,\n                                          lifted_single_ma_l_arg_204224);\n                    bool bounds_check_218924 = x_218922 && y_218923;\n                    bool index_certs_218925;\n                    \n                    if (!bounds_check_218924) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          47) == -1) {\n                                global_failure_args[0] = (int64_t) i_218921;\n                 ",
            "               global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204224;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218926;\n                    \n                    y_218926 = ((__global double *) mem_230625)[gtid_218902 *\n                                                                lifted_single_ma_l_arg_204224 +\n                                                                i_218921];\n                    \n                    double x_218927 = x_218920 - y_218926;\n                    double defunc_0_f_res_f_res_218928 = x_218927 /\n                           i64_res_203589;\n                    \n                    defunc_0_f_res_218912 = defunc_0_f_res_f_res_218928;\n                }\n                private_mem_234620[i_234622] = defunc_0_f_res_218912;\n            } else {\n                private_mem_234620[i_234622] = 0.0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234628 = 0; i_234628 < (int64_t) 11; i_234628++) {\n            int64_t sharedIdx_234629 = sext_i32_i64(local_tid_234600) +\n                    i_234628 * segscan_group_sizze_218898;\n            double tmp_234630;\n            \n            tmp_234630 = private_mem_234620[i_234628];\n            ((__local double *) local_mem_234608)[sharedIdx_234629] =\n                tmp_234630;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_234631 = 0; i_234631 < 11; i_234631++) {\n            int32_t sharedIdx_234632 = local_tid_234600 * 11 + i_234631;\n            double tmp_234633;\n            \n            tmp_234633 = ((__local\n                           double *) local_mem_234608)[sext_i32_i64(sharedIdx_234632)];\n            private_mem_234620[sext_i32_i64(i_23",
            "4631)] = tmp_234633;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_234634 = local_tid_234600 * 11 + 1;\n        \n        for (int64_t i_234635 = 0; i_234635 < (int64_t) 10; i_234635++) {\n            bool new_sgm_234636 = smod32(gidx_234634 + sext_i64_i32(i_234635) -\n                                         boundary_234618,\n                                         segsizze_compact_234619) == 0;\n            \n            if (!new_sgm_234636) {\n                double x_218905;\n                double x_218906;\n                \n                x_218905 = private_mem_234620[i_234635];\n                x_218906 = private_mem_234620[i_234635 + (int64_t) 1];\n                \n                double defunc_1_op_res_218907 = x_218905 + x_218906;\n                \n                private_mem_234620[i_234635 + (int64_t) 1] =\n                    defunc_1_op_res_218907;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        double tmp_234637;\n        \n        tmp_234637 = private_mem_234620[(int64_t) 10];\n        ((__local double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234600)] =\n            tmp_234637;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double acc_234641;\n    \n    // Scan results (with warp scan)\n    {\n        double x_234638;\n        double x_234639;\n        double x_234642;\n        double x_234643;\n        bool ltid_in_bounds_234645 = slt64(sext_i32_i64(local_tid_234600),\n                                           segscan_group_sizze_218898);\n        int32_t skip_threads_234646;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_234645) {\n                x_234639 = ((volatile __local\n                             double *) local_mem_234608)[squot64(byte_offsets_234604,\n                            ",
            "                                     (int64_t) 8) +\n                                                         sext_i32_i64(local_tid_234600)];\n                if ((local_tid_234600 - squot32(local_tid_234600, 32) * 32) ==\n                    0) {\n                    x_234638 = x_234639;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234646 = 1;\n            while (slt32(skip_threads_234646, 32)) {\n                bool thread_active_234647 = sle32(skip_threads_234646,\n                                                  local_tid_234600 -\n                                                  squot32(local_tid_234600,\n                                                          32) * 32) &&\n                     ltid_in_bounds_234645;\n                \n                if (thread_active_234647) {\n                    // read operands\n                    {\n                        x_234638 = ((volatile __local\n                                     double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(local_tid_234600) -\n                                                                  sext_i32_i64(skip_threads_234646))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234648 = slt32(smod32((local_tid_234600 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_234619 -\n                                                        boundary_234618,\n                                                        segsizze_compact_234619),\n                                                 (local_tid_234600 + 1) * 11 -\n                                                 1 - ((local_tid_2346",
            "00 -\n                                                       skip_threads_234646 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_234647 && inactive_234648) {\n                        x_234638 = x_234639;\n                    }\n                    if (thread_active_234647) {\n                        if (!inactive_234648) {\n                            double defunc_1_op_res_234640 = x_234638 + x_234639;\n                            \n                            x_234638 = defunc_1_op_res_234640;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234602, skip_threads_234646)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234647) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_234600)] =\n                            x_234638;\n                        x_234639 = x_234638;\n                    }\n                }\n                if (sle32(wave_sizze_234602, skip_threads_234646)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234646 *= 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_234600 - squot32(local_tid_234600, 32) * 32) == 31 &&\n                ltid_in_bounds_234645) {\n                ((volatile __local\n                  double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_234600,\n",
            "                                                                   32))] =\n                    x_234638;\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_234649;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_234600, 32) == 0 &&\n                    ltid_in_bounds_234645) {\n                    x_234643 = ((volatile __local\n                                 double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                                     (int64_t) 8) +\n                                                             sext_i32_i64(local_tid_234600)];\n                    if ((local_tid_234600 - squot32(local_tid_234600, 32) *\n                         32) == 0) {\n                        x_234642 = x_234643;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234649 = 1;\n                while (slt32(skip_threads_234649, 32)) {\n                    bool thread_active_234650 = sle32(skip_threads_234649,\n                                                      local_tid_234600 -\n                                                      squot32(local_tid_234600,\n                                                              32) * 32) &&\n                         (squot32(local_tid_234600, 32) == 0 &&\n                          ltid_in_bounds_234645);\n                    \n                    if (thread_active_234650) {\n                        // read operands\n                        {\n                            x_234642 = ((volatile __local\n                                         double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                                             (int64_t) 8) +\n               ",
            "                                                      (sext_i32_i64(local_tid_234600) -\n                                                                      sext_i32_i64(skip_threads_234649))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234651 = slt32(smod32((local_tid_234600 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_234619 -\n                                                            boundary_234618,\n                                                            segsizze_compact_234619),\n                                                     (local_tid_234600 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_234600 -\n                                                        skip_threads_234649) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_234650 && inactive_234651) {\n                            x_234642 = x_234643;\n                        }\n                        if (thread_active_234650) {\n                            if (!inactive_234651) {\n                                double defunc_1_op_res_234644 = x_234642 +\n                                       x_234643;\n                                \n                                x_234642 = defunc_1_op_res_234644;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234602, skip_threads_234649)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_23465",
            "0) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_234600)] =\n                                x_234642;\n                            x_234643 = x_234642;\n                        }\n                    }\n                    if (sle32(wave_sizze_234602, skip_threads_234649)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234649 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_234652 = squot32(local_tid_234600, 32) == 0 ||\n             !ltid_in_bounds_234645;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_234652) {\n                    x_234639 = x_234638;\n                    x_234638 = ((__local\n                                 double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                                     (int64_t) 8) +\n                                                             (sext_i32_i64(squot32(local_tid_234600,\n                                                                                   32)) -\n                                                              (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234653 = slt32(smod32((local_tid_234600 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_234619 -\n                                                    boundary_234618,\n                                            ",
            "        segsizze_compact_234619),\n                                             (local_tid_234600 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_234600, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_234652) {\n                    if (inactive_234653) {\n                        x_234638 = x_234639;\n                    }\n                }\n                if (!no_carry_in_234652) {\n                    if (!inactive_234653) {\n                        double defunc_1_op_res_234640 = x_234638 + x_234639;\n                        \n                        x_234638 = defunc_1_op_res_234640;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_234652) {\n                    ((__local\n                      double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234600)] =\n                        x_234638;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_234600, 32) == 0 && ltid_in_bounds_234645) {\n                ((__local\n                  double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234600)] =\n                    x_234639;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_234600 == 0) {\n            acc_234641 = ((__local\n                           double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                               (int64_t) 8) +\n                       ",
            "                                (segscan_group_sizze_218898 -\n                                                        (int64_t) 1)];\n        } else {\n            acc_234641 = ((__local\n                           double *) local_mem_234608)[squot64(byte_offsets_234604,\n                                                               (int64_t) 8) +\n                                                       (sext_i32_i64(local_tid_234600) -\n                                                        (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double prefix_234654 = 0.0;\n    bool block_new_sgm_234655 = sgm_idx_234617 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_234655 && local_tid_234600 == 0) {\n            ((volatile __global\n              double *) incprefixes_mem_234597)[dynamic_id_234615] = acc_234641;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_234593)[dynamic_id_234615] =\n                (int8_t) 2;\n            acc_234641 = 0.0;\n        }\n        if (!block_new_sgm_234655 && slt32(local_tid_234600,\n                                           wave_sizze_234602)) {\n            if (local_tid_234600 == 0) {\n                if (boundary_234618 == sext_i64_i32(segscan_group_sizze_218898 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      double *) aggregates_mem_234595)[dynamic_id_234615] =\n                        acc_234641;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234593)[dynamic_id_234615] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      double *) incprefixes_mem_234597)[dynamic_id_234615] =\n                        acc_234641;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_",
            "flags_mem_234593)[dynamic_id_234615] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_234656;\n                \n                tmp_234656 = ((volatile __global\n                               int8_t *) status_flags_mem_234593)[dynamic_id_234615 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_234608)[(int64_t) 0] =\n                    tmp_234656;\n            }\n            mem_fence_local();\n            \n            int8_t status_234657;\n            \n            status_234657 = ((__local int8_t *) local_mem_234608)[(int64_t) 0];\n            if (status_234657 == (int8_t) 2) {\n                if (local_tid_234600 == 0) {\n                    prefix_234654 = ((volatile __global\n                                      double *) incprefixes_mem_234597)[dynamic_id_234615 -\n                                                                        (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_234658 = dynamic_id_234615 -\n                        sext_i32_i64(wave_sizze_234602);\n                \n                while (slt32(wave_sizze_234602 * -1, readOffset_234658)) {\n                    int32_t read_i_234659 = readOffset_234658 +\n                            local_tid_234600;\n                    double aggr_234660 = 0.0;\n                    int8_t flag_234661 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_234659)) {\n                        if (sle64(blockOff_234616 -\n                                  (sext_i32_i64(read_i_234659 + 1) *\n                                   segscan_group_sizze_218898 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_234617)) {\n                            flag_234661 = ((volatile __global\n                                            int8_t *) status_flags_mem_234593)[sext_i32_i64(read_i_234659)];\n                            if",
            " (flag_234661 == (int8_t) 2) {\n                                aggr_234660 = ((volatile __global\n                                                double *) incprefixes_mem_234597)[sext_i32_i64(read_i_234659)];\n                            } else {\n                                if (flag_234661 == (int8_t) 1) {\n                                    aggr_234660 = ((volatile __global\n                                                    double *) aggregates_mem_234595)[sext_i32_i64(read_i_234659)];\n                                }\n                            }\n                        } else {\n                            flag_234661 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      double *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234600)] =\n                        aggr_234660;\n                    ((__local\n                      int8_t *) local_mem_234608)[sext_i32_i64(local_tid_234600)] =\n                        flag_234661;\n                    flag_234661 = ((__local\n                                    int8_t *) local_mem_234608)[sext_i32_i64(wave_sizze_234602) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_234661, (int8_t) 2)) {\n                        int8_t flg_x_234665;\n                        int8_t flg_y_234666;\n                        double x_234662;\n                        double x_234663;\n                        int32_t skip_threads_234667;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_234666 = ((volatile __local\n                                             int8_t *) local_mem_234608)[sext_i32_i64(local_tid_234600)];\n                            x_234663 = ((volatile __local\n            ",
            "                             double *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                                             (int64_t) 8) +\n                                                                     sext_i32_i64(local_tid_234600)];\n                            if ((local_tid_234600 - squot32(local_tid_234600,\n                                                            32) * 32) == 0) {\n                                x_234662 = x_234663;\n                                flg_x_234665 = flg_y_234666;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_234667 = 1;\n                            while (slt32(skip_threads_234667, 32)) {\n                                if (sle32(skip_threads_234667,\n                                          local_tid_234600 -\n                                          squot32(local_tid_234600, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_234665 = ((volatile __local\n                                                         int8_t *) local_mem_234608)[sext_i32_i64(local_tid_234600) -\n                                                                                     sext_i32_i64(skip_threads_234667)];\n                                        x_234662 = ((volatile __local\n                                                     double *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                                                         (int64_t) 8) +\n                                                                                 (sext_i32_i64(local_tid_234600) -\n                                                                                  sext_i32_i64(skip_threads_234667))];\n                                    }\n ",
            "                                   // perform operation\n                                    {\n                                        if (flg_y_234666 == (int8_t) 2 ||\n                                            flg_y_234666 == (int8_t) 0) {\n                                            flg_x_234665 = flg_y_234666;\n                                            x_234662 = x_234663;\n                                        } else {\n                                            double defunc_1_op_res_234664 =\n                                                   x_234662 + x_234663;\n                                            \n                                            x_234662 = defunc_1_op_res_234664;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_234608)[sext_i32_i64(local_tid_234600)] =\n                                            flg_x_234665;\n                                        flg_y_234666 = flg_x_234665;\n                                        ((volatile __local\n                                          double *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_234600)] =\n                                            x_234662;\n                                        x_234663 = x_234662;\n                                    }\n                                }\n                                skip_threads_234667 *= 2;\n                            }\n                        }\n                    }\n                    flag_234661 = ((__local\n                                    int8_t *) local_mem_234608)[sext_i32_i64(wave_sizze_234602) -\n               ",
            "                                                 (int64_t) 1];\n                    aggr_234660 = ((__local\n                                    double *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(wave_sizze_234602) -\n                                                                 (int64_t) 1)];\n                    if (flag_234661 == (int8_t) 2) {\n                        readOffset_234658 = wave_sizze_234602 * -1;\n                    } else {\n                        if (flag_234661 == (int8_t) 1) {\n                            readOffset_234658 -= wave_sizze_234602;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_234661)) {\n                        double x_234668 = aggr_234660;\n                        double x_234669 = prefix_234654;\n                        double defunc_1_op_res_234670 = x_234668 + x_234669;\n                        \n                        prefix_234654 = defunc_1_op_res_234670;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_234600 == 0) {\n                if (boundary_234618 == sext_i64_i32(segscan_group_sizze_218898 *\n                    (int64_t) 11)) {\n                    double x_234671 = prefix_234654;\n                    double x_234672 = acc_234641;\n                    double defunc_1_op_res_234673 = x_234671 + x_234672;\n                    \n                    ((volatile __global\n                      double *) incprefixes_mem_234597)[dynamic_id_234615] =\n                        defunc_1_op_res_234673;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234593)[dynamic_id_234615] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  do",
            "uble *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                      (int64_t) 8)] =\n                    prefix_234654;\n                acc_234641 = 0.0;\n            }\n        }\n        if (!(dynamic_id_234615 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_234654 = ((__local\n                              double *) local_mem_234608)[squot64(warp_byte_offset_234606,\n                                                                  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        double x_234674;\n        double x_234675;\n        double x_234677 = prefix_234654;\n        double x_234678 = acc_234641;\n        \n        if (slt32(local_tid_234600 * 11, boundary_234618) &&\n            !block_new_sgm_234655) {\n            double defunc_1_op_res_234679 = x_234677 + x_234678;\n            \n            x_234674 = defunc_1_op_res_234679;\n        } else {\n            x_234674 = acc_234641;\n        }\n        \n        int32_t stopping_point_234680 = segsizze_compact_234619 -\n                srem32(local_tid_234600 * 11 - 1 + segsizze_compact_234619 -\n                       boundary_234618, segsizze_compact_234619);\n        \n        for (int64_t i_234681 = 0; i_234681 < (int64_t) 11; i_234681++) {\n            if (slt32(sext_i64_i32(i_234681), stopping_point_234680 - 1)) {\n                x_234675 = private_mem_234620[i_234681];\n                \n                double defunc_1_op_res_234676 = x_234674 + x_234675;\n                \n                private_mem_234620[i_234681] = defunc_1_op_res_234676;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_234682 = 0; i_234682 < (int64_t) 11; i_234682++) {\n            int64_t sharedIdx_234683 = sext_i32_i64(local_tid_234600 * 11) +\n                    i_234682;\n            double tmp_234684;\n            \n            t",
            "mp_234684 = private_mem_234620[i_234682];\n            ((__local double *) local_mem_234608)[sharedIdx_234683] =\n                tmp_234684;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234685 = 0; i_234685 < (int64_t) 11; i_234685++) {\n            int64_t flat_idx_234686 = blockOff_234616 +\n                    segscan_group_sizze_218898 * i_234685 +\n                    sext_i32_i64(local_tid_234600);\n            int64_t slice_234687 = dyn_lifted_single_ma_l_arg_204234;\n            int64_t slice_234688 = partition_sizze_203667 * slice_234687;\n            int64_t gtid_218902 = squot64(flat_idx_234686, slice_234687);\n            int64_t remnant_234689 = flat_idx_234686 - gtid_218902 *\n                    slice_234687;\n            int64_t gtid_218903 = remnant_234689;\n            int64_t remnant_234690 = remnant_234689 - gtid_218903;\n            \n            if (slt64(flat_idx_234686, partition_sizze_203667 *\n                      dyn_lifted_single_ma_l_arg_204234)) {\n                double tmp_234691;\n                \n                tmp_234691 = ((__local\n                               double *) local_mem_234608)[flat_idx_234686 -\n                                                           blockOff_234616];\n                ((__global double *) mem_230642)[gtid_218902 *\n                                                 dyn_lifted_single_ma_l_arg_204234 +\n                                                 gtid_218903] = tmp_234691;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_234615 == sdiv_up64(partition_sizze_203667 *\n                                           dyn_lifted_single_ma_l_arg_204234,\n                                           segscan_group_sizze_218898 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_234591)[(int64_t) 0] = 0;\n        }\n    }\n    \n  er",
            "ror_0:\n    return;\n    #undef segscan_group_sizze_218898\n}\n__kernel void mainzisegscan_219035(__global int *global_failure,\n                                   int failure_is_an_option, __global\n                                   int64_t *global_failure_args,\n                                   uint local_mem_234789_backing_offset_0,\n                                   int64_t n_203572,\n                                   int64_t partition_sizze_203667,\n                                   int64_t dyn_lifted_single_ma_l_arg_204234,\n                                   __global unsigned char *mem_230642, __global\n                                   unsigned char *ext_mem_230654, __global\n                                   unsigned char *mem_230659, __global\n                                   unsigned char *mainziid_counter_mem_234772,\n                                   __global\n                                   unsigned char *status_flags_mem_234774,\n                                   __global\n                                   unsigned char *aggregates_mem_234776,\n                                   __global\n                                   unsigned char *incprefixes_mem_234778)\n{\n    #define segscan_group_sizze_219029 (mainzisegscan_group_sizze_218993)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_234789_backing_0 =\n                           &shared_mem[local_mem_234789_backing_offset_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_234780;\n    int32_t local_tid_234781;\n    int64_t group_sizze_234784;\n    int32_t wave_sizze_234783;\n    int32_t group_tid_234782;\n    \n    global_tid_234780 = get_global_id(0);\n    local_tid_234781 = get_local_id(0);\n    group_sizze_234784 ",
            "= get_local_size(0);\n    wave_sizze_234783 = LOCKSTEP_WIDTH;\n    group_tid_234782 = get_group_id(0);\n    \n    int32_t phys_tid_219035 = global_tid_234780;\n    int64_t byte_offsets_234785 = (int64_t) 0;\n    int64_t byte_offsets_234786 = segscan_group_sizze_219029 * (int64_t) 8;\n    int64_t warp_byte_offset_234787 = (int64_t) 32;\n    int64_t warp_byte_offset_234788 = (int64_t) 288;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_234789;\n    \n    local_mem_234789 = (__local unsigned char *) local_mem_234789_backing_0;\n    \n    int64_t trans_arr_len_234790 = (int64_t) 11 * segscan_group_sizze_219029;\n    int32_t dynamic_id_234796;\n    \n    if (local_tid_234781 == 0) {\n        dynamic_id_234796 = atomic_add_i32_global(&((volatile __global\n                                                     int *) mainziid_counter_mem_234772)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_234789)[(int64_t) 0] = dynamic_id_234796;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_234796 = ((__local int32_t *) local_mem_234789)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_234797 = sext_i32_i64(dynamic_id_234796) * (int64_t) 11 *\n            segscan_group_sizze_219029;\n    int64_t sgm_idx_234798 = smod64(blockOff_234797, n_203572);\n    int32_t boundary_234799 = sext_i64_i32(smin64((int64_t) 11 *\n                                                  segscan_group_sizze_219029,\n                                                  n_203572 - sgm_idx_234798));\n    int32_t segsizze_compact_234800 = sext_i64_i32(smin64((int64_t) 11 *\n                                                          segscan_group_sizze_219029,\n                                                          n_203572));\n    double private_mem_234801[(int64_t) 11];\n    \n    // Load and map\n    {\n        for (int64_t i_234803 = 0; i_234803 < (int64_t) 11; i_234803++) {\n            int64_t phys_ti",
            "d_234804 = blockOff_234797 +\n                    sext_i32_i64(local_tid_234781) + i_234803 *\n                    segscan_group_sizze_219029;\n            int64_t slice_234805 = n_203572;\n            int64_t slice_234806 = partition_sizze_203667 * slice_234805;\n            int64_t gtid_219033 = squot64(phys_tid_234804, slice_234805);\n            int64_t remnant_234807 = phys_tid_234804 - gtid_219033 *\n                    slice_234805;\n            int64_t gtid_219034 = remnant_234807;\n            int64_t remnant_234808 = remnant_234807 - gtid_219034;\n            \n            if (slt64(phys_tid_234804, partition_sizze_203667 * n_203572)) {\n                bool cond_219042 = gtid_219034 == (int64_t) 0;\n                double defunc_0_f_res_219043;\n                \n                if (cond_219042) {\n                    double x_219040;\n                    \n                    x_219040 = ((__global\n                                 double *) ext_mem_230654)[gtid_219033];\n                    \n                    double defunc_0_f_res_t_res_219044 = x_219040 / 3.0;\n                    \n                    defunc_0_f_res_219043 = defunc_0_f_res_t_res_219044;\n                } else {\n                    int64_t x_219045 = add64((int64_t) 3, gtid_219034);\n                    int64_t i_219046 = sub64(x_219045, (int64_t) 1);\n                    bool x_219047 = sle64((int64_t) 0, i_219046);\n                    bool y_219048 = slt64(i_219046,\n                                          dyn_lifted_single_ma_l_arg_204234);\n                    bool bounds_check_219049 = x_219047 && y_219048;\n                    bool index_certs_219050;\n                    \n                    if (!bounds_check_219049) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          48) == -1) {\n                                global_failure_args[0] = (int64_t) i_219046;\n                                globa",
            "l_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204234;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_219051;\n                    \n                    x_219051 = ((__global double *) mem_230642)[gtid_219033 *\n                                                                dyn_lifted_single_ma_l_arg_204234 +\n                                                                i_219046];\n                    \n                    int64_t i_219052 = sub64(gtid_219034, (int64_t) 1);\n                    bool x_219053 = sle64((int64_t) 0, i_219052);\n                    bool y_219054 = slt64(i_219052,\n                                          dyn_lifted_single_ma_l_arg_204234);\n                    bool bounds_check_219055 = x_219053 && y_219054;\n                    bool index_certs_219056;\n                    \n                    if (!bounds_check_219055) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          49) == -1) {\n                                global_failure_args[0] = (int64_t) i_219052;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204234;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_219057;\n                    \n                    y_219057 = ((__global double *) mem_230642)[gtid_219033 *\n                                                                dyn_lifted_single_ma_l_arg_204234 +\n                                        ",
            "                        i_219052];\n                    \n                    double x_219058 = x_219051 - y_219057;\n                    double defunc_0_f_res_f_res_219059 = x_219058 / 3.0;\n                    \n                    defunc_0_f_res_219043 = defunc_0_f_res_f_res_219059;\n                }\n                private_mem_234801[i_234803] = defunc_0_f_res_219043;\n            } else {\n                private_mem_234801[i_234803] = 0.0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234809 = 0; i_234809 < (int64_t) 11; i_234809++) {\n            int64_t sharedIdx_234810 = sext_i32_i64(local_tid_234781) +\n                    i_234809 * segscan_group_sizze_219029;\n            double tmp_234811;\n            \n            tmp_234811 = private_mem_234801[i_234809];\n            ((__local double *) local_mem_234789)[sharedIdx_234810] =\n                tmp_234811;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_234812 = 0; i_234812 < 11; i_234812++) {\n            int32_t sharedIdx_234813 = local_tid_234781 * 11 + i_234812;\n            double tmp_234814;\n            \n            tmp_234814 = ((__local\n                           double *) local_mem_234789)[sext_i32_i64(sharedIdx_234813)];\n            private_mem_234801[sext_i32_i64(i_234812)] = tmp_234814;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_234815 = local_tid_234781 * 11 + 1;\n        \n        for (int64_t i_234816 = 0; i_234816 < (int64_t) 10; i_234816++) {\n            bool new_sgm_234817 = smod32(gidx_234815 + sext_i64_i32(i_234816) -\n                                         boundary_234799,\n                                         segsizze_compact_234800) == 0;\n            \n            if (!new_sgm_234817) {\n                double x_219036;\n                double x_219037;\n                \n                x_219036 = private_mem_234801[i_234816];\n          ",
            "      x_219037 = private_mem_234801[i_234816 + (int64_t) 1];\n                \n                double defunc_1_op_res_219038 = x_219036 + x_219037;\n                \n                private_mem_234801[i_234816 + (int64_t) 1] =\n                    defunc_1_op_res_219038;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        double tmp_234818;\n        \n        tmp_234818 = private_mem_234801[(int64_t) 10];\n        ((__local double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234781)] =\n            tmp_234818;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double acc_234822;\n    \n    // Scan results (with warp scan)\n    {\n        double x_234819;\n        double x_234820;\n        double x_234823;\n        double x_234824;\n        bool ltid_in_bounds_234826 = slt64(sext_i32_i64(local_tid_234781),\n                                           segscan_group_sizze_219029);\n        int32_t skip_threads_234827;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_234826) {\n                x_234820 = ((volatile __local\n                             double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                                 (int64_t) 8) +\n                                                         sext_i32_i64(local_tid_234781)];\n                if ((local_tid_234781 - squot32(local_tid_234781, 32) * 32) ==\n                    0) {\n                    x_234819 = x_234820;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234827 = 1;\n            while (slt32(skip_threads_234827, 32)) {\n                bool thread_active_234828 = sle32(skip_threads_234827,\n                                                  local_tid_234781 -\n                           ",
            "                       squot32(local_tid_234781,\n                                                          32) * 32) &&\n                     ltid_in_bounds_234826;\n                \n                if (thread_active_234828) {\n                    // read operands\n                    {\n                        x_234819 = ((volatile __local\n                                     double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(local_tid_234781) -\n                                                                  sext_i32_i64(skip_threads_234827))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234829 = slt32(smod32((local_tid_234781 + 1) *\n                                                        11 - 1 +\n                                                        segsizze_compact_234800 -\n                                                        boundary_234799,\n                                                        segsizze_compact_234800),\n                                                 (local_tid_234781 + 1) * 11 -\n                                                 1 - ((local_tid_234781 -\n                                                       skip_threads_234827 +\n                                                       1) * 11 - 1));\n                    \n                    if (thread_active_234828 && inactive_234829) {\n                        x_234819 = x_234820;\n                    }\n                    if (thread_active_234828) {\n                        if (!inactive_234829) {\n                            double defunc_1_op_res_234821 = x_234819 + x_234820;\n                            \n                            x_234819 = defunc_1_op_res_234821;\n                        }\n                    }\n                }\n          ",
            "      if (sle32(wave_sizze_234783, skip_threads_234827)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234828) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                              (int64_t) 8) +\n                                                      sext_i32_i64(local_tid_234781)] =\n                            x_234819;\n                        x_234820 = x_234819;\n                    }\n                }\n                if (sle32(wave_sizze_234783, skip_threads_234827)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234827 *= 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_234781 - squot32(local_tid_234781, 32) * 32) == 31 &&\n                ltid_in_bounds_234826) {\n                ((volatile __local\n                  double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(squot32(local_tid_234781,\n                                                                   32))] =\n                    x_234819;\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_234830;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_234781, 32) == 0 &&\n                    ltid_in_bounds_234826) {\n                    x_234824 = ((volatile __local\n                                 double *) local_mem_234789)[squot64(byte_offsets_234785,\n                              ",
            "                                       (int64_t) 8) +\n                                                             sext_i32_i64(local_tid_234781)];\n                    if ((local_tid_234781 - squot32(local_tid_234781, 32) *\n                         32) == 0) {\n                        x_234823 = x_234824;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234830 = 1;\n                while (slt32(skip_threads_234830, 32)) {\n                    bool thread_active_234831 = sle32(skip_threads_234830,\n                                                      local_tid_234781 -\n                                                      squot32(local_tid_234781,\n                                                              32) * 32) &&\n                         (squot32(local_tid_234781, 32) == 0 &&\n                          ltid_in_bounds_234826);\n                    \n                    if (thread_active_234831) {\n                        // read operands\n                        {\n                            x_234823 = ((volatile __local\n                                         double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                                             (int64_t) 8) +\n                                                                     (sext_i32_i64(local_tid_234781) -\n                                                                      sext_i32_i64(skip_threads_234830))];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234832 = slt32(smod32((local_tid_234781 *\n                                                             32 + 32 - 1 + 1) *\n                                                            11 - 1 +\n                                                            segsizze_compact_234800 -\n                               ",
            "                             boundary_234799,\n                                                            segsizze_compact_234800),\n                                                     (local_tid_234781 * 32 +\n                                                      32 - 1 + 1) * 11 - 1 -\n                                                     (((local_tid_234781 -\n                                                        skip_threads_234830) *\n                                                       32 + 32 - 1 + 1) * 11 -\n                                                      1));\n                        \n                        if (thread_active_234831 && inactive_234832) {\n                            x_234823 = x_234824;\n                        }\n                        if (thread_active_234831) {\n                            if (!inactive_234832) {\n                                double defunc_1_op_res_234825 = x_234823 +\n                                       x_234824;\n                                \n                                x_234823 = defunc_1_op_res_234825;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234783, skip_threads_234830)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234831) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_234781)] =\n                                x_234823;\n                            x_234824 = x_234823;\n                        }\n                    }\n                    if (sle32(wave_sizze_234783, skip_threads_234830)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n        ",
            "            }\n                    skip_threads_234830 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_234833 = squot32(local_tid_234781, 32) == 0 ||\n             !ltid_in_bounds_234826;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_234833) {\n                    x_234820 = x_234819;\n                    x_234819 = ((__local\n                                 double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                                     (int64_t) 8) +\n                                                             (sext_i32_i64(squot32(local_tid_234781,\n                                                                                   32)) -\n                                                              (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234834 = slt32(smod32((local_tid_234781 + 1) *\n                                                    11 - 1 +\n                                                    segsizze_compact_234800 -\n                                                    boundary_234799,\n                                                    segsizze_compact_234800),\n                                             (local_tid_234781 + 1) * 11 - 1 -\n                                             ((squot32(local_tid_234781, 32) *\n                                               32 - 1 + 1) * 11 - 1));\n                \n                if (!no_carry_in_234833) {\n                    if (inactive_234834) {\n                        x_234819 = x_234820;\n                    }\n                }\n                if (!no_carry_in_234833) {\n                    if (!inactive_234834) {\n                        double defunc_1_op_res_234821 = x_234819 + x_234820;\n                        \n            ",
            "            x_234819 = defunc_1_op_res_234821;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_234833) {\n                    ((__local\n                      double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234781)] =\n                        x_234819;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_234781, 32) == 0 && ltid_in_bounds_234826) {\n                ((__local\n                  double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                      (int64_t) 8) +\n                                              sext_i32_i64(local_tid_234781)] =\n                    x_234820;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_234781 == 0) {\n            acc_234822 = ((__local\n                           double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                               (int64_t) 8) +\n                                                       (segscan_group_sizze_219029 -\n                                                        (int64_t) 1)];\n        } else {\n            acc_234822 = ((__local\n                           double *) local_mem_234789)[squot64(byte_offsets_234785,\n                                                               (int64_t) 8) +\n                                                       (sext_i32_i64(local_tid_234781) -\n                                                        (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    double prefix_234835 = 0.0;\n    bool block_new_sgm_234836 = sgm_idx_234798 == (int",
            "64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_234836 && local_tid_234781 == 0) {\n            ((volatile __global\n              double *) incprefixes_mem_234778)[dynamic_id_234796] = acc_234822;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_234774)[dynamic_id_234796] =\n                (int8_t) 2;\n            acc_234822 = 0.0;\n        }\n        if (!block_new_sgm_234836 && slt32(local_tid_234781,\n                                           wave_sizze_234783)) {\n            if (local_tid_234781 == 0) {\n                if (boundary_234799 == sext_i64_i32(segscan_group_sizze_219029 *\n                    (int64_t) 11)) {\n                    ((volatile __global\n                      double *) aggregates_mem_234776)[dynamic_id_234796] =\n                        acc_234822;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234774)[dynamic_id_234796] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      double *) incprefixes_mem_234778)[dynamic_id_234796] =\n                        acc_234822;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234774)[dynamic_id_234796] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_234837;\n                \n                tmp_234837 = ((volatile __global\n                               int8_t *) status_flags_mem_234774)[dynamic_id_234796 -\n                                                                  (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_234789)[(int64_t) 0] =\n                    tmp_234837;\n            }\n            mem_fence_local();\n            \n            int8_t status_234838;\n            \n            status_234838 = ((__local int8_t *) local_mem_23",
            "4789)[(int64_t) 0];\n            if (status_234838 == (int8_t) 2) {\n                if (local_tid_234781 == 0) {\n                    prefix_234835 = ((volatile __global\n                                      double *) incprefixes_mem_234778)[dynamic_id_234796 -\n                                                                        (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_234839 = dynamic_id_234796 -\n                        sext_i32_i64(wave_sizze_234783);\n                \n                while (slt32(wave_sizze_234783 * -1, readOffset_234839)) {\n                    int32_t read_i_234840 = readOffset_234839 +\n                            local_tid_234781;\n                    double aggr_234841 = 0.0;\n                    int8_t flag_234842 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_234840)) {\n                        if (sle64(blockOff_234797 -\n                                  (sext_i32_i64(read_i_234840 + 1) *\n                                   segscan_group_sizze_219029 * (int64_t) 11 -\n                                   (int64_t) 1), sgm_idx_234798)) {\n                            flag_234842 = ((volatile __global\n                                            int8_t *) status_flags_mem_234774)[sext_i32_i64(read_i_234840)];\n                            if (flag_234842 == (int8_t) 2) {\n                                aggr_234841 = ((volatile __global\n                                                double *) incprefixes_mem_234778)[sext_i32_i64(read_i_234840)];\n                            } else {\n                                if (flag_234842 == (int8_t) 1) {\n                                    aggr_234841 = ((volatile __global\n                                                    double *) aggregates_mem_234776)[sext_i32_i64(read_i_234840)];\n                                }\n                            }\n                        } else {\n                            flag_234842 = (int8_t) 2;\n     ",
            "                   }\n                    }\n                    ((__local\n                      double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                          (int64_t) 8) +\n                                                  sext_i32_i64(local_tid_234781)] =\n                        aggr_234841;\n                    ((__local\n                      int8_t *) local_mem_234789)[sext_i32_i64(local_tid_234781)] =\n                        flag_234842;\n                    flag_234842 = ((__local\n                                    int8_t *) local_mem_234789)[sext_i32_i64(wave_sizze_234783) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_234842, (int8_t) 2)) {\n                        int8_t flg_x_234846;\n                        int8_t flg_y_234847;\n                        double x_234843;\n                        double x_234844;\n                        int32_t skip_threads_234848;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_234847 = ((volatile __local\n                                             int8_t *) local_mem_234789)[sext_i32_i64(local_tid_234781)];\n                            x_234844 = ((volatile __local\n                                         double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                                             (int64_t) 8) +\n                                                                     sext_i32_i64(local_tid_234781)];\n                            if ((local_tid_234781 - squot32(local_tid_234781,\n                                                            32) * 32) == 0) {\n                                x_234843 = x_234844;\n                                flg_x_234846 = flg_y_234847;\n                            }\n                        }\n                        // in-block scan (",
            "hopefully no barriers needed)\n                        {\n                            skip_threads_234848 = 1;\n                            while (slt32(skip_threads_234848, 32)) {\n                                if (sle32(skip_threads_234848,\n                                          local_tid_234781 -\n                                          squot32(local_tid_234781, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_234846 = ((volatile __local\n                                                         int8_t *) local_mem_234789)[sext_i32_i64(local_tid_234781) -\n                                                                                     sext_i32_i64(skip_threads_234848)];\n                                        x_234843 = ((volatile __local\n                                                     double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                                                         (int64_t) 8) +\n                                                                                 (sext_i32_i64(local_tid_234781) -\n                                                                                  sext_i32_i64(skip_threads_234848))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_234847 == (int8_t) 2 ||\n                                            flg_y_234847 == (int8_t) 0) {\n                                            flg_x_234846 = flg_y_234847;\n                                            x_234843 = x_234844;\n                                        } else {\n                                            double defunc_1_op_res_234845 =\n                                                   x_234843 + x_234844;\n                                            \n                              ",
            "              x_234843 = defunc_1_op_res_234845;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_234789)[sext_i32_i64(local_tid_234781)] =\n                                            flg_x_234846;\n                                        flg_y_234847 = flg_x_234846;\n                                        ((volatile __local\n                                          double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_234781)] =\n                                            x_234843;\n                                        x_234844 = x_234843;\n                                    }\n                                }\n                                skip_threads_234848 *= 2;\n                            }\n                        }\n                    }\n                    flag_234842 = ((__local\n                                    int8_t *) local_mem_234789)[sext_i32_i64(wave_sizze_234783) -\n                                                                (int64_t) 1];\n                    aggr_234841 = ((__local\n                                    double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                                        (int64_t) 8) +\n                                                                (sext_i32_i64(wave_sizze_234783) -\n                                                                 (int64_t) 1)];\n                    if (flag_234842 == (int8_t) 2) {\n                        readOffset_234839 = wave_sizze_234783 * -1;\n                    } else {\n                        if (flag",
            "_234842 == (int8_t) 1) {\n                            readOffset_234839 -= wave_sizze_234783;\n                        }\n                    }\n                    if (slt8((int8_t) 0, flag_234842)) {\n                        double x_234849 = aggr_234841;\n                        double x_234850 = prefix_234835;\n                        double defunc_1_op_res_234851 = x_234849 + x_234850;\n                        \n                        prefix_234835 = defunc_1_op_res_234851;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_234781 == 0) {\n                if (boundary_234799 == sext_i64_i32(segscan_group_sizze_219029 *\n                    (int64_t) 11)) {\n                    double x_234852 = prefix_234835;\n                    double x_234853 = acc_234822;\n                    double defunc_1_op_res_234854 = x_234852 + x_234853;\n                    \n                    ((volatile __global\n                      double *) incprefixes_mem_234778)[dynamic_id_234796] =\n                        defunc_1_op_res_234854;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_234774)[dynamic_id_234796] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                      (int64_t) 8)] =\n                    prefix_234835;\n                acc_234822 = 0.0;\n            }\n        }\n        if (!(dynamic_id_234796 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_234835 = ((__local\n                              double *) local_mem_234789)[squot64(warp_byte_offset_234787,\n                                                                  (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        double x_234855;\n        doub",
            "le x_234856;\n        double x_234858 = prefix_234835;\n        double x_234859 = acc_234822;\n        \n        if (slt32(local_tid_234781 * 11, boundary_234799) &&\n            !block_new_sgm_234836) {\n            double defunc_1_op_res_234860 = x_234858 + x_234859;\n            \n            x_234855 = defunc_1_op_res_234860;\n        } else {\n            x_234855 = acc_234822;\n        }\n        \n        int32_t stopping_point_234861 = segsizze_compact_234800 -\n                srem32(local_tid_234781 * 11 - 1 + segsizze_compact_234800 -\n                       boundary_234799, segsizze_compact_234800);\n        \n        for (int64_t i_234862 = 0; i_234862 < (int64_t) 11; i_234862++) {\n            if (slt32(sext_i64_i32(i_234862), stopping_point_234861 - 1)) {\n                x_234856 = private_mem_234801[i_234862];\n                \n                double defunc_1_op_res_234857 = x_234855 + x_234856;\n                \n                private_mem_234801[i_234862] = defunc_1_op_res_234857;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion\n    {\n        for (int64_t i_234863 = 0; i_234863 < (int64_t) 11; i_234863++) {\n            int64_t sharedIdx_234864 = sext_i32_i64(local_tid_234781 * 11) +\n                    i_234863;\n            double tmp_234865;\n            \n            tmp_234865 = private_mem_234801[i_234863];\n            ((__local double *) local_mem_234789)[sharedIdx_234864] =\n                tmp_234865;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_234866 = 0; i_234866 < (int64_t) 11; i_234866++) {\n            int64_t flat_idx_234867 = blockOff_234797 +\n                    segscan_group_sizze_219029 * i_234866 +\n                    sext_i32_i64(local_tid_234781);\n            int64_t slice_234868 = n_203572;\n            int64_t slice_234869 = partition_sizze_203667 * slice_234868;\n            int64_t gtid_219033 = squot64(flat_idx_234867, slice_234868);\n            int64_t remnant_2",
            "34870 = flat_idx_234867 - gtid_219033 *\n                    slice_234868;\n            int64_t gtid_219034 = remnant_234870;\n            int64_t remnant_234871 = remnant_234870 - gtid_219034;\n            \n            if (slt64(flat_idx_234867, partition_sizze_203667 * n_203572)) {\n                double tmp_234872;\n                \n                tmp_234872 = ((__local\n                               double *) local_mem_234789)[flat_idx_234867 -\n                                                           blockOff_234797];\n                ((__global double *) mem_230659)[gtid_219033 * n_203572 +\n                                                 gtid_219034] = tmp_234872;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_234796 == sdiv_up64(partition_sizze_203667 * n_203572,\n                                           segscan_group_sizze_219029 *\n                                           (int64_t) 11) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_234772)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_219029\n}\n__kernel void mainzisegscan_228005(__global int *global_failure,\n                                   uint local_mem_236834_backing_offset_0,\n                                   int64_t n_203572,\n                                   int64_t partition_sizze_203667,\n                                   unsigned char cond_f_res_227891_bits,\n                                   unsigned char cond_f_res_227892_bits,\n                                   int64_t unsign_arg_227893,\n                                   int64_t unsign_arg_227894, __global\n                                   unsigned char *mem_param_231841, __global\n                                   unsigned char *mem_231877, __global\n                                   unsigned char *mem_231881, __global\n                                   unsigned char ",
            "*mem_231885, __global\n                                   unsigned char *mem_231889, __global\n                                   unsigned char *mem_231893, __global\n                                   unsigned char *mainziid_counter_mem_236799,\n                                   __global\n                                   unsigned char *status_flags_mem_236801,\n                                   __global\n                                   unsigned char *aggregates_mem_236803,\n                                   __global\n                                   unsigned char *incprefixes_mem_236805,\n                                   __global\n                                   unsigned char *aggregates_mem_236807,\n                                   __global\n                                   unsigned char *incprefixes_mem_236809,\n                                   __global\n                                   unsigned char *aggregates_mem_236811,\n                                   __global\n                                   unsigned char *incprefixes_mem_236813,\n                                   __global\n                                   unsigned char *aggregates_mem_236815,\n                                   __global\n                                   unsigned char *incprefixes_mem_236817)\n{\n    bool cond_f_res_227891 = cond_f_res_227891_bits;\n    bool cond_f_res_227892 = cond_f_res_227892_bits;\n    \n    #define segscan_group_sizze_227995 (mainzisegscan_group_sizze_227715)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile unsigned char *local_mem_236834_backing_0 =\n                           &shared_mem[local_mem_236834_backing_offset_0];\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236819;\n    int32_t local_tid_236820;\n    int64_t group_sizze_236823;\n    int32_t wave_sizze_236822;\n    int32_t group_tid_236821;\n    \n    global_tid_236819 = get_global_id(0);\n    local_tid_236820 = get_",
            "local_id(0);\n    group_sizze_236823 = get_local_size(0);\n    wave_sizze_236822 = LOCKSTEP_WIDTH;\n    group_tid_236821 = get_group_id(0);\n    \n    int32_t phys_tid_228005 = global_tid_236819;\n    int64_t byte_offsets_236824 = (int64_t) 0;\n    int64_t byte_offsets_236825 = segscan_group_sizze_227995 * (int64_t) 8;\n    int64_t byte_offsets_236826 = sdiv_up64(segscan_group_sizze_227995 *\n                                            (int64_t) 8, (int64_t) 8) *\n            (int64_t) 8 + segscan_group_sizze_227995 * (int64_t) 8;\n    int64_t byte_offsets_236827 =\n            sdiv_up64(sdiv_up64(segscan_group_sizze_227995 * (int64_t) 8,\n                                (int64_t) 8) * (int64_t) 8 +\n                      segscan_group_sizze_227995 * (int64_t) 8, (int64_t) 8) *\n            (int64_t) 8 + segscan_group_sizze_227995 * (int64_t) 8;\n    int64_t byte_offsets_236828 =\n            sdiv_up64(sdiv_up64(sdiv_up64(segscan_group_sizze_227995 *\n                                          (int64_t) 8, (int64_t) 8) *\n                                (int64_t) 8 + segscan_group_sizze_227995 *\n                                (int64_t) 8, (int64_t) 8) * (int64_t) 8 +\n                      segscan_group_sizze_227995 * (int64_t) 8, (int64_t) 8) *\n            (int64_t) 8 + segscan_group_sizze_227995 * (int64_t) 8;\n    int64_t warp_byte_offset_236829 = (int64_t) 32;\n    int64_t warp_byte_offset_236830 = (int64_t) 288;\n    int64_t warp_byte_offset_236831 = (int64_t) 544;\n    int64_t warp_byte_offset_236832 = (int64_t) 800;\n    int64_t warp_byte_offset_236833 = (int64_t) 1056;\n    \n    // Allocate reused shared memeory\n    { }\n    \n    __local unsigned char *local_mem_236834;\n    \n    local_mem_236834 = (__local unsigned char *) local_mem_236834_backing_0;\n    \n    int64_t trans_arr_len_236835 = (int64_t) 3 * segscan_group_sizze_227995;\n    int32_t dynamic_id_236850;\n    \n    if (local_tid_236820 == 0) {\n        dynamic_id_236850 = atomic_add_i32_global(&((volatile __global\n                ",
            "                                     int *) mainziid_counter_mem_236799)[(int64_t) 0],\n                                                  (int) 1);\n        ((__local int32_t *) local_mem_236834)[(int64_t) 0] = dynamic_id_236850;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    dynamic_id_236850 = ((__local int32_t *) local_mem_236834)[(int64_t) 0];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t blockOff_236851 = sext_i32_i64(dynamic_id_236850) * (int64_t) 3 *\n            segscan_group_sizze_227995;\n    int64_t sgm_idx_236852 = smod64(blockOff_236851, n_203572);\n    int32_t boundary_236853 = sext_i64_i32(smin64((int64_t) 3 *\n                                                  segscan_group_sizze_227995,\n                                                  n_203572 - sgm_idx_236852));\n    int32_t segsizze_compact_236854 = sext_i64_i32(smin64((int64_t) 3 *\n                                                          segscan_group_sizze_227995,\n                                                          n_203572));\n    int64_t private_mem_236855[(int64_t) 3];\n    int64_t private_mem_236857[(int64_t) 3];\n    int64_t private_mem_236859[(int64_t) 3];\n    int64_t private_mem_236861[(int64_t) 3];\n    \n    // Load and map\n    {\n        for (int64_t i_236863 = 0; i_236863 < (int64_t) 3; i_236863++) {\n            int64_t phys_tid_236864 = blockOff_236851 +\n                    sext_i32_i64(local_tid_236820) + i_236863 *\n                    segscan_group_sizze_227995;\n            int64_t slice_236865 = n_203572;\n            int64_t slice_236866 = partition_sizze_203667 * slice_236865;\n            int64_t gtid_228003 = squot64(phys_tid_236864, slice_236865);\n            int64_t remnant_236867 = phys_tid_236864 - gtid_228003 *\n                    slice_236865;\n            int64_t gtid_228004 = remnant_236867;\n            int64_t remnant_236868 = remnant_236867 - gtid_228004;\n            \n            if (slt64(phys_tid_236864, partition_sizze_203667 * n_203572)) {\n                double x_22801",
            "9;\n                \n                x_228019 = ((__global double *) mem_param_231841)[gtid_228003 *\n                                                                  n_203572 +\n                                                                  gtid_228004];\n                \n                int64_t i64_arg_228020;\n                \n                i64_arg_228020 = futrts_to_bits64(x_228019);\n                \n                int64_t unsign_arg_228021 = ashr64(i64_arg_228020,\n                                                   unsign_arg_227893);\n                int64_t unsign_arg_228022 = (int64_t) 1 & unsign_arg_228021;\n                int32_t to_i32_res_228023 = zext_i64_i32(unsign_arg_228022);\n                int64_t unsign_arg_228024 = ashr64(i64_arg_228020,\n                                                   (int64_t) 63);\n                int64_t unsign_arg_228025 = (int64_t) 1 & unsign_arg_228024;\n                int32_t to_i32_res_228026 = zext_i64_i32(unsign_arg_228025);\n                bool cond_228027 = to_i32_res_228026 == 1;\n                bool x_228028 = !cond_228027;\n                bool y_228029 = cond_f_res_227891 && x_228028;\n                bool cond_228030 = cond_228027 || y_228029;\n                int32_t defunc_1_get_bit_res_228031;\n                \n                if (cond_228030) {\n                    int32_t defunc_1_get_bit_res_t_res_228032 = 1 ^\n                            to_i32_res_228023;\n                    \n                    defunc_1_get_bit_res_228031 =\n                        defunc_1_get_bit_res_t_res_228032;\n                } else {\n                    defunc_1_get_bit_res_228031 = to_i32_res_228023;\n                }\n                \n                int32_t x_228033 = mul32(2, defunc_1_get_bit_res_228031);\n                int64_t unsign_arg_228034 = ashr64(i64_arg_228020,\n                                                   unsign_arg_227894);\n                int64_t unsign_arg_228035 = (int64_t) 1 & unsign_arg_228034;\n                ",
            "int32_t to_i32_res_228036 = zext_i64_i32(unsign_arg_228035);\n                bool y_228037 = cond_f_res_227892 && x_228028;\n                bool cond_228038 = cond_228027 || y_228037;\n                int32_t defunc_1_get_bit_res_228039;\n                \n                if (cond_228038) {\n                    int32_t defunc_1_get_bit_res_t_res_228040 = 1 ^\n                            to_i32_res_228036;\n                    \n                    defunc_1_get_bit_res_228039 =\n                        defunc_1_get_bit_res_t_res_228040;\n                } else {\n                    defunc_1_get_bit_res_228039 = to_i32_res_228036;\n                }\n                \n                int32_t defunc_0_f_res_228041 = add32(x_228033,\n                                                      defunc_1_get_bit_res_228039);\n                bool cond_228042 = defunc_0_f_res_228041 == 0;\n                int64_t defunc_0_f_res_228043 = btoi_bool_i64(cond_228042);\n                int64_t defunc_0_f_res_228044;\n                int64_t defunc_0_f_res_228045;\n                int64_t defunc_0_f_res_228046;\n                \n                if (cond_228042) {\n                    defunc_0_f_res_228044 = (int64_t) 0;\n                    defunc_0_f_res_228045 = (int64_t) 0;\n                    defunc_0_f_res_228046 = (int64_t) 0;\n                } else {\n                    bool cond_228047 = defunc_0_f_res_228041 == 1;\n                    int64_t defunc_0_f_res_f_res_228048 =\n                            btoi_bool_i64(cond_228047);\n                    int64_t defunc_0_f_res_f_res_228049;\n                    int64_t defunc_0_f_res_f_res_228050;\n                    \n                    if (cond_228047) {\n                        defunc_0_f_res_f_res_228049 = (int64_t) 0;\n                        defunc_0_f_res_f_res_228050 = (int64_t) 0;\n                    } else {\n                        bool cond_228051 = defunc_0_f_res_228041 == 2;\n                        int64_t defunc_0_f_res_f_res_f_res_228052 =\n    ",
            "                            btoi_bool_i64(cond_228051);\n                        bool cond_neg_228053 = !cond_228051;\n                        int64_t defunc_0_f_res_f_res_f_res_228054 =\n                                btoi_bool_i64(cond_neg_228053);\n                        \n                        defunc_0_f_res_f_res_228049 =\n                            defunc_0_f_res_f_res_f_res_228052;\n                        defunc_0_f_res_f_res_228050 =\n                            defunc_0_f_res_f_res_f_res_228054;\n                    }\n                    defunc_0_f_res_228044 = defunc_0_f_res_f_res_228048;\n                    defunc_0_f_res_228045 = defunc_0_f_res_f_res_228049;\n                    defunc_0_f_res_228046 = defunc_0_f_res_f_res_228050;\n                }\n                ((__global int32_t *) mem_231893)[gtid_228003 * n_203572 +\n                                                  gtid_228004] =\n                    defunc_0_f_res_228041;\n                private_mem_236855[i_236863] = defunc_0_f_res_228043;\n                private_mem_236857[i_236863] = defunc_0_f_res_228044;\n                private_mem_236859[i_236863] = defunc_0_f_res_228045;\n                private_mem_236861[i_236863] = defunc_0_f_res_228046;\n            } else {\n                private_mem_236855[i_236863] = (int64_t) 0;\n                private_mem_236857[i_236863] = (int64_t) 0;\n                private_mem_236859[i_236863] = (int64_t) 0;\n                private_mem_236861[i_236863] = (int64_t) 0;\n            }\n        }\n    }\n    // Transpose scan inputs\n    {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236869 = 0; i_236869 < (int64_t) 3; i_236869++) {\n            int64_t sharedIdx_236870 = sext_i32_i64(local_tid_236820) +\n                    i_236869 * segscan_group_sizze_227995;\n            int64_t tmp_236871;\n            \n            tmp_236871 = private_mem_236855[i_236869];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_236870] =\n                tmp_236871;\n   ",
            "     }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236872 = 0; i_236872 < 3; i_236872++) {\n            int32_t sharedIdx_236873 = local_tid_236820 * 3 + i_236872;\n            int64_t tmp_236874;\n            \n            tmp_236874 = ((__local\n                           int64_t *) local_mem_236834)[sext_i32_i64(sharedIdx_236873)];\n            private_mem_236855[sext_i32_i64(i_236872)] = tmp_236874;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236875 = 0; i_236875 < (int64_t) 3; i_236875++) {\n            int64_t sharedIdx_236876 = sext_i32_i64(local_tid_236820) +\n                    i_236875 * segscan_group_sizze_227995;\n            int64_t tmp_236877;\n            \n            tmp_236877 = private_mem_236857[i_236875];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_236876] =\n                tmp_236877;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236878 = 0; i_236878 < 3; i_236878++) {\n            int32_t sharedIdx_236879 = local_tid_236820 * 3 + i_236878;\n            int64_t tmp_236880;\n            \n            tmp_236880 = ((__local\n                           int64_t *) local_mem_236834)[sext_i32_i64(sharedIdx_236879)];\n            private_mem_236857[sext_i32_i64(i_236878)] = tmp_236880;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236881 = 0; i_236881 < (int64_t) 3; i_236881++) {\n            int64_t sharedIdx_236882 = sext_i32_i64(local_tid_236820) +\n                    i_236881 * segscan_group_sizze_227995;\n            int64_t tmp_236883;\n            \n            tmp_236883 = private_mem_236859[i_236881];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_236882] =\n                tmp_236883;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236884 = 0; i_236884 < 3; i_236884++) {\n            int32_t sharedIdx_236885 = local_tid_236820 * 3 + i_236884;\n            int64_t tmp_236886;\n            \n            tmp_236886 = ((__lo",
            "cal\n                           int64_t *) local_mem_236834)[sext_i32_i64(sharedIdx_236885)];\n            private_mem_236859[sext_i32_i64(i_236884)] = tmp_236886;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_236887 = 0; i_236887 < (int64_t) 3; i_236887++) {\n            int64_t sharedIdx_236888 = sext_i32_i64(local_tid_236820) +\n                    i_236887 * segscan_group_sizze_227995;\n            int64_t tmp_236889;\n            \n            tmp_236889 = private_mem_236861[i_236887];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_236888] =\n                tmp_236889;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int32_t i_236890 = 0; i_236890 < 3; i_236890++) {\n            int32_t sharedIdx_236891 = local_tid_236820 * 3 + i_236890;\n            int64_t tmp_236892;\n            \n            tmp_236892 = ((__local\n                           int64_t *) local_mem_236834)[sext_i32_i64(sharedIdx_236891)];\n            private_mem_236861[sext_i32_i64(i_236890)] = tmp_236892;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // Per thread scan\n    {\n        int32_t gidx_236893 = local_tid_236820 * 3 + 1;\n        \n        for (int64_t i_236894 = 0; i_236894 < (int64_t) 2; i_236894++) {\n            bool new_sgm_236895 = smod32(gidx_236893 + sext_i64_i32(i_236894) -\n                                         boundary_236853,\n                                         segsizze_compact_236854) == 0;\n            \n            if (!new_sgm_236895) {\n                int64_t x_228006;\n                int64_t x_228010;\n                \n                x_228006 = private_mem_236855[i_236894];\n                x_228010 = private_mem_236855[i_236894 + (int64_t) 1];\n                \n                int64_t x_228007;\n                int64_t x_228011;\n                \n                x_228007 = private_mem_236857[i_236894];\n                x_228011 = private_mem_236857[i_236894 + (int64_t) 1];\n                \n                int64_t x_2",
            "28008;\n                int64_t x_228012;\n                \n                x_228008 = private_mem_236859[i_236894];\n                x_228012 = private_mem_236859[i_236894 + (int64_t) 1];\n                \n                int64_t x_228009;\n                int64_t x_228013;\n                \n                x_228009 = private_mem_236861[i_236894];\n                x_228013 = private_mem_236861[i_236894 + (int64_t) 1];\n                \n                int64_t defunc_1_op_res_228014 = add64(x_228006, x_228010);\n                int64_t defunc_1_op_res_228015 = add64(x_228007, x_228011);\n                int64_t defunc_1_op_res_228016 = add64(x_228008, x_228012);\n                int64_t defunc_1_op_res_228017 = add64(x_228009, x_228013);\n                \n                private_mem_236855[i_236894 + (int64_t) 1] =\n                    defunc_1_op_res_228014;\n                private_mem_236857[i_236894 + (int64_t) 1] =\n                    defunc_1_op_res_228015;\n                private_mem_236859[i_236894 + (int64_t) 1] =\n                    defunc_1_op_res_228016;\n                private_mem_236861[i_236894 + (int64_t) 1] =\n                    defunc_1_op_res_228017;\n            }\n        }\n    }\n    // Publish results in shared memory\n    {\n        int64_t tmp_236896;\n        \n        tmp_236896 = private_mem_236855[(int64_t) 2];\n        ((__local int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n            tmp_236896;\n        \n        int64_t tmp_236897;\n        \n        tmp_236897 = private_mem_236857[(int64_t) 2];\n        ((__local int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n            tmp_236897;\n        \n        int64_t tmp_236898;\n        \n        tmp",
            "_236898 = private_mem_236859[(int64_t) 2];\n        ((__local int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n            tmp_236898;\n        \n        int64_t tmp_236899;\n        \n        tmp_236899 = private_mem_236861[(int64_t) 2];\n        ((__local int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n            tmp_236899;\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t acc_236912;\n    int64_t acc_236913;\n    int64_t acc_236914;\n    int64_t acc_236915;\n    \n    // Scan results (with warp scan)\n    {\n        int64_t x_236900;\n        int64_t x_236901;\n        int64_t x_236902;\n        int64_t x_236903;\n        int64_t x_236904;\n        int64_t x_236905;\n        int64_t x_236906;\n        int64_t x_236907;\n        int64_t x_236916;\n        int64_t x_236917;\n        int64_t x_236918;\n        int64_t x_236919;\n        int64_t x_236920;\n        int64_t x_236921;\n        int64_t x_236922;\n        int64_t x_236923;\n        bool ltid_in_bounds_236928 = slt64(sext_i32_i64(local_tid_236820),\n                                           segscan_group_sizze_227995);\n        int32_t skip_threads_236929;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_236928) {\n                x_236904 = ((volatile __local\n                             int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236820)];\n                x_236905 = ((volatile __local\n                             int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                        ",
            "                                          (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236820)];\n                x_236906 = ((volatile __local\n                             int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236820)];\n                x_236907 = ((volatile __local\n                             int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                  (int64_t) 8) +\n                                                          sext_i32_i64(local_tid_236820)];\n                if ((local_tid_236820 - squot32(local_tid_236820, 32) * 32) ==\n                    0) {\n                    x_236900 = x_236904;\n                    x_236901 = x_236905;\n                    x_236902 = x_236906;\n                    x_236903 = x_236907;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236929 = 1;\n            while (slt32(skip_threads_236929, 32)) {\n                bool thread_active_236930 = sle32(skip_threads_236929,\n                                                  local_tid_236820 -\n                                                  squot32(local_tid_236820,\n                                                          32) * 32) &&\n                     ltid_in_bounds_236928;\n                \n                if (thread_active_236930) {\n                    // read operands\n                    {\n                        x_236900 = ((volatile __local\n                                     int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_t",
            "id_236820) -\n                                                                   sext_i32_i64(skip_threads_236929))];\n                        x_236901 = ((volatile __local\n                                     int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                   sext_i32_i64(skip_threads_236929))];\n                        x_236902 = ((volatile __local\n                                     int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                   sext_i32_i64(skip_threads_236929))];\n                        x_236903 = ((volatile __local\n                                     int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                          (int64_t) 8) +\n                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                   sext_i32_i64(skip_threads_236929))];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236931 = slt32(smod32((local_tid_236820 + 1) *\n                                                        3 - 1 +\n                                                        segsizze_compact_236854 -\n                                                        boundary_236853,\n                                                        segsizze_compact_236854),\n                                                 (local_tid_236820 + 1) * 3 -\n  ",
            "                                               1 - ((local_tid_236820 -\n                                                       skip_threads_236929 +\n                                                       1) * 3 - 1));\n                    \n                    if (thread_active_236930 && inactive_236931) {\n                        x_236900 = x_236904;\n                        x_236901 = x_236905;\n                        x_236902 = x_236906;\n                        x_236903 = x_236907;\n                    }\n                    if (thread_active_236930) {\n                        if (!inactive_236931) {\n                            int64_t defunc_1_op_res_236908 = add64(x_236900,\n                                                                   x_236904);\n                            int64_t defunc_1_op_res_236909 = add64(x_236901,\n                                                                   x_236905);\n                            int64_t defunc_1_op_res_236910 = add64(x_236902,\n                                                                   x_236906);\n                            int64_t defunc_1_op_res_236911 = add64(x_236903,\n                                                                   x_236907);\n                            \n                            x_236900 = defunc_1_op_res_236908;\n                            x_236901 = defunc_1_op_res_236909;\n                            x_236902 = defunc_1_op_res_236910;\n                            x_236903 = defunc_1_op_res_236911;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236822, skip_threads_236929)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236930) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                               ",
            "(int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236820)] =\n                            x_236900;\n                        x_236904 = x_236900;\n                        ((volatile __local\n                          int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236820)] =\n                            x_236901;\n                        x_236905 = x_236901;\n                        ((volatile __local\n                          int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236820)] =\n                            x_236902;\n                        x_236906 = x_236902;\n                        ((volatile __local\n                          int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                               (int64_t) 8) +\n                                                       sext_i32_i64(local_tid_236820)] =\n                            x_236903;\n                        x_236907 = x_236903;\n                    }\n                }\n                if (sle32(wave_sizze_236822, skip_threads_236929)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236929 *= 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_236820 - squot32(local_tid_236820, 32) * 32) == 31 &&\n                ltid_in_bounds_236928) {\n                ((volatile __local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                       (int64_t) 8) +\n                    ",
            "                           sext_i32_i64(squot32(local_tid_236820,\n                                                                    32))] =\n                    x_236900;\n                ((volatile __local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236820,\n                                                                    32))] =\n                    x_236901;\n                ((volatile __local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236820,\n                                                                    32))] =\n                    x_236902;\n                ((volatile __local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(squot32(local_tid_236820,\n                                                                    32))] =\n                    x_236903;\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_236932;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_236820, 32) == 0 &&\n                    ltid_in_bounds_236928) {\n                    x_236920 = ((volatile __local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236820)];\n           ",
            "         x_236921 = ((volatile __local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236820)];\n                    x_236922 = ((volatile __local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236820)];\n                    x_236923 = ((volatile __local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                      (int64_t) 8) +\n                                                              sext_i32_i64(local_tid_236820)];\n                    if ((local_tid_236820 - squot32(local_tid_236820, 32) *\n                         32) == 0) {\n                        x_236916 = x_236920;\n                        x_236917 = x_236921;\n                        x_236918 = x_236922;\n                        x_236919 = x_236923;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236932 = 1;\n                while (slt32(skip_threads_236932, 32)) {\n                    bool thread_active_236933 = sle32(skip_threads_236932,\n                                                      local_tid_236820 -\n                                                      squot32(local_tid_236820,\n                                                              32) * 32) &&\n                         (squot32(local_tid_236820, 32) == 0 &&\n                          ltid_in_bounds_236928);\n                    \n                    if (thread_active_236933) {\n                        // read operands\n  ",
            "                      {\n                            x_236916 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236820) -\n                                                                       sext_i32_i64(skip_threads_236932))];\n                            x_236917 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236820) -\n                                                                       sext_i32_i64(skip_threads_236932))];\n                            x_236918 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236820) -\n                                                                       sext_i32_i64(skip_threads_236932))];\n                            x_236919 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                              (int64_t) 8) +\n                                                                      (sext_i32_i64(local_tid_236820) -\n                                                                       sext_i32_i64(skip_threads_236932))];\n                        }\n                    }\n                    // perform operation\n                    {\n                 ",
            "       bool inactive_236934 = slt32(smod32((local_tid_236820 *\n                                                             32 + 32 - 1 + 1) *\n                                                            3 - 1 +\n                                                            segsizze_compact_236854 -\n                                                            boundary_236853,\n                                                            segsizze_compact_236854),\n                                                     (local_tid_236820 * 32 +\n                                                      32 - 1 + 1) * 3 - 1 -\n                                                     (((local_tid_236820 -\n                                                        skip_threads_236932) *\n                                                       32 + 32 - 1 + 1) * 3 -\n                                                      1));\n                        \n                        if (thread_active_236933 && inactive_236934) {\n                            x_236916 = x_236920;\n                            x_236917 = x_236921;\n                            x_236918 = x_236922;\n                            x_236919 = x_236923;\n                        }\n                        if (thread_active_236933) {\n                            if (!inactive_236934) {\n                                int64_t defunc_1_op_res_236924 = add64(x_236916,\n                                                                       x_236920);\n                                int64_t defunc_1_op_res_236925 = add64(x_236917,\n                                                                       x_236921);\n                                int64_t defunc_1_op_res_236926 = add64(x_236918,\n                                                                       x_236922);\n                                int64_t defunc_1_op_res_236927 = add64(x_236919,\n                                                                       x_236923);\n                     ",
            "           \n                                x_236916 = defunc_1_op_res_236924;\n                                x_236917 = defunc_1_op_res_236925;\n                                x_236918 = defunc_1_op_res_236926;\n                                x_236919 = defunc_1_op_res_236927;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236822, skip_threads_236932)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236933) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236820)] =\n                                x_236916;\n                            x_236920 = x_236916;\n                            ((volatile __local\n                              int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236820)] =\n                                x_236917;\n                            x_236921 = x_236917;\n                            ((volatile __local\n                              int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                   (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236820)] =\n                                x_236918;\n                            x_236922 = x_236918;\n                            ((volatile __local\n                              int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                         ",
            "                          (int64_t) 8) +\n                                                           sext_i32_i64(local_tid_236820)] =\n                                x_236919;\n                            x_236923 = x_236919;\n                        }\n                    }\n                    if (sle32(wave_sizze_236822, skip_threads_236932)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236932 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_236935 = squot32(local_tid_236820, 32) == 0 ||\n             !ltid_in_bounds_236928;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_236935) {\n                    x_236904 = x_236900;\n                    x_236905 = x_236901;\n                    x_236906 = x_236902;\n                    x_236907 = x_236903;\n                    x_236900 = ((__local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236820,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                    x_236901 = ((__local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236820,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                    x_236902 = ((__l",
            "ocal\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236820,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                    x_236903 = ((__local\n                                 int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                      (int64_t) 8) +\n                                                              (sext_i32_i64(squot32(local_tid_236820,\n                                                                                    32)) -\n                                                               (int64_t) 1)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236936 = slt32(smod32((local_tid_236820 + 1) * 3 -\n                                                    1 +\n                                                    segsizze_compact_236854 -\n                                                    boundary_236853,\n                                                    segsizze_compact_236854),\n                                             (local_tid_236820 + 1) * 3 - 1 -\n                                             ((squot32(local_tid_236820, 32) *\n                                               32 - 1 + 1) * 3 - 1));\n                \n                if (!no_carry_in_236935) {\n                    if (inactive_236936) {\n                        x_236900 = x_236904;\n                        x_236901 = x_236905;\n                        x_236902 = x_236906;\n                        x_236903 = x_236907;\n                    }\n                }\n                if (!no_carry_in_236935) {\n                    if (!i",
            "nactive_236936) {\n                        int64_t defunc_1_op_res_236908 = add64(x_236900,\n                                                               x_236904);\n                        int64_t defunc_1_op_res_236909 = add64(x_236901,\n                                                               x_236905);\n                        int64_t defunc_1_op_res_236910 = add64(x_236902,\n                                                               x_236906);\n                        int64_t defunc_1_op_res_236911 = add64(x_236903,\n                                                               x_236907);\n                        \n                        x_236900 = defunc_1_op_res_236908;\n                        x_236901 = defunc_1_op_res_236909;\n                        x_236902 = defunc_1_op_res_236910;\n                        x_236903 = defunc_1_op_res_236911;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_236935) {\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        x_236900;\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        x_236901;\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        x_236902;\n                    ((__local\n                      int64_t *) local_mem_236834",
            ")[squot64(byte_offsets_236827,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        x_236903;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_236820, 32) == 0 && ltid_in_bounds_236928) {\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n                    x_236904;\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n                    x_236905;\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n                    x_236906;\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                       (int64_t) 8) +\n                                               sext_i32_i64(local_tid_236820)] =\n                    x_236907;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_tid_236820 == 0) {\n            acc_236912 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227995 -\n   ",
            "                                                      (int64_t) 1)];\n            acc_236913 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227995 -\n                                                         (int64_t) 1)];\n            acc_236914 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227995 -\n                                                         (int64_t) 1)];\n            acc_236915 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                (int64_t) 8) +\n                                                        (segscan_group_sizze_227995 -\n                                                         (int64_t) 1)];\n        } else {\n            acc_236912 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236824,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236820) -\n                                                         (int64_t) 1)];\n            acc_236913 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236825,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236820) -\n                                                         (int64_t) 1)];\n            acc_236914 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236826,\n ",
            "                                                               (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236820) -\n                                                         (int64_t) 1)];\n            acc_236915 = ((__local\n                           int64_t *) local_mem_236834)[squot64(byte_offsets_236827,\n                                                                (int64_t) 8) +\n                                                        (sext_i32_i64(local_tid_236820) -\n                                                         (int64_t) 1)];\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    \n    int64_t prefix_236937 = (int64_t) 0;\n    int64_t prefix_236938 = (int64_t) 0;\n    int64_t prefix_236939 = (int64_t) 0;\n    int64_t prefix_236940 = (int64_t) 0;\n    bool block_new_sgm_236941 = sgm_idx_236852 == (int64_t) 0;\n    \n    // Perform lookback\n    {\n        if (block_new_sgm_236941 && local_tid_236820 == 0) {\n            ((volatile __global\n              int64_t *) incprefixes_mem_236805)[dynamic_id_236850] =\n                acc_236912;\n            ((volatile __global\n              int64_t *) incprefixes_mem_236809)[dynamic_id_236850] =\n                acc_236913;\n            ((volatile __global\n              int64_t *) incprefixes_mem_236813)[dynamic_id_236850] =\n                acc_236914;\n            ((volatile __global\n              int64_t *) incprefixes_mem_236817)[dynamic_id_236850] =\n                acc_236915;\n            mem_fence_global();\n            ((volatile __global\n              int8_t *) status_flags_mem_236801)[dynamic_id_236850] =\n                (int8_t) 2;\n            acc_236912 = (int64_t) 0;\n            acc_236913 = (int64_t) 0;\n            acc_236914 = (int64_t) 0;\n            acc_236915 = (int64_t) 0;\n        }\n        if (!block_new_sgm_236941 && slt32(local_tid_236820,\n                                           wave_sizze_236822)) {\n            if (local_tid_236820 == 0) {\n      ",
            "          if (boundary_236853 == sext_i64_i32(segscan_group_sizze_227995 *\n                    (int64_t) 3)) {\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236803)[dynamic_id_236850] =\n                        acc_236912;\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236807)[dynamic_id_236850] =\n                        acc_236913;\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236811)[dynamic_id_236850] =\n                        acc_236914;\n                    ((volatile __global\n                      int64_t *) aggregates_mem_236815)[dynamic_id_236850] =\n                        acc_236915;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_236801)[dynamic_id_236850] =\n                        (int8_t) 1;\n                } else {\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236805)[dynamic_id_236850] =\n                        acc_236912;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236809)[dynamic_id_236850] =\n                        acc_236913;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236813)[dynamic_id_236850] =\n                        acc_236914;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236817)[dynamic_id_236850] =\n                        acc_236915;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_236801)[dynamic_id_236850] =\n                        (int8_t) 2;\n                }\n                \n                int8_t tmp_236942;\n                \n                tmp_236942 = ((volatile __global\n                               int8_t *) status_flags_mem_236801)[dynamic_id_236850 -\n                          ",
            "                                        (int64_t) 1];\n                ((volatile __local int8_t *) local_mem_236834)[(int64_t) 0] =\n                    tmp_236942;\n            }\n            mem_fence_local();\n            \n            int8_t status_236943;\n            \n            status_236943 = ((__local int8_t *) local_mem_236834)[(int64_t) 0];\n            if (status_236943 == (int8_t) 2) {\n                if (local_tid_236820 == 0) {\n                    prefix_236937 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236805)[dynamic_id_236850 -\n                                                                         (int64_t) 1];\n                    prefix_236938 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236809)[dynamic_id_236850 -\n                                                                         (int64_t) 1];\n                    prefix_236939 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236813)[dynamic_id_236850 -\n                                                                         (int64_t) 1];\n                    prefix_236940 = ((volatile __global\n                                      int64_t *) incprefixes_mem_236817)[dynamic_id_236850 -\n                                                                         (int64_t) 1];\n                }\n            } else {\n                int32_t readOffset_236944 = dynamic_id_236850 -\n                        sext_i32_i64(wave_sizze_236822);\n                \n                while (slt32(wave_sizze_236822 * -1, readOffset_236944)) {\n                    int32_t read_i_236945 = readOffset_236944 +\n                            local_tid_236820;\n                    int64_t aggr_236946 = (int64_t) 0;\n                    int64_t aggr_236947 = (int64_t) 0;\n                    int64_t aggr_236948 = (int64_t) 0;\n                    int64_t aggr_236949 = (int64_t) 0;\n                    int8_t flag_2",
            "36950 = (int8_t) 0;\n                    \n                    if (sle32(0, read_i_236945)) {\n                        if (sle64(blockOff_236851 -\n                                  (sext_i32_i64(read_i_236945 + 1) *\n                                   segscan_group_sizze_227995 * (int64_t) 3 -\n                                   (int64_t) 1), sgm_idx_236852)) {\n                            flag_236950 = ((volatile __global\n                                            int8_t *) status_flags_mem_236801)[sext_i32_i64(read_i_236945)];\n                            if (flag_236950 == (int8_t) 2) {\n                                aggr_236946 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236805)[sext_i32_i64(read_i_236945)];\n                                aggr_236947 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236809)[sext_i32_i64(read_i_236945)];\n                                aggr_236948 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236813)[sext_i32_i64(read_i_236945)];\n                                aggr_236949 = ((volatile __global\n                                                int64_t *) incprefixes_mem_236817)[sext_i32_i64(read_i_236945)];\n                            } else {\n                                if (flag_236950 == (int8_t) 1) {\n                                    aggr_236946 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236803)[sext_i32_i64(read_i_236945)];\n                                    aggr_236947 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236807)[sext_i32_i64(read_i_236945)];\n                                    aggr_236948 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236811)[sext_i32_i64(read_i_236945)];\n                                 ",
            "   aggr_236949 = ((volatile __global\n                                                    int64_t *) aggregates_mem_236815)[sext_i32_i64(read_i_236945)];\n                                }\n                            }\n                        } else {\n                            flag_236950 = (int8_t) 2;\n                        }\n                    }\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        aggr_236946;\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        aggr_236947;\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        aggr_236948;\n                    ((__local\n                      int64_t *) local_mem_236834)[squot64(warp_byte_offset_236832,\n                                                           (int64_t) 8) +\n                                                   sext_i32_i64(local_tid_236820)] =\n                        aggr_236949;\n                    ((__local\n                      int8_t *) local_mem_236834)[sext_i32_i64(local_tid_236820)] =\n                        flag_236950;\n                    flag_236950 = ((__local\n                                    int8_t *) local_mem_236834)[sext_i32_i64(wave_sizze_236822) -\n                                                                (int64_t) 1];\n                    if (slt8(flag_236",
            "950, (int8_t) 2)) {\n                        int8_t flg_x_236963;\n                        int8_t flg_y_236964;\n                        int64_t x_236951;\n                        int64_t x_236952;\n                        int64_t x_236953;\n                        int64_t x_236954;\n                        int64_t x_236955;\n                        int64_t x_236956;\n                        int64_t x_236957;\n                        int64_t x_236958;\n                        int32_t skip_threads_236965;\n                        \n                        // read input for in-block scan\n                        {\n                            flg_y_236964 = ((volatile __local\n                                             int8_t *) local_mem_236834)[sext_i32_i64(local_tid_236820)];\n                            x_236955 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236820)];\n                            x_236956 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236820)];\n                            x_236957 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236820)];\n                            x_236958 = ((volatile __local\n                                         int64_t *) local_mem_236834)[squot64(warp_byte_offset_23",
            "6832,\n                                                                              (int64_t) 8) +\n                                                                      sext_i32_i64(local_tid_236820)];\n                            if ((local_tid_236820 - squot32(local_tid_236820,\n                                                            32) * 32) == 0) {\n                                x_236951 = x_236955;\n                                x_236952 = x_236956;\n                                x_236953 = x_236957;\n                                x_236954 = x_236958;\n                                flg_x_236963 = flg_y_236964;\n                            }\n                        }\n                        // in-block scan (hopefully no barriers needed)\n                        {\n                            skip_threads_236965 = 1;\n                            while (slt32(skip_threads_236965, 32)) {\n                                if (sle32(skip_threads_236965,\n                                          local_tid_236820 -\n                                          squot32(local_tid_236820, 32) * 32)) {\n                                    // read operands\n                                    {\n                                        flg_x_236963 = ((volatile __local\n                                                         int8_t *) local_mem_236834)[sext_i32_i64(local_tid_236820) -\n                                                                                     sext_i32_i64(skip_threads_236965)];\n                                        x_236951 = ((volatile __local\n                                                     int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                              ",
            "     sext_i32_i64(skip_threads_236965))];\n                                        x_236952 = ((volatile __local\n                                                     int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                                   sext_i32_i64(skip_threads_236965))];\n                                        x_236953 = ((volatile __local\n                                                     int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                                   sext_i32_i64(skip_threads_236965))];\n                                        x_236954 = ((volatile __local\n                                                     int64_t *) local_mem_236834)[squot64(warp_byte_offset_236832,\n                                                                                          (int64_t) 8) +\n                                                                                  (sext_i32_i64(local_tid_236820) -\n                                                                                   sext_i32_i64(skip_threads_236965))];\n                                    }\n                                    // perform operation\n                                    {\n                                        if (flg_y_236964 == (int8_t) 2 ||\n                                            flg_y_236964 == (int8_t) 0) {\n                                            flg_x_236963 = flg_y_236964;\n                          ",
            "                  x_236951 = x_236955;\n                                            x_236952 = x_236956;\n                                            x_236953 = x_236957;\n                                            x_236954 = x_236958;\n                                        } else {\n                                            int64_t defunc_1_op_res_236959 =\n                                                    add64(x_236951, x_236955);\n                                            int64_t defunc_1_op_res_236960 =\n                                                    add64(x_236952, x_236956);\n                                            int64_t defunc_1_op_res_236961 =\n                                                    add64(x_236953, x_236957);\n                                            int64_t defunc_1_op_res_236962 =\n                                                    add64(x_236954, x_236958);\n                                            \n                                            x_236951 = defunc_1_op_res_236959;\n                                            x_236952 = defunc_1_op_res_236960;\n                                            x_236953 = defunc_1_op_res_236961;\n                                            x_236954 = defunc_1_op_res_236962;\n                                        }\n                                    }\n                                    // write result\n                                    {\n                                        ((volatile __local\n                                          int8_t *) local_mem_236834)[sext_i32_i64(local_tid_236820)] =\n                                            flg_x_236963;\n                                        flg_y_236964 = flg_x_236963;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                                               (int64_t) 8) +\n               ",
            "                                                        sext_i32_i64(local_tid_236820)] =\n                                            x_236951;\n                                        x_236955 = x_236951;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_236820)] =\n                                            x_236952;\n                                        x_236956 = x_236952;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_236820)] =\n                                            x_236953;\n                                        x_236957 = x_236953;\n                                        ((volatile __local\n                                          int64_t *) local_mem_236834)[squot64(warp_byte_offset_236832,\n                                                                               (int64_t) 8) +\n                                                                       sext_i32_i64(local_tid_236820)] =\n                                            x_236954;\n                                        x_236958 = x_236954;\n                                    }\n                                }\n                                skip_threads_236965 *= 2;\n                            }\n                        }\n                    }\n                    flag_236950 = ((__local\n                                    int8_t *) local_mem_236834)[sext_i32_i64(wave_sizze_236822) -\n              ",
            "                                                  (int64_t) 1];\n                    aggr_236946 = ((__local\n                                    int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236822) -\n                                                                  (int64_t) 1)];\n                    aggr_236947 = ((__local\n                                    int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236822) -\n                                                                  (int64_t) 1)];\n                    aggr_236948 = ((__local\n                                    int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236822) -\n                                                                  (int64_t) 1)];\n                    aggr_236949 = ((__local\n                                    int64_t *) local_mem_236834)[squot64(warp_byte_offset_236832,\n                                                                         (int64_t) 8) +\n                                                                 (sext_i32_i64(wave_sizze_236822) -\n                                                                  (int64_t) 1)];\n                    if (flag_236950 == (int8_t) 2) {\n                        readOffset_236944 = wave_sizze_236822 * -1;\n                    } else {\n                        if (flag_236950 == (int8_t) 1) {\n                            readOffset_236944 -= wave_sizze_236822;\n                 ",
            "       }\n                    }\n                    if (slt8((int8_t) 0, flag_236950)) {\n                        int64_t x_236966 = aggr_236946;\n                        int64_t x_236967 = aggr_236947;\n                        int64_t x_236968 = aggr_236948;\n                        int64_t x_236969 = aggr_236949;\n                        int64_t x_236970 = prefix_236937;\n                        int64_t x_236971 = prefix_236938;\n                        int64_t x_236972 = prefix_236939;\n                        int64_t x_236973 = prefix_236940;\n                        int64_t defunc_1_op_res_236974 = add64(x_236966,\n                                                               x_236970);\n                        int64_t defunc_1_op_res_236975 = add64(x_236967,\n                                                               x_236971);\n                        int64_t defunc_1_op_res_236976 = add64(x_236968,\n                                                               x_236972);\n                        int64_t defunc_1_op_res_236977 = add64(x_236969,\n                                                               x_236973);\n                        \n                        prefix_236937 = defunc_1_op_res_236974;\n                        prefix_236938 = defunc_1_op_res_236975;\n                        prefix_236939 = defunc_1_op_res_236976;\n                        prefix_236940 = defunc_1_op_res_236977;\n                    }\n                    mem_fence_local();\n                }\n            }\n            if (local_tid_236820 == 0) {\n                if (boundary_236853 == sext_i64_i32(segscan_group_sizze_227995 *\n                    (int64_t) 3)) {\n                    int64_t x_236978 = prefix_236937;\n                    int64_t x_236979 = prefix_236938;\n                    int64_t x_236980 = prefix_236939;\n                    int64_t x_236981 = prefix_236940;\n                    int64_t x_236982 = acc_236912;\n                    int64_t x_236983 = acc_236913;\n                  ",
            "  int64_t x_236984 = acc_236914;\n                    int64_t x_236985 = acc_236915;\n                    int64_t defunc_1_op_res_236986 = add64(x_236978, x_236982);\n                    int64_t defunc_1_op_res_236987 = add64(x_236979, x_236983);\n                    int64_t defunc_1_op_res_236988 = add64(x_236980, x_236984);\n                    int64_t defunc_1_op_res_236989 = add64(x_236981, x_236985);\n                    \n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236805)[dynamic_id_236850] =\n                        defunc_1_op_res_236986;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236809)[dynamic_id_236850] =\n                        defunc_1_op_res_236987;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236813)[dynamic_id_236850] =\n                        defunc_1_op_res_236988;\n                    ((volatile __global\n                      int64_t *) incprefixes_mem_236817)[dynamic_id_236850] =\n                        defunc_1_op_res_236989;\n                    mem_fence_global();\n                    ((volatile __global\n                      int8_t *) status_flags_mem_236801)[dynamic_id_236850] =\n                        (int8_t) 2;\n                }\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                       (int64_t) 8)] =\n                    prefix_236937;\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                       (int64_t) 8)] =\n                    prefix_236938;\n                ((__local\n                  int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                       (int64_t) 8)] =\n                    prefix_236939;\n                ((__local\n                  int64_t *) local_me",
            "m_236834)[squot64(warp_byte_offset_236832,\n                                                       (int64_t) 8)] =\n                    prefix_236940;\n                acc_236912 = (int64_t) 0;\n                acc_236913 = (int64_t) 0;\n                acc_236914 = (int64_t) 0;\n                acc_236915 = (int64_t) 0;\n            }\n        }\n        if (!(dynamic_id_236850 == (int64_t) 0)) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            prefix_236937 = ((__local\n                              int64_t *) local_mem_236834)[squot64(warp_byte_offset_236829,\n                                                                   (int64_t) 8)];\n            prefix_236938 = ((__local\n                              int64_t *) local_mem_236834)[squot64(warp_byte_offset_236830,\n                                                                   (int64_t) 8)];\n            prefix_236939 = ((__local\n                              int64_t *) local_mem_236834)[squot64(warp_byte_offset_236831,\n                                                                   (int64_t) 8)];\n            prefix_236940 = ((__local\n                              int64_t *) local_mem_236834)[squot64(warp_byte_offset_236832,\n                                                                   (int64_t) 8)];\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    // Distribute results\n    {\n        int64_t x_236990;\n        int64_t x_236994;\n        int64_t x_237002 = prefix_236937;\n        int64_t x_237006 = acc_236912;\n        int64_t x_236991;\n        int64_t x_236995;\n        int64_t x_237003 = prefix_236938;\n        int64_t x_237007 = acc_236913;\n        int64_t x_236992;\n        int64_t x_236996;\n        int64_t x_237004 = prefix_236939;\n        int64_t x_237008 = acc_236914;\n        int64_t x_236993;\n        int64_t x_236997;\n        int64_t x_237005 = prefix_236940;\n        int64_t x_237009 = acc_236915;\n        \n        if (slt32(local_tid_236820 * 3, boundary_236853) &&\n            !block_new_sgm_",
            "236941) {\n            int64_t defunc_1_op_res_237010 = add64(x_237002, x_237006);\n            int64_t defunc_1_op_res_237011 = add64(x_237003, x_237007);\n            int64_t defunc_1_op_res_237012 = add64(x_237004, x_237008);\n            int64_t defunc_1_op_res_237013 = add64(x_237005, x_237009);\n            \n            x_236990 = defunc_1_op_res_237010;\n            x_236991 = defunc_1_op_res_237011;\n            x_236992 = defunc_1_op_res_237012;\n            x_236993 = defunc_1_op_res_237013;\n        } else {\n            x_236990 = acc_236912;\n            x_236991 = acc_236913;\n            x_236992 = acc_236914;\n            x_236993 = acc_236915;\n        }\n        \n        int32_t stopping_point_237014 = segsizze_compact_236854 -\n                srem32(local_tid_236820 * 3 - 1 + segsizze_compact_236854 -\n                       boundary_236853, segsizze_compact_236854);\n        \n        for (int64_t i_237015 = 0; i_237015 < (int64_t) 3; i_237015++) {\n            if (slt32(sext_i64_i32(i_237015), stopping_point_237014 - 1)) {\n                x_236994 = private_mem_236855[i_237015];\n                x_236995 = private_mem_236857[i_237015];\n                x_236996 = private_mem_236859[i_237015];\n                x_236997 = private_mem_236861[i_237015];\n                \n                int64_t defunc_1_op_res_236998 = add64(x_236990, x_236994);\n                int64_t defunc_1_op_res_236999 = add64(x_236991, x_236995);\n                int64_t defunc_1_op_res_237000 = add64(x_236992, x_236996);\n                int64_t defunc_1_op_res_237001 = add64(x_236993, x_236997);\n                \n                private_mem_236855[i_237015] = defunc_1_op_res_236998;\n                private_mem_236857[i_237015] = defunc_1_op_res_236999;\n                private_mem_236859[i_237015] = defunc_1_op_res_237000;\n                private_mem_236861[i_237015] = defunc_1_op_res_237001;\n            }\n        }\n    }\n    // Transpose scan output and Write it to global memory in coalesced fashion",
            "\n    {\n        for (int64_t i_237016 = 0; i_237016 < (int64_t) 3; i_237016++) {\n            int64_t sharedIdx_237017 = sext_i32_i64(local_tid_236820 * 3) +\n                    i_237016;\n            int64_t tmp_237018;\n            \n            tmp_237018 = private_mem_236855[i_237016];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_237017] =\n                tmp_237018;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237019 = 0; i_237019 < (int64_t) 3; i_237019++) {\n            int64_t flat_idx_237020 = blockOff_236851 +\n                    segscan_group_sizze_227995 * i_237019 +\n                    sext_i32_i64(local_tid_236820);\n            int64_t slice_237021 = n_203572;\n            int64_t slice_237022 = partition_sizze_203667 * slice_237021;\n            int64_t gtid_228003 = squot64(flat_idx_237020, slice_237021);\n            int64_t remnant_237023 = flat_idx_237020 - gtid_228003 *\n                    slice_237021;\n            int64_t gtid_228004 = remnant_237023;\n            int64_t remnant_237024 = remnant_237023 - gtid_228004;\n            \n            if (slt64(flat_idx_237020, partition_sizze_203667 * n_203572)) {\n                int64_t tmp_237025;\n                \n                tmp_237025 = ((__local\n                               int64_t *) local_mem_236834)[flat_idx_237020 -\n                                                            blockOff_236851];\n                ((__global int64_t *) mem_231877)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = tmp_237025;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237026 = 0; i_237026 < (int64_t) 3; i_237026++) {\n            int64_t sharedIdx_237027 = sext_i32_i64(local_tid_236820 * 3) +\n                    i_237026;\n            int64_t tmp_237028;\n            \n            tmp_237028 = private_mem_236857[i_237026];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_237027] =\n           ",
            "     tmp_237028;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237029 = 0; i_237029 < (int64_t) 3; i_237029++) {\n            int64_t flat_idx_237030 = blockOff_236851 +\n                    segscan_group_sizze_227995 * i_237029 +\n                    sext_i32_i64(local_tid_236820);\n            int64_t slice_237031 = n_203572;\n            int64_t slice_237032 = partition_sizze_203667 * slice_237031;\n            int64_t gtid_228003 = squot64(flat_idx_237030, slice_237031);\n            int64_t remnant_237033 = flat_idx_237030 - gtid_228003 *\n                    slice_237031;\n            int64_t gtid_228004 = remnant_237033;\n            int64_t remnant_237034 = remnant_237033 - gtid_228004;\n            \n            if (slt64(flat_idx_237030, partition_sizze_203667 * n_203572)) {\n                int64_t tmp_237035;\n                \n                tmp_237035 = ((__local\n                               int64_t *) local_mem_236834)[flat_idx_237030 -\n                                                            blockOff_236851];\n                ((__global int64_t *) mem_231881)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = tmp_237035;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237036 = 0; i_237036 < (int64_t) 3; i_237036++) {\n            int64_t sharedIdx_237037 = sext_i32_i64(local_tid_236820 * 3) +\n                    i_237036;\n            int64_t tmp_237038;\n            \n            tmp_237038 = private_mem_236859[i_237036];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_237037] =\n                tmp_237038;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237039 = 0; i_237039 < (int64_t) 3; i_237039++) {\n            int64_t flat_idx_237040 = blockOff_236851 +\n                    segscan_group_sizze_227995 * i_237039 +\n                    sext_i32_i64(local_tid_236820);\n            int64_t slice_237041 = n_203572;\n            int64",
            "_t slice_237042 = partition_sizze_203667 * slice_237041;\n            int64_t gtid_228003 = squot64(flat_idx_237040, slice_237041);\n            int64_t remnant_237043 = flat_idx_237040 - gtid_228003 *\n                    slice_237041;\n            int64_t gtid_228004 = remnant_237043;\n            int64_t remnant_237044 = remnant_237043 - gtid_228004;\n            \n            if (slt64(flat_idx_237040, partition_sizze_203667 * n_203572)) {\n                int64_t tmp_237045;\n                \n                tmp_237045 = ((__local\n                               int64_t *) local_mem_236834)[flat_idx_237040 -\n                                                            blockOff_236851];\n                ((__global int64_t *) mem_231885)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = tmp_237045;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237046 = 0; i_237046 < (int64_t) 3; i_237046++) {\n            int64_t sharedIdx_237047 = sext_i32_i64(local_tid_236820 * 3) +\n                    i_237046;\n            int64_t tmp_237048;\n            \n            tmp_237048 = private_mem_236861[i_237046];\n            ((__local int64_t *) local_mem_236834)[sharedIdx_237047] =\n                tmp_237048;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        for (int64_t i_237049 = 0; i_237049 < (int64_t) 3; i_237049++) {\n            int64_t flat_idx_237050 = blockOff_236851 +\n                    segscan_group_sizze_227995 * i_237049 +\n                    sext_i32_i64(local_tid_236820);\n            int64_t slice_237051 = n_203572;\n            int64_t slice_237052 = partition_sizze_203667 * slice_237051;\n            int64_t gtid_228003 = squot64(flat_idx_237050, slice_237051);\n            int64_t remnant_237053 = flat_idx_237050 - gtid_228003 *\n                    slice_237051;\n            int64_t gtid_228004 = remnant_237053;\n            int64_t remnant_237054 = remnant_237053 - gtid_228004;\n            \n    ",
            "        if (slt64(flat_idx_237050, partition_sizze_203667 * n_203572)) {\n                int64_t tmp_237055;\n                \n                tmp_237055 = ((__local\n                               int64_t *) local_mem_236834)[flat_idx_237050 -\n                                                            blockOff_236851];\n                ((__global int64_t *) mem_231889)[gtid_228003 * n_203572 +\n                                                  gtid_228004] = tmp_237055;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    // If this is the last block, reset the dynamicId\n    {\n        if (dynamic_id_236850 == sdiv_up64(partition_sizze_203667 * n_203572,\n                                           segscan_group_sizze_227995 *\n                                           (int64_t) 3) - (int64_t) 1) {\n            ((__global int32_t *) mainziid_counter_mem_236799)[(int64_t) 0] = 0;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_227995\n}\n",
            NULL};
static const char *tuning_param_names[] =
                  {"builtin#replicate_f64.group_size_233082",
                   "builtin#replicate_i64.group_size_232623",
                   "builtin#replicate_i8.group_size_232380",
                   "main.group_size_232641", "main.group_size_232842",
                   "main.group_size_234879", "main.group_size_235078",
                   "main.group_size_235328", "main.group_size_235706",
                   "main.group_size_235928", "main.group_size_236201",
                   "main.segmap_group_size_206961",
                   "main.segmap_group_size_207015",
                   "main.segmap_group_size_207172",
                   "main.segmap_group_size_207440",
                   "main.segmap_group_size_208295",
                   "main.segmap_group_size_208534",
                   "main.segmap_group_size_208565",
                   "main.segmap_group_size_209297",
                   "main.segmap_group_size_209501",
                   "main.segmap_group_size_209527",
                   "main.segmap_group_size_209923",
                   "main.segmap_group_size_210127",
                   "main.segmap_group_size_210153",
                   "main.segmap_group_size_210326",
                   "main.segmap_group_size_210389",
                   "main.segmap_group_size_210531",
                   "main.segmap_group_size_210726",
                   "main.segmap_group_size_211061",
                   "main.segmap_group_size_211236",
                   "main.segmap_group_size_211322",
                   "main.segmap_group_size_212223",
                   "main.segmap_group_size_212479",
                   "main.segmap_group_size_212912",
                   "main.segmap_group_size_213144",
                   "main.segmap_group_size_213247",
                   "main.segmap_group_size_214396",
                   "main.segmap_group_size_214716",
                   "main.segmap_group_size_215257",
                   "main.segmap_group_size_215544",
                   "main.segmap_group_size_215674",
                   "main.segmap_group_size_218205",
                   "main.segmap_group_size_218601",
                   "main.segmap_group_size_218672",
                   "main.segmap_group_size_218803",
                   "main.segmap_group_size_218934",
                   "main.segmap_group_size_219065",
                   "main.segmap_group_size_219206",
                   "main.segmap_group_size_219337",
                   "main.segmap_group_size_219698",
                   "main.segmap_group_size_219898",
                   "main.segmap_group_size_220080",
                   "main.segmap_group_size_220563",
                   "main.segmap_group_size_220827",
                   "main.segmap_group_size_221058",
                   "main.segmap_group_size_222316",
                   "main.segmap_group_size_222503",
                   "main.segmap_group_size_222544",
                   "main.segmap_group_size_222733",
                   "main.segmap_group_size_222871",
                   "main.segmap_group_size_223070",
                   "main.segmap_group_size_223126",
                   "main.segmap_group_size_223386",
                   "main.segmap_group_size_223634",
                   "main.segmap_group_size_223823",
                   "main.segmap_group_size_224076",
                   "main.segmap_group_size_224132",
                   "main.segmap_group_size_224460",
                   "main.segmap_group_size_224772",
                   "main.segmap_group_size_225010",
                   "main.segmap_group_size_225330",
                   "main.segmap_group_size_225386",
                   "main.segmap_group_size_225876",
                   "main.segmap_group_size_225932",
                   "main.segmap_group_size_226188",
                   "main.segmap_group_size_226244",
                   "main.segmap_group_size_226592",
                   "main.segmap_group_size_226648",
                   "main.segmap_group_size_226861",
                   "main.segmap_group_size_227117",
                   "main.segmap_group_size_227160",
                   "main.segmap_group_size_227248",
                   "main.segmap_group_size_227667",
                   "main.segmap_group_size_228110",
                   "main.segmap_group_size_228145",
                   "main.segmap_group_size_228214",
                   "main.segmap_group_size_228304",
                   "main.segmap_num_groups_206963",
                   "main.segmap_num_groups_210533",
                   "main.segmap_num_groups_210728",
                   "main.segmap_num_groups_212225",
                   "main.segmap_num_groups_212481",
                   "main.segmap_num_groups_214398",
                   "main.segmap_num_groups_214718",
                   "main.segmap_num_groups_219067",
                   "main.segmap_num_groups_219700",
                   "main.segmap_num_groups_220565",
                   "main.segmap_num_groups_222546",
                   "main.segmap_num_groups_223388",
                   "main.segmap_num_groups_224462",
                   "main.segmap_num_groups_227250",
                   "main.segmap_num_groups_228306",
                   "main.segred_group_size_211164",
                   "main.segred_group_size_211266",
                   "main.segred_group_size_213050",
                   "main.segred_group_size_213183",
                   "main.segred_group_size_215433",
                   "main.segred_group_size_215602",
                   "main.segred_group_size_218698",
                   "main.segred_group_size_218829",
                   "main.segred_group_size_218960",
                   "main.segred_group_size_219283",
                   "main.segred_group_size_219350",
                   "main.segred_group_size_220008",
                   "main.segred_group_size_220102",
                   "main.segred_group_size_220973",
                   "main.segred_group_size_221099",
                   "main.segred_group_size_222814",
                   "main.segred_group_size_222884",
                   "main.segred_group_size_223748",
                   "main.segred_group_size_223845",
                   "main.segred_group_size_224922",
                   "main.segred_group_size_225051",
                   "main.segred_group_size_228157",
                   "main.segred_num_groups_211166",
                   "main.segred_num_groups_211268",
                   "main.segred_num_groups_213052",
                   "main.segred_num_groups_213185",
                   "main.segred_num_groups_215435",
                   "main.segred_num_groups_215604",
                   "main.segred_num_groups_218700",
                   "main.segred_num_groups_218831",
                   "main.segred_num_groups_218962",
                   "main.segred_num_groups_219285",
                   "main.segred_num_groups_219352",
                   "main.segred_num_groups_220010",
                   "main.segred_num_groups_220104",
                   "main.segred_num_groups_220975",
                   "main.segred_num_groups_221101",
                   "main.segred_num_groups_222816",
                   "main.segred_num_groups_222886",
                   "main.segred_num_groups_223750",
                   "main.segred_num_groups_223847",
                   "main.segred_num_groups_224924",
                   "main.segred_num_groups_225053",
                   "main.segred_num_groups_228159",
                   "main.segscan_group_size_206951",
                   "main.segscan_group_size_207071",
                   "main.segscan_group_size_207509",
                   "main.segscan_group_size_218731",
                   "main.segscan_group_size_218862",
                   "main.segscan_group_size_218993",
                   "main.segscan_group_size_227715",
                   "main.segscan_num_groups_206953",
                   "main.segscan_num_groups_207073",
                   "main.segscan_num_groups_207511",
                   "main.segscan_num_groups_218733",
                   "main.segscan_num_groups_218864",
                   "main.segscan_num_groups_218995",
                   "main.segscan_num_groups_227717", "main.suff_intra_par_0",
                   "main.suff_intra_par_1", "main.suff_intra_par_13",
                   "main.suff_intra_par_17", "main.suff_intra_par_2",
                   "main.suff_intra_par_3", "main.suff_intra_par_34",
                   "main.suff_intra_par_36", "main.suff_intra_par_37",
                   "main.suff_intra_par_4", "main.suff_intra_par_5",
                   "main.suff_intra_par_6", "main.suff_intra_par_9",
                   "main.suff_outer_par_10", "main.suff_outer_par_11",
                   "main.suff_outer_par_12", "main.suff_outer_par_14",
                   "main.suff_outer_par_15", "main.suff_outer_par_16",
                   "main.suff_outer_par_18", "main.suff_outer_par_19",
                   "main.suff_outer_par_20", "main.suff_outer_par_21",
                   "main.suff_outer_par_22", "main.suff_outer_par_23",
                   "main.suff_outer_par_24", "main.suff_outer_par_25",
                   "main.suff_outer_par_26", "main.suff_outer_par_27",
                   "main.suff_outer_par_28", "main.suff_outer_par_29",
                   "main.suff_outer_par_30", "main.suff_outer_par_31",
                   "main.suff_outer_par_32", "main.suff_outer_par_33",
                   "main.suff_outer_par_35", "main.suff_outer_par_38",
                   "main.suff_outer_par_7", "main.suff_outer_par_8"};
static const char *tuning_param_vars[] =
                  {"builtinzhreplicate_f64zigroup_sizze_233082",
                   "builtinzhreplicate_i64zigroup_sizze_232623",
                   "builtinzhreplicate_i8zigroup_sizze_232380",
                   "mainzigroup_sizze_232641", "mainzigroup_sizze_232842",
                   "mainzigroup_sizze_234879", "mainzigroup_sizze_235078",
                   "mainzigroup_sizze_235328", "mainzigroup_sizze_235706",
                   "mainzigroup_sizze_235928", "mainzigroup_sizze_236201",
                   "mainzisegmap_group_sizze_206961",
                   "mainzisegmap_group_sizze_207015",
                   "mainzisegmap_group_sizze_207172",
                   "mainzisegmap_group_sizze_207440",
                   "mainzisegmap_group_sizze_208295",
                   "mainzisegmap_group_sizze_208534",
                   "mainzisegmap_group_sizze_208565",
                   "mainzisegmap_group_sizze_209297",
                   "mainzisegmap_group_sizze_209501",
                   "mainzisegmap_group_sizze_209527",
                   "mainzisegmap_group_sizze_209923",
                   "mainzisegmap_group_sizze_210127",
                   "mainzisegmap_group_sizze_210153",
                   "mainzisegmap_group_sizze_210326",
                   "mainzisegmap_group_sizze_210389",
                   "mainzisegmap_group_sizze_210531",
                   "mainzisegmap_group_sizze_210726",
                   "mainzisegmap_group_sizze_211061",
                   "mainzisegmap_group_sizze_211236",
                   "mainzisegmap_group_sizze_211322",
                   "mainzisegmap_group_sizze_212223",
                   "mainzisegmap_group_sizze_212479",
                   "mainzisegmap_group_sizze_212912",
                   "mainzisegmap_group_sizze_213144",
                   "mainzisegmap_group_sizze_213247",
                   "mainzisegmap_group_sizze_214396",
                   "mainzisegmap_group_sizze_214716",
                   "mainzisegmap_group_sizze_215257",
                   "mainzisegmap_group_sizze_215544",
                   "mainzisegmap_group_sizze_215674",
                   "mainzisegmap_group_sizze_218205",
                   "mainzisegmap_group_sizze_218601",
                   "mainzisegmap_group_sizze_218672",
                   "mainzisegmap_group_sizze_218803",
                   "mainzisegmap_group_sizze_218934",
                   "mainzisegmap_group_sizze_219065",
                   "mainzisegmap_group_sizze_219206",
                   "mainzisegmap_group_sizze_219337",
                   "mainzisegmap_group_sizze_219698",
                   "mainzisegmap_group_sizze_219898",
                   "mainzisegmap_group_sizze_220080",
                   "mainzisegmap_group_sizze_220563",
                   "mainzisegmap_group_sizze_220827",
                   "mainzisegmap_group_sizze_221058",
                   "mainzisegmap_group_sizze_222316",
                   "mainzisegmap_group_sizze_222503",
                   "mainzisegmap_group_sizze_222544",
                   "mainzisegmap_group_sizze_222733",
                   "mainzisegmap_group_sizze_222871",
                   "mainzisegmap_group_sizze_223070",
                   "mainzisegmap_group_sizze_223126",
                   "mainzisegmap_group_sizze_223386",
                   "mainzisegmap_group_sizze_223634",
                   "mainzisegmap_group_sizze_223823",
                   "mainzisegmap_group_sizze_224076",
                   "mainzisegmap_group_sizze_224132",
                   "mainzisegmap_group_sizze_224460",
                   "mainzisegmap_group_sizze_224772",
                   "mainzisegmap_group_sizze_225010",
                   "mainzisegmap_group_sizze_225330",
                   "mainzisegmap_group_sizze_225386",
                   "mainzisegmap_group_sizze_225876",
                   "mainzisegmap_group_sizze_225932",
                   "mainzisegmap_group_sizze_226188",
                   "mainzisegmap_group_sizze_226244",
                   "mainzisegmap_group_sizze_226592",
                   "mainzisegmap_group_sizze_226648",
                   "mainzisegmap_group_sizze_226861",
                   "mainzisegmap_group_sizze_227117",
                   "mainzisegmap_group_sizze_227160",
                   "mainzisegmap_group_sizze_227248",
                   "mainzisegmap_group_sizze_227667",
                   "mainzisegmap_group_sizze_228110",
                   "mainzisegmap_group_sizze_228145",
                   "mainzisegmap_group_sizze_228214",
                   "mainzisegmap_group_sizze_228304",
                   "mainzisegmap_num_groups_206963",
                   "mainzisegmap_num_groups_210533",
                   "mainzisegmap_num_groups_210728",
                   "mainzisegmap_num_groups_212225",
                   "mainzisegmap_num_groups_212481",
                   "mainzisegmap_num_groups_214398",
                   "mainzisegmap_num_groups_214718",
                   "mainzisegmap_num_groups_219067",
                   "mainzisegmap_num_groups_219700",
                   "mainzisegmap_num_groups_220565",
                   "mainzisegmap_num_groups_222546",
                   "mainzisegmap_num_groups_223388",
                   "mainzisegmap_num_groups_224462",
                   "mainzisegmap_num_groups_227250",
                   "mainzisegmap_num_groups_228306",
                   "mainzisegred_group_sizze_211164",
                   "mainzisegred_group_sizze_211266",
                   "mainzisegred_group_sizze_213050",
                   "mainzisegred_group_sizze_213183",
                   "mainzisegred_group_sizze_215433",
                   "mainzisegred_group_sizze_215602",
                   "mainzisegred_group_sizze_218698",
                   "mainzisegred_group_sizze_218829",
                   "mainzisegred_group_sizze_218960",
                   "mainzisegred_group_sizze_219283",
                   "mainzisegred_group_sizze_219350",
                   "mainzisegred_group_sizze_220008",
                   "mainzisegred_group_sizze_220102",
                   "mainzisegred_group_sizze_220973",
                   "mainzisegred_group_sizze_221099",
                   "mainzisegred_group_sizze_222814",
                   "mainzisegred_group_sizze_222884",
                   "mainzisegred_group_sizze_223748",
                   "mainzisegred_group_sizze_223845",
                   "mainzisegred_group_sizze_224922",
                   "mainzisegred_group_sizze_225051",
                   "mainzisegred_group_sizze_228157",
                   "mainzisegred_num_groups_211166",
                   "mainzisegred_num_groups_211268",
                   "mainzisegred_num_groups_213052",
                   "mainzisegred_num_groups_213185",
                   "mainzisegred_num_groups_215435",
                   "mainzisegred_num_groups_215604",
                   "mainzisegred_num_groups_218700",
                   "mainzisegred_num_groups_218831",
                   "mainzisegred_num_groups_218962",
                   "mainzisegred_num_groups_219285",
                   "mainzisegred_num_groups_219352",
                   "mainzisegred_num_groups_220010",
                   "mainzisegred_num_groups_220104",
                   "mainzisegred_num_groups_220975",
                   "mainzisegred_num_groups_221101",
                   "mainzisegred_num_groups_222816",
                   "mainzisegred_num_groups_222886",
                   "mainzisegred_num_groups_223750",
                   "mainzisegred_num_groups_223847",
                   "mainzisegred_num_groups_224924",
                   "mainzisegred_num_groups_225053",
                   "mainzisegred_num_groups_228159",
                   "mainzisegscan_group_sizze_206951",
                   "mainzisegscan_group_sizze_207071",
                   "mainzisegscan_group_sizze_207509",
                   "mainzisegscan_group_sizze_218731",
                   "mainzisegscan_group_sizze_218862",
                   "mainzisegscan_group_sizze_218993",
                   "mainzisegscan_group_sizze_227715",
                   "mainzisegscan_num_groups_206953",
                   "mainzisegscan_num_groups_207073",
                   "mainzisegscan_num_groups_207511",
                   "mainzisegscan_num_groups_218733",
                   "mainzisegscan_num_groups_218864",
                   "mainzisegscan_num_groups_218995",
                   "mainzisegscan_num_groups_227717", "mainzisuff_intra_par_0",
                   "mainzisuff_intra_par_1", "mainzisuff_intra_par_13",
                   "mainzisuff_intra_par_17", "mainzisuff_intra_par_2",
                   "mainzisuff_intra_par_3", "mainzisuff_intra_par_34",
                   "mainzisuff_intra_par_36", "mainzisuff_intra_par_37",
                   "mainzisuff_intra_par_4", "mainzisuff_intra_par_5",
                   "mainzisuff_intra_par_6", "mainzisuff_intra_par_9",
                   "mainzisuff_outer_par_10", "mainzisuff_outer_par_11",
                   "mainzisuff_outer_par_12", "mainzisuff_outer_par_14",
                   "mainzisuff_outer_par_15", "mainzisuff_outer_par_16",
                   "mainzisuff_outer_par_18", "mainzisuff_outer_par_19",
                   "mainzisuff_outer_par_20", "mainzisuff_outer_par_21",
                   "mainzisuff_outer_par_22", "mainzisuff_outer_par_23",
                   "mainzisuff_outer_par_24", "mainzisuff_outer_par_25",
                   "mainzisuff_outer_par_26", "mainzisuff_outer_par_27",
                   "mainzisuff_outer_par_28", "mainzisuff_outer_par_29",
                   "mainzisuff_outer_par_30", "mainzisuff_outer_par_31",
                   "mainzisuff_outer_par_32", "mainzisuff_outer_par_33",
                   "mainzisuff_outer_par_35", "mainzisuff_outer_par_38",
                   "mainzisuff_outer_par_7", "mainzisuff_outer_par_8"};
static const char *tuning_param_classes[] = {"group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "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_233082;
    int64_t *builtinzhreplicate_i64zigroup_sizze_232623;
    int64_t *builtinzhreplicate_i8zigroup_sizze_232380;
    int64_t *mainzigroup_sizze_232641;
    int64_t *mainzigroup_sizze_232842;
    int64_t *mainzigroup_sizze_234879;
    int64_t *mainzigroup_sizze_235078;
    int64_t *mainzigroup_sizze_235328;
    int64_t *mainzigroup_sizze_235706;
    int64_t *mainzigroup_sizze_235928;
    int64_t *mainzigroup_sizze_236201;
    int64_t *mainzisegmap_group_sizze_206961;
    int64_t *mainzisegmap_group_sizze_207015;
    int64_t *mainzisegmap_group_sizze_207172;
    int64_t *mainzisegmap_group_sizze_207440;
    int64_t *mainzisegmap_group_sizze_208295;
    int64_t *mainzisegmap_group_sizze_208534;
    int64_t *mainzisegmap_group_sizze_208565;
    int64_t *mainzisegmap_group_sizze_209297;
    int64_t *mainzisegmap_group_sizze_209501;
    int64_t *mainzisegmap_group_sizze_209527;
    int64_t *mainzisegmap_group_sizze_209923;
    int64_t *mainzisegmap_group_sizze_210127;
    int64_t *mainzisegmap_group_sizze_210153;
    int64_t *mainzisegmap_group_sizze_210326;
    int64_t *mainzisegmap_group_sizze_210389;
    int64_t *mainzisegmap_group_sizze_210531;
    int64_t *mainzisegmap_group_sizze_210726;
    int64_t *mainzisegmap_group_sizze_211061;
    int64_t *mainzisegmap_group_sizze_211236;
    int64_t *mainzisegmap_group_sizze_211322;
    int64_t *mainzisegmap_group_sizze_212223;
    int64_t *mainzisegmap_group_sizze_212479;
    int64_t *mainzisegmap_group_sizze_212912;
    int64_t *mainzisegmap_group_sizze_213144;
    int64_t *mainzisegmap_group_sizze_213247;
    int64_t *mainzisegmap_group_sizze_214396;
    int64_t *mainzisegmap_group_sizze_214716;
    int64_t *mainzisegmap_group_sizze_215257;
    int64_t *mainzisegmap_group_sizze_215544;
    int64_t *mainzisegmap_group_sizze_215674;
    int64_t *mainzisegmap_group_sizze_218205;
    int64_t *mainzisegmap_group_sizze_218601;
    int64_t *mainzisegmap_group_sizze_218672;
    int64_t *mainzisegmap_group_sizze_218803;
    int64_t *mainzisegmap_group_sizze_218934;
    int64_t *mainzisegmap_group_sizze_219065;
    int64_t *mainzisegmap_group_sizze_219206;
    int64_t *mainzisegmap_group_sizze_219337;
    int64_t *mainzisegmap_group_sizze_219698;
    int64_t *mainzisegmap_group_sizze_219898;
    int64_t *mainzisegmap_group_sizze_220080;
    int64_t *mainzisegmap_group_sizze_220563;
    int64_t *mainzisegmap_group_sizze_220827;
    int64_t *mainzisegmap_group_sizze_221058;
    int64_t *mainzisegmap_group_sizze_222316;
    int64_t *mainzisegmap_group_sizze_222503;
    int64_t *mainzisegmap_group_sizze_222544;
    int64_t *mainzisegmap_group_sizze_222733;
    int64_t *mainzisegmap_group_sizze_222871;
    int64_t *mainzisegmap_group_sizze_223070;
    int64_t *mainzisegmap_group_sizze_223126;
    int64_t *mainzisegmap_group_sizze_223386;
    int64_t *mainzisegmap_group_sizze_223634;
    int64_t *mainzisegmap_group_sizze_223823;
    int64_t *mainzisegmap_group_sizze_224076;
    int64_t *mainzisegmap_group_sizze_224132;
    int64_t *mainzisegmap_group_sizze_224460;
    int64_t *mainzisegmap_group_sizze_224772;
    int64_t *mainzisegmap_group_sizze_225010;
    int64_t *mainzisegmap_group_sizze_225330;
    int64_t *mainzisegmap_group_sizze_225386;
    int64_t *mainzisegmap_group_sizze_225876;
    int64_t *mainzisegmap_group_sizze_225932;
    int64_t *mainzisegmap_group_sizze_226188;
    int64_t *mainzisegmap_group_sizze_226244;
    int64_t *mainzisegmap_group_sizze_226592;
    int64_t *mainzisegmap_group_sizze_226648;
    int64_t *mainzisegmap_group_sizze_226861;
    int64_t *mainzisegmap_group_sizze_227117;
    int64_t *mainzisegmap_group_sizze_227160;
    int64_t *mainzisegmap_group_sizze_227248;
    int64_t *mainzisegmap_group_sizze_227667;
    int64_t *mainzisegmap_group_sizze_228110;
    int64_t *mainzisegmap_group_sizze_228145;
    int64_t *mainzisegmap_group_sizze_228214;
    int64_t *mainzisegmap_group_sizze_228304;
    int64_t *mainzisegmap_num_groups_206963;
    int64_t *mainzisegmap_num_groups_210533;
    int64_t *mainzisegmap_num_groups_210728;
    int64_t *mainzisegmap_num_groups_212225;
    int64_t *mainzisegmap_num_groups_212481;
    int64_t *mainzisegmap_num_groups_214398;
    int64_t *mainzisegmap_num_groups_214718;
    int64_t *mainzisegmap_num_groups_219067;
    int64_t *mainzisegmap_num_groups_219700;
    int64_t *mainzisegmap_num_groups_220565;
    int64_t *mainzisegmap_num_groups_222546;
    int64_t *mainzisegmap_num_groups_223388;
    int64_t *mainzisegmap_num_groups_224462;
    int64_t *mainzisegmap_num_groups_227250;
    int64_t *mainzisegmap_num_groups_228306;
    int64_t *mainzisegred_group_sizze_211164;
    int64_t *mainzisegred_group_sizze_211266;
    int64_t *mainzisegred_group_sizze_213050;
    int64_t *mainzisegred_group_sizze_213183;
    int64_t *mainzisegred_group_sizze_215433;
    int64_t *mainzisegred_group_sizze_215602;
    int64_t *mainzisegred_group_sizze_218698;
    int64_t *mainzisegred_group_sizze_218829;
    int64_t *mainzisegred_group_sizze_218960;
    int64_t *mainzisegred_group_sizze_219283;
    int64_t *mainzisegred_group_sizze_219350;
    int64_t *mainzisegred_group_sizze_220008;
    int64_t *mainzisegred_group_sizze_220102;
    int64_t *mainzisegred_group_sizze_220973;
    int64_t *mainzisegred_group_sizze_221099;
    int64_t *mainzisegred_group_sizze_222814;
    int64_t *mainzisegred_group_sizze_222884;
    int64_t *mainzisegred_group_sizze_223748;
    int64_t *mainzisegred_group_sizze_223845;
    int64_t *mainzisegred_group_sizze_224922;
    int64_t *mainzisegred_group_sizze_225051;
    int64_t *mainzisegred_group_sizze_228157;
    int64_t *mainzisegred_num_groups_211166;
    int64_t *mainzisegred_num_groups_211268;
    int64_t *mainzisegred_num_groups_213052;
    int64_t *mainzisegred_num_groups_213185;
    int64_t *mainzisegred_num_groups_215435;
    int64_t *mainzisegred_num_groups_215604;
    int64_t *mainzisegred_num_groups_218700;
    int64_t *mainzisegred_num_groups_218831;
    int64_t *mainzisegred_num_groups_218962;
    int64_t *mainzisegred_num_groups_219285;
    int64_t *mainzisegred_num_groups_219352;
    int64_t *mainzisegred_num_groups_220010;
    int64_t *mainzisegred_num_groups_220104;
    int64_t *mainzisegred_num_groups_220975;
    int64_t *mainzisegred_num_groups_221101;
    int64_t *mainzisegred_num_groups_222816;
    int64_t *mainzisegred_num_groups_222886;
    int64_t *mainzisegred_num_groups_223750;
    int64_t *mainzisegred_num_groups_223847;
    int64_t *mainzisegred_num_groups_224924;
    int64_t *mainzisegred_num_groups_225053;
    int64_t *mainzisegred_num_groups_228159;
    int64_t *mainzisegscan_group_sizze_206951;
    int64_t *mainzisegscan_group_sizze_207071;
    int64_t *mainzisegscan_group_sizze_207509;
    int64_t *mainzisegscan_group_sizze_218731;
    int64_t *mainzisegscan_group_sizze_218862;
    int64_t *mainzisegscan_group_sizze_218993;
    int64_t *mainzisegscan_group_sizze_227715;
    int64_t *mainzisegscan_num_groups_206953;
    int64_t *mainzisegscan_num_groups_207073;
    int64_t *mainzisegscan_num_groups_207511;
    int64_t *mainzisegscan_num_groups_218733;
    int64_t *mainzisegscan_num_groups_218864;
    int64_t *mainzisegscan_num_groups_218995;
    int64_t *mainzisegscan_num_groups_227717;
    int64_t *mainzisuff_intra_par_0;
    int64_t *mainzisuff_intra_par_1;
    int64_t *mainzisuff_intra_par_13;
    int64_t *mainzisuff_intra_par_17;
    int64_t *mainzisuff_intra_par_2;
    int64_t *mainzisuff_intra_par_3;
    int64_t *mainzisuff_intra_par_34;
    int64_t *mainzisuff_intra_par_36;
    int64_t *mainzisuff_intra_par_37;
    int64_t *mainzisuff_intra_par_4;
    int64_t *mainzisuff_intra_par_5;
    int64_t *mainzisuff_intra_par_6;
    int64_t *mainzisuff_intra_par_9;
    int64_t *mainzisuff_outer_par_10;
    int64_t *mainzisuff_outer_par_11;
    int64_t *mainzisuff_outer_par_12;
    int64_t *mainzisuff_outer_par_14;
    int64_t *mainzisuff_outer_par_15;
    int64_t *mainzisuff_outer_par_16;
    int64_t *mainzisuff_outer_par_18;
    int64_t *mainzisuff_outer_par_19;
    int64_t *mainzisuff_outer_par_20;
    int64_t *mainzisuff_outer_par_21;
    int64_t *mainzisuff_outer_par_22;
    int64_t *mainzisuff_outer_par_23;
    int64_t *mainzisuff_outer_par_24;
    int64_t *mainzisuff_outer_par_25;
    int64_t *mainzisuff_outer_par_26;
    int64_t *mainzisuff_outer_par_27;
    int64_t *mainzisuff_outer_par_28;
    int64_t *mainzisuff_outer_par_29;
    int64_t *mainzisuff_outer_par_30;
    int64_t *mainzisuff_outer_par_31;
    int64_t *mainzisuff_outer_par_32;
    int64_t *mainzisuff_outer_par_33;
    int64_t *mainzisuff_outer_par_35;
    int64_t *mainzisuff_outer_par_38;
    int64_t *mainzisuff_outer_par_7;
    int64_t *mainzisuff_outer_par_8;
};
struct futhark_context_config {
    int in_use;
    struct cuda_config cu_cfg;
    int profiling;
    int64_t tuning_params[199];
    int num_nvrtc_opts;
    const char **nvrtc_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->profiling = 0;
    cfg->num_nvrtc_opts = 0;
    cfg->nvrtc_opts = (const char **) malloc(sizeof(const char *));
    cfg->nvrtc_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] = 0;
    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] = 32;
    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;
    cfg->tuning_params[198] = 0;
    cuda_config_init(&cfg->cu_cfg, 199, 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->nvrtc_opts);
    free(cfg);
}
void futhark_context_config_add_nvrtc_option(struct futhark_context_config *cfg,
                                             const char *opt)
{
    cfg->nvrtc_opts[cfg->num_nvrtc_opts] = opt;
    cfg->num_nvrtc_opts++;
    cfg->nvrtc_opts = (const char **) realloc(cfg->nvrtc_opts,
                                              (cfg->num_nvrtc_opts + 1) *
                                              sizeof(const char *));
    cfg->nvrtc_opts[cfg->num_nvrtc_opts] = NULL;
}
void futhark_context_config_set_debugging(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->cu_cfg.logging = cfg->cu_cfg.debugging = flag;
}
void futhark_context_config_set_profiling(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->profiling = flag;
}
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int flag)
{
    cfg->cu_cfg.logging = flag;
}
void futhark_context_config_set_device(struct futhark_context_config *cfg, const
                                       char *s)
{
    set_preferred_device(&cfg->cu_cfg, s);
}
void futhark_context_config_dump_program_to(struct futhark_context_config *cfg,
                                            const char *path)
{
    cfg->cu_cfg.dump_program_to = path;
}
void futhark_context_config_load_program_from(struct futhark_context_config *cfg,
                                              const char *path)
{
    cfg->cu_cfg.load_program_from = path;
}
void futhark_context_config_dump_ptx_to(struct futhark_context_config *cfg,
                                        const char *path)
{
    cfg->cu_cfg.dump_ptx_to = path;
}
void futhark_context_config_load_ptx_from(struct futhark_context_config *cfg,
                                          const char *path)
{
    cfg->cu_cfg.load_ptx_from = path;
}
void futhark_context_config_set_default_group_size(struct futhark_context_config *cfg,
                                                   int size)
{
    cfg->cu_cfg.default_block_size = size;
    cfg->cu_cfg.default_block_size_changed = 1;
}
void futhark_context_config_set_default_num_groups(struct futhark_context_config *cfg,
                                                   int num)
{
    cfg->cu_cfg.default_grid_size = num;
    cfg->cu_cfg.default_grid_size_changed = 1;
}
void futhark_context_config_set_default_tile_size(struct futhark_context_config *cfg,
                                                  int size)
{
    cfg->cu_cfg.default_tile_size = size;
    cfg->cu_cfg.default_tile_size_changed = 1;
}
void futhark_context_config_set_default_reg_tile_size(struct futhark_context_config *cfg,
                                                      int size)
{
    cfg->cu_cfg.default_reg_tile_size = size;
}
void futhark_context_config_set_default_threshold(struct futhark_context_config *cfg,
                                                  int size)
{
    cfg->cu_cfg.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 < 199; 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->cu_cfg.default_block_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_num_groups") == 0) {
        cfg->cu_cfg.default_grid_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_threshold") == 0) {
        cfg->cu_cfg.default_threshold = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_tile_size") == 0) {
        cfg->cu_cfg.default_tile_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_reg_tile_size") == 0) {
        cfg->cu_cfg.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 mainziid_counter_mem_232365;
    struct memblock_device mainziid_counter_mem_232515;
    struct memblock_device mainziid_counter_mem_232722;
    struct memblock_device mainzicounter_mem_233296;
    struct memblock_device mainzicounter_mem_233384;
    struct memblock_device mainzicounter_mem_233645;
    struct memblock_device mainzicounter_mem_233753;
    struct memblock_device mainzicounter_mem_234058;
    struct memblock_device mainzicounter_mem_234178;
    struct memblock_device mainzicounter_mem_234373;
    struct memblock_device mainziid_counter_mem_234410;
    struct memblock_device mainzicounter_mem_234554;
    struct memblock_device mainziid_counter_mem_234591;
    struct memblock_device mainzicounter_mem_234735;
    struct memblock_device mainziid_counter_mem_234772;
    struct memblock_device mainzicounter_mem_234952;
    struct memblock_device mainzicounter_mem_235034;
    struct memblock_device mainzicounter_mem_235176;
    struct memblock_device mainzicounter_mem_235278;
    struct memblock_device mainzicounter_mem_235446;
    struct memblock_device mainzicounter_mem_235560;
    struct memblock_device mainzicounter_mem_235802;
    struct memblock_device mainzicounter_mem_235884;
    struct memblock_device mainzicounter_mem_236049;
    struct memblock_device mainzicounter_mem_236151;
    struct memblock_device mainzicounter_mem_236342;
    struct memblock_device mainzicounter_mem_236456;
    struct memblock_device mainziid_counter_mem_236799;
    struct memblock_device mainzicounter_mem_237113;
    CUfunction builtinzhreplicate_f64zireplicate_233079;
    int64_t builtinzhreplicate_f64zireplicate_233079_total_runtime;
    int builtinzhreplicate_f64zireplicate_233079_runs;
    CUfunction builtinzhreplicate_i64zireplicate_232620;
    int64_t builtinzhreplicate_i64zireplicate_232620_total_runtime;
    int builtinzhreplicate_i64zireplicate_232620_runs;
    CUfunction builtinzhreplicate_i8zireplicate_232377;
    int64_t builtinzhreplicate_i8zireplicate_232377_total_runtime;
    int builtinzhreplicate_i8zireplicate_232377_runs;
    CUfunction gpu_map_transpose_f64;
    int64_t gpu_map_transpose_f64_total_runtime;
    int gpu_map_transpose_f64_runs;
    CUfunction gpu_map_transpose_f64_low_height;
    int64_t gpu_map_transpose_f64_low_height_total_runtime;
    int gpu_map_transpose_f64_low_height_runs;
    CUfunction gpu_map_transpose_f64_low_width;
    int64_t gpu_map_transpose_f64_low_width_total_runtime;
    int gpu_map_transpose_f64_low_width_runs;
    CUfunction gpu_map_transpose_f64_small;
    int64_t gpu_map_transpose_f64_small_total_runtime;
    int gpu_map_transpose_f64_small_runs;
    CUfunction gpu_map_transpose_i64;
    int64_t gpu_map_transpose_i64_total_runtime;
    int gpu_map_transpose_i64_runs;
    CUfunction gpu_map_transpose_i64_low_height;
    int64_t gpu_map_transpose_i64_low_height_total_runtime;
    int gpu_map_transpose_i64_low_height_runs;
    CUfunction gpu_map_transpose_i64_low_width;
    int64_t gpu_map_transpose_i64_low_width_total_runtime;
    int gpu_map_transpose_i64_low_width_runs;
    CUfunction gpu_map_transpose_i64_small;
    int64_t gpu_map_transpose_i64_small_total_runtime;
    int gpu_map_transpose_i64_small_runs;
    CUfunction mainzicopy_232638;
    int64_t mainzicopy_232638_total_runtime;
    int mainzicopy_232638_runs;
    CUfunction mainzicopy_232839;
    int64_t mainzicopy_232839_total_runtime;
    int mainzicopy_232839_runs;
    CUfunction mainzicopy_234876;
    int64_t mainzicopy_234876_total_runtime;
    int mainzicopy_234876_runs;
    CUfunction mainzicopy_235075;
    int64_t mainzicopy_235075_total_runtime;
    int mainzicopy_235075_runs;
    CUfunction mainzicopy_235325;
    int64_t mainzicopy_235325_total_runtime;
    int mainzicopy_235325_runs;
    CUfunction mainzicopy_235703;
    int64_t mainzicopy_235703_total_runtime;
    int mainzicopy_235703_runs;
    CUfunction mainzicopy_235925;
    int64_t mainzicopy_235925_total_runtime;
    int mainzicopy_235925_runs;
    CUfunction mainzicopy_236198;
    int64_t mainzicopy_236198_total_runtime;
    int mainzicopy_236198_runs;
    CUfunction mainzisegmap_206959;
    int64_t mainzisegmap_206959_total_runtime;
    int mainzisegmap_206959_runs;
    CUfunction mainzisegmap_207135;
    int64_t mainzisegmap_207135_total_runtime;
    int mainzisegmap_207135_runs;
    CUfunction mainzisegmap_207260;
    int64_t mainzisegmap_207260_total_runtime;
    int mainzisegmap_207260_runs;
    CUfunction mainzisegmap_207695;
    int64_t mainzisegmap_207695_total_runtime;
    int mainzisegmap_207695_runs;
    CUfunction mainzisegmap_208908;
    int64_t mainzisegmap_208908_total_runtime;
    int mainzisegmap_208908_runs;
    CUfunction mainzisegmap_208922;
    int64_t mainzisegmap_208922_total_runtime;
    int mainzisegmap_208922_runs;
    CUfunction mainzisegmap_208946;
    int64_t mainzisegmap_208946_total_runtime;
    int mainzisegmap_208946_runs;
    CUfunction mainzisegmap_209556;
    int64_t mainzisegmap_209556_total_runtime;
    int mainzisegmap_209556_runs;
    CUfunction mainzisegmap_209568;
    int64_t mainzisegmap_209568_total_runtime;
    int mainzisegmap_209568_runs;
    CUfunction mainzisegmap_209589;
    int64_t mainzisegmap_209589_total_runtime;
    int mainzisegmap_209589_runs;
    CUfunction mainzisegmap_210182;
    int64_t mainzisegmap_210182_total_runtime;
    int mainzisegmap_210182_runs;
    CUfunction mainzisegmap_210194;
    int64_t mainzisegmap_210194_total_runtime;
    int mainzisegmap_210194_runs;
    CUfunction mainzisegmap_210215;
    int64_t mainzisegmap_210215_total_runtime;
    int mainzisegmap_210215_runs;
    CUfunction mainzisegmap_210357;
    int64_t mainzisegmap_210357_total_runtime;
    int mainzisegmap_210357_runs;
    CUfunction mainzisegmap_210502;
    int64_t mainzisegmap_210502_total_runtime;
    int mainzisegmap_210502_runs;
    CUfunction mainzisegmap_210632;
    int64_t mainzisegmap_210632_total_runtime;
    int mainzisegmap_210632_runs;
    CUfunction mainzisegmap_211772;
    int64_t mainzisegmap_211772_total_runtime;
    int mainzisegmap_211772_runs;
    CUfunction mainzisegmap_211980;
    int64_t mainzisegmap_211980_total_runtime;
    int mainzisegmap_211980_runs;
    CUfunction mainzisegmap_212069;
    int64_t mainzisegmap_212069_total_runtime;
    int mainzisegmap_212069_runs;
    CUfunction mainzisegmap_212141;
    int64_t mainzisegmap_212141_total_runtime;
    int mainzisegmap_212141_runs;
    CUfunction mainzisegmap_212355;
    int64_t mainzisegmap_212355_total_runtime;
    int mainzisegmap_212355_runs;
    CUfunction mainzisegmap_213809;
    int64_t mainzisegmap_213809_total_runtime;
    int mainzisegmap_213809_runs;
    CUfunction mainzisegmap_214084;
    int64_t mainzisegmap_214084_total_runtime;
    int mainzisegmap_214084_runs;
    CUfunction mainzisegmap_214201;
    int64_t mainzisegmap_214201_total_runtime;
    int mainzisegmap_214201_runs;
    CUfunction mainzisegmap_214285;
    int64_t mainzisegmap_214285_total_runtime;
    int mainzisegmap_214285_runs;
    CUfunction mainzisegmap_214560;
    int64_t mainzisegmap_214560_total_runtime;
    int mainzisegmap_214560_runs;
    CUfunction mainzisegmap_216352;
    int64_t mainzisegmap_216352_total_runtime;
    int mainzisegmap_216352_runs;
    CUfunction mainzisegmap_216697;
    int64_t mainzisegmap_216697_total_runtime;
    int mainzisegmap_216697_runs;
    CUfunction mainzisegmap_216846;
    int64_t mainzisegmap_216846_total_runtime;
    int mainzisegmap_216846_runs;
    CUfunction mainzisegmap_216942;
    int64_t mainzisegmap_216942_total_runtime;
    int mainzisegmap_216942_runs;
    CUfunction mainzisegmap_218503;
    int64_t mainzisegmap_218503_total_runtime;
    int mainzisegmap_218503_runs;
    CUfunction mainzisegmap_218652;
    int64_t mainzisegmap_218652_total_runtime;
    int mainzisegmap_218652_runs;
    CUfunction mainzisegmap_218688;
    int64_t mainzisegmap_218688_total_runtime;
    int mainzisegmap_218688_runs;
    CUfunction mainzisegmap_218819;
    int64_t mainzisegmap_218819_total_runtime;
    int mainzisegmap_218819_runs;
    CUfunction mainzisegmap_218950;
    int64_t mainzisegmap_218950_total_runtime;
    int mainzisegmap_218950_runs;
    CUfunction mainzisegmap_219139;
    int64_t mainzisegmap_219139_total_runtime;
    int mainzisegmap_219139_runs;
    CUfunction mainzisegmap_219524;
    int64_t mainzisegmap_219524_total_runtime;
    int mainzisegmap_219524_runs;
    CUfunction mainzisegmap_219641;
    int64_t mainzisegmap_219641_total_runtime;
    int mainzisegmap_219641_runs;
    CUfunction mainzisegmap_219802;
    int64_t mainzisegmap_219802_total_runtime;
    int mainzisegmap_219802_runs;
    CUfunction mainzisegmap_220323;
    int64_t mainzisegmap_220323_total_runtime;
    int mainzisegmap_220323_runs;
    CUfunction mainzisegmap_220480;
    int64_t mainzisegmap_220480_total_runtime;
    int mainzisegmap_220480_runs;
    CUfunction mainzisegmap_220699;
    int64_t mainzisegmap_220699_total_runtime;
    int mainzisegmap_220699_runs;
    CUfunction mainzisegmap_221368;
    int64_t mainzisegmap_221368_total_runtime;
    int mainzisegmap_221368_runs;
    CUfunction mainzisegmap_221569;
    int64_t mainzisegmap_221569_total_runtime;
    int mainzisegmap_221569_runs;
    CUfunction mainzisegmap_222439;
    int64_t mainzisegmap_222439_total_runtime;
    int mainzisegmap_222439_runs;
    CUfunction mainzisegmap_222534;
    int64_t mainzisegmap_222534_total_runtime;
    int mainzisegmap_222534_runs;
    CUfunction mainzisegmap_222641;
    int64_t mainzisegmap_222641_total_runtime;
    int mainzisegmap_222641_runs;
    CUfunction mainzisegmap_223157;
    int64_t mainzisegmap_223157_total_runtime;
    int mainzisegmap_223157_runs;
    CUfunction mainzisegmap_223174;
    int64_t mainzisegmap_223174_total_runtime;
    int mainzisegmap_223174_runs;
    CUfunction mainzisegmap_223202;
    int64_t mainzisegmap_223202_total_runtime;
    int mainzisegmap_223202_runs;
    CUfunction mainzisegmap_223326;
    int64_t mainzisegmap_223326_total_runtime;
    int mainzisegmap_223326_runs;
    CUfunction mainzisegmap_223513;
    int64_t mainzisegmap_223513_total_runtime;
    int mainzisegmap_223513_runs;
    CUfunction mainzisegmap_224163;
    int64_t mainzisegmap_224163_total_runtime;
    int mainzisegmap_224163_runs;
    CUfunction mainzisegmap_224180;
    int64_t mainzisegmap_224180_total_runtime;
    int mainzisegmap_224180_runs;
    CUfunction mainzisegmap_224210;
    int64_t mainzisegmap_224210_total_runtime;
    int mainzisegmap_224210_runs;
    CUfunction mainzisegmap_224374;
    int64_t mainzisegmap_224374_total_runtime;
    int mainzisegmap_224374_runs;
    CUfunction mainzisegmap_224619;
    int64_t mainzisegmap_224619_total_runtime;
    int mainzisegmap_224619_runs;
    CUfunction mainzisegmap_225417;
    int64_t mainzisegmap_225417_total_runtime;
    int mainzisegmap_225417_runs;
    CUfunction mainzisegmap_225434;
    int64_t mainzisegmap_225434_total_runtime;
    int mainzisegmap_225434_runs;
    CUfunction mainzisegmap_225464;
    int64_t mainzisegmap_225464_total_runtime;
    int mainzisegmap_225464_runs;
    CUfunction mainzisegmap_225672;
    int64_t mainzisegmap_225672_total_runtime;
    int mainzisegmap_225672_runs;
    CUfunction mainzisegmap_225963;
    int64_t mainzisegmap_225963_total_runtime;
    int mainzisegmap_225963_runs;
    CUfunction mainzisegmap_225980;
    int64_t mainzisegmap_225980_total_runtime;
    int mainzisegmap_225980_runs;
    CUfunction mainzisegmap_226275;
    int64_t mainzisegmap_226275_total_runtime;
    int mainzisegmap_226275_runs;
    CUfunction mainzisegmap_226292;
    int64_t mainzisegmap_226292_total_runtime;
    int mainzisegmap_226292_runs;
    CUfunction mainzisegmap_226679;
    int64_t mainzisegmap_226679_total_runtime;
    int mainzisegmap_226679_runs;
    CUfunction mainzisegmap_226696;
    int64_t mainzisegmap_226696_total_runtime;
    int mainzisegmap_226696_runs;
    CUfunction mainzisegmap_226984;
    int64_t mainzisegmap_226984_total_runtime;
    int mainzisegmap_226984_runs;
    CUfunction mainzisegmap_227201;
    int64_t mainzisegmap_227201_total_runtime;
    int mainzisegmap_227201_runs;
    CUfunction mainzisegmap_227222;
    int64_t mainzisegmap_227222_total_runtime;
    int mainzisegmap_227222_runs;
    CUfunction mainzisegmap_227351;
    int64_t mainzisegmap_227351_total_runtime;
    int mainzisegmap_227351_runs;
    CUfunction mainzisegmap_228076;
    int64_t mainzisegmap_228076_total_runtime;
    int mainzisegmap_228076_runs;
    CUfunction mainzisegmap_228131;
    int64_t mainzisegmap_228131_total_runtime;
    int mainzisegmap_228131_runs;
    CUfunction mainzisegmap_228193;
    int64_t mainzisegmap_228193_total_runtime;
    int mainzisegmap_228193_runs;
    CUfunction mainzisegmap_228279;
    int64_t mainzisegmap_228279_total_runtime;
    int mainzisegmap_228279_runs;
    CUfunction mainzisegmap_228302;
    int64_t mainzisegmap_228302_total_runtime;
    int mainzisegmap_228302_runs;
    CUfunction mainzisegmap_intragroup_206983;
    int64_t mainzisegmap_intragroup_206983_total_runtime;
    int mainzisegmap_intragroup_206983_runs;
    CUfunction mainzisegmap_intragroup_207338;
    int64_t mainzisegmap_intragroup_207338_total_runtime;
    int mainzisegmap_intragroup_207338_runs;
    CUfunction mainzisegmap_intragroup_207614;
    int64_t mainzisegmap_intragroup_207614_total_runtime;
    int mainzisegmap_intragroup_207614_runs;
    CUfunction mainzisegmap_intragroup_207867;
    int64_t mainzisegmap_intragroup_207867_total_runtime;
    int mainzisegmap_intragroup_207867_runs;
    CUfunction mainzisegmap_intragroup_208771;
    int64_t mainzisegmap_intragroup_208771_total_runtime;
    int mainzisegmap_intragroup_208771_runs;
    CUfunction mainzisegmap_intragroup_209172;
    int64_t mainzisegmap_intragroup_209172_total_runtime;
    int mainzisegmap_intragroup_209172_runs;
    CUfunction mainzisegmap_intragroup_209798;
    int64_t mainzisegmap_intragroup_209798_total_runtime;
    int mainzisegmap_intragroup_209798_runs;
    CUfunction mainzisegmap_intragroup_211858;
    int64_t mainzisegmap_intragroup_211858_total_runtime;
    int mainzisegmap_intragroup_211858_runs;
    CUfunction mainzisegmap_intragroup_213926;
    int64_t mainzisegmap_intragroup_213926_total_runtime;
    int mainzisegmap_intragroup_213926_runs;
    CUfunction mainzisegmap_intragroup_216501;
    int64_t mainzisegmap_intragroup_216501_total_runtime;
    int mainzisegmap_intragroup_216501_runs;
    CUfunction mainzisegmap_intragroup_217273;
    int64_t mainzisegmap_intragroup_217273_total_runtime;
    int mainzisegmap_intragroup_217273_runs;
    CUfunction mainzisegmap_intragroup_217594;
    int64_t mainzisegmap_intragroup_217594_total_runtime;
    int mainzisegmap_intragroup_217594_runs;
    CUfunction mainzisegmap_intragroup_218045;
    int64_t mainzisegmap_intragroup_218045_total_runtime;
    int mainzisegmap_intragroup_218045_runs;
    CUfunction mainzisegmap_intragroup_221759;
    int64_t mainzisegmap_intragroup_221759_total_runtime;
    int mainzisegmap_intragroup_221759_runs;
    CUfunction mainzisegmap_intragroup_221926;
    int64_t mainzisegmap_intragroup_221926_total_runtime;
    int mainzisegmap_intragroup_221926_runs;
    CUfunction mainzisegmap_intragroup_222183;
    int64_t mainzisegmap_intragroup_222183_total_runtime;
    int mainzisegmap_intragroup_222183_runs;
    CUfunction mainzisegmap_intragroup_226007;
    int64_t mainzisegmap_intragroup_226007_total_runtime;
    int mainzisegmap_intragroup_226007_runs;
    CUfunction mainzisegmap_intragroup_226320;
    int64_t mainzisegmap_intragroup_226320_total_runtime;
    int mainzisegmap_intragroup_226320_runs;
    CUfunction mainzisegmap_intragroup_226724;
    int64_t mainzisegmap_intragroup_226724_total_runtime;
    int mainzisegmap_intragroup_226724_runs;
    CUfunction mainzisegmap_intragroup_227074;
    int64_t mainzisegmap_intragroup_227074_total_runtime;
    int mainzisegmap_intragroup_227074_runs;
    CUfunction mainzisegmap_intragroup_227449;
    int64_t mainzisegmap_intragroup_227449_total_runtime;
    int mainzisegmap_intragroup_227449_runs;
    CUfunction mainzisegmap_intragroup_227905;
    int64_t mainzisegmap_intragroup_227905_total_runtime;
    int mainzisegmap_intragroup_227905_runs;
    CUfunction mainzisegred_large_212093;
    int64_t mainzisegred_large_212093_total_runtime;
    int mainzisegred_large_212093_runs;
    CUfunction mainzisegred_large_212167;
    int64_t mainzisegred_large_212167_total_runtime;
    int mainzisegred_large_212167_runs;
    CUfunction mainzisegred_large_214227;
    int64_t mainzisegred_large_214227_total_runtime;
    int mainzisegred_large_214227_runs;
    CUfunction mainzisegred_large_214321;
    int64_t mainzisegred_large_214321_total_runtime;
    int mainzisegred_large_214321_runs;
    CUfunction mainzisegred_large_216874;
    int64_t mainzisegred_large_216874_total_runtime;
    int mainzisegred_large_216874_runs;
    CUfunction mainzisegred_large_216997;
    int64_t mainzisegred_large_216997_total_runtime;
    int mainzisegred_large_216997_runs;
    CUfunction mainzisegred_large_218721;
    int64_t mainzisegred_large_218721_total_runtime;
    int mainzisegred_large_218721_runs;
    CUfunction mainzisegred_large_218852;
    int64_t mainzisegred_large_218852_total_runtime;
    int mainzisegred_large_218852_runs;
    CUfunction mainzisegred_large_218983;
    int64_t mainzisegred_large_218983_total_runtime;
    int mainzisegred_large_218983_runs;
    CUfunction mainzisegred_large_219605;
    int64_t mainzisegred_large_219605_total_runtime;
    int mainzisegred_large_219605_runs;
    CUfunction mainzisegred_large_219654;
    int64_t mainzisegred_large_219654_total_runtime;
    int mainzisegred_large_219654_runs;
    CUfunction mainzisegred_large_220434;
    int64_t mainzisegred_large_220434_total_runtime;
    int mainzisegred_large_220434_runs;
    CUfunction mainzisegred_large_220503;
    int64_t mainzisegred_large_220503_total_runtime;
    int mainzisegred_large_220503_runs;
    CUfunction mainzisegred_large_221513;
    int64_t mainzisegred_large_221513_total_runtime;
    int mainzisegred_large_221513_runs;
    CUfunction mainzisegred_large_221611;
    int64_t mainzisegred_large_221611_total_runtime;
    int mainzisegred_large_221611_runs;
    CUfunction mainzisegred_large_223287;
    int64_t mainzisegred_large_223287_total_runtime;
    int mainzisegred_large_223287_runs;
    CUfunction mainzisegred_large_223339;
    int64_t mainzisegred_large_223339_total_runtime;
    int mainzisegred_large_223339_runs;
    CUfunction mainzisegred_large_224325;
    int64_t mainzisegred_large_224325_total_runtime;
    int mainzisegred_large_224325_runs;
    CUfunction mainzisegred_large_224397;
    int64_t mainzisegred_large_224397_total_runtime;
    int mainzisegred_large_224397_runs;
    CUfunction mainzisegred_large_225613;
    int64_t mainzisegred_large_225613_total_runtime;
    int mainzisegred_large_225613_runs;
    CUfunction mainzisegred_large_225714;
    int64_t mainzisegred_large_225714_total_runtime;
    int mainzisegred_large_225714_runs;
    CUfunction mainzisegred_large_228180;
    int64_t mainzisegred_large_228180_total_runtime;
    int mainzisegred_large_228180_runs;
    CUfunction mainzisegred_small_212093;
    int64_t mainzisegred_small_212093_total_runtime;
    int mainzisegred_small_212093_runs;
    CUfunction mainzisegred_small_212167;
    int64_t mainzisegred_small_212167_total_runtime;
    int mainzisegred_small_212167_runs;
    CUfunction mainzisegred_small_214227;
    int64_t mainzisegred_small_214227_total_runtime;
    int mainzisegred_small_214227_runs;
    CUfunction mainzisegred_small_214321;
    int64_t mainzisegred_small_214321_total_runtime;
    int mainzisegred_small_214321_runs;
    CUfunction mainzisegred_small_216874;
    int64_t mainzisegred_small_216874_total_runtime;
    int mainzisegred_small_216874_runs;
    CUfunction mainzisegred_small_216997;
    int64_t mainzisegred_small_216997_total_runtime;
    int mainzisegred_small_216997_runs;
    CUfunction mainzisegred_small_218721;
    int64_t mainzisegred_small_218721_total_runtime;
    int mainzisegred_small_218721_runs;
    CUfunction mainzisegred_small_218852;
    int64_t mainzisegred_small_218852_total_runtime;
    int mainzisegred_small_218852_runs;
    CUfunction mainzisegred_small_218983;
    int64_t mainzisegred_small_218983_total_runtime;
    int mainzisegred_small_218983_runs;
    CUfunction mainzisegred_small_219605;
    int64_t mainzisegred_small_219605_total_runtime;
    int mainzisegred_small_219605_runs;
    CUfunction mainzisegred_small_219654;
    int64_t mainzisegred_small_219654_total_runtime;
    int mainzisegred_small_219654_runs;
    CUfunction mainzisegred_small_220434;
    int64_t mainzisegred_small_220434_total_runtime;
    int mainzisegred_small_220434_runs;
    CUfunction mainzisegred_small_220503;
    int64_t mainzisegred_small_220503_total_runtime;
    int mainzisegred_small_220503_runs;
    CUfunction mainzisegred_small_221513;
    int64_t mainzisegred_small_221513_total_runtime;
    int mainzisegred_small_221513_runs;
    CUfunction mainzisegred_small_221611;
    int64_t mainzisegred_small_221611_total_runtime;
    int mainzisegred_small_221611_runs;
    CUfunction mainzisegred_small_223287;
    int64_t mainzisegred_small_223287_total_runtime;
    int mainzisegred_small_223287_runs;
    CUfunction mainzisegred_small_223339;
    int64_t mainzisegred_small_223339_total_runtime;
    int mainzisegred_small_223339_runs;
    CUfunction mainzisegred_small_224325;
    int64_t mainzisegred_small_224325_total_runtime;
    int mainzisegred_small_224325_runs;
    CUfunction mainzisegred_small_224397;
    int64_t mainzisegred_small_224397_total_runtime;
    int mainzisegred_small_224397_runs;
    CUfunction mainzisegred_small_225613;
    int64_t mainzisegred_small_225613_total_runtime;
    int mainzisegred_small_225613_runs;
    CUfunction mainzisegred_small_225714;
    int64_t mainzisegred_small_225714_total_runtime;
    int mainzisegred_small_225714_runs;
    CUfunction mainzisegred_small_228180;
    int64_t mainzisegred_small_228180_total_runtime;
    int mainzisegred_small_228180_runs;
    CUfunction mainzisegscan_206957;
    int64_t mainzisegscan_206957_total_runtime;
    int mainzisegscan_206957_runs;
    CUfunction mainzisegscan_207097;
    int64_t mainzisegscan_207097_total_runtime;
    int mainzisegscan_207097_runs;
    CUfunction mainzisegscan_207649;
    int64_t mainzisegscan_207649_total_runtime;
    int mainzisegscan_207649_runs;
    CUfunction mainzisegscan_218773;
    int64_t mainzisegscan_218773_total_runtime;
    int mainzisegscan_218773_runs;
    CUfunction mainzisegscan_218904;
    int64_t mainzisegscan_218904_total_runtime;
    int mainzisegscan_218904_runs;
    CUfunction mainzisegscan_219035;
    int64_t mainzisegscan_219035_total_runtime;
    int mainzisegscan_219035_runs;
    CUfunction mainzisegscan_228005;
    int64_t mainzisegscan_228005_total_runtime;
    int mainzisegscan_228005_runs;
    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;
    CUdeviceptr global_failure;
    CUdeviceptr global_failure_args;
    struct cuda_context cuda;
    struct tuning_params tuning_params;
    int32_t failure_is_an_option;
    int total_runs;
    long total_runtime;
};
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;
    ctx->debugging = ctx->detail_memory = cfg->cu_cfg.debugging;
    ctx->profiling = cfg->profiling;
    ctx->profiling_paused = 0;
    ctx->logging = cfg->cu_cfg.logging;
    ctx->error = NULL;
    ctx->log = stderr;
    ctx->cuda.profiling_records_capacity = 200;
    ctx->cuda.profiling_records_used = 0;
    ctx->cuda.profiling_records = malloc(ctx->cuda.profiling_records_capacity *
        sizeof(struct profiling_record));
    ctx->cuda.cfg = cfg->cu_cfg;
    create_lock(&ctx->lock);
    ctx->failure_is_an_option = 0;
    ctx->total_runs = 0;
    ctx->total_runtime = 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->error = cuda_setup(&ctx->cuda, cuda_program, cfg->nvrtc_opts);
    if (ctx->error != NULL)
        return NULL;
    
    int32_t no_error = -1;
    
    CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->global_failure, sizeof(no_error)));
    CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->global_failure, &no_error,
                                    sizeof(no_error)));
    // The +1 is to avoid zero-byte allocations.
    CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->global_failure_args, sizeof(int64_t) *
                                  (4 + 1)));
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_f64zireplicate_233079,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_f64zireplicate_233079"));
    ctx->builtinzhreplicate_f64zireplicate_233079_total_runtime = 0;
    ctx->builtinzhreplicate_f64zireplicate_233079_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_i64zireplicate_232620,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_i64zireplicate_232620"));
    ctx->builtinzhreplicate_i64zireplicate_232620_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_232620_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->builtinzhreplicate_i8zireplicate_232377,
                                           ctx->cuda.module,
                                           "builtinzhreplicate_i8zireplicate_232377"));
    ctx->builtinzhreplicate_i8zireplicate_232377_total_runtime = 0;
    ctx->builtinzhreplicate_i8zireplicate_232377_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f64,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f64"));
    ctx->gpu_map_transpose_f64_total_runtime = 0;
    ctx->gpu_map_transpose_f64_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f64_low_height,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f64_low_height"));
    ctx->gpu_map_transpose_f64_low_height_total_runtime = 0;
    ctx->gpu_map_transpose_f64_low_height_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f64_low_width,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f64_low_width"));
    ctx->gpu_map_transpose_f64_low_width_total_runtime = 0;
    ctx->gpu_map_transpose_f64_low_width_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_f64_small,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_f64_small"));
    ctx->gpu_map_transpose_f64_small_total_runtime = 0;
    ctx->gpu_map_transpose_f64_small_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_i64,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_i64"));
    ctx->gpu_map_transpose_i64_total_runtime = 0;
    ctx->gpu_map_transpose_i64_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_i64_low_height,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_i64_low_height"));
    ctx->gpu_map_transpose_i64_low_height_total_runtime = 0;
    ctx->gpu_map_transpose_i64_low_height_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_i64_low_width,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_i64_low_width"));
    ctx->gpu_map_transpose_i64_low_width_total_runtime = 0;
    ctx->gpu_map_transpose_i64_low_width_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->gpu_map_transpose_i64_small,
                                           ctx->cuda.module,
                                           "gpu_map_transpose_i64_small"));
    ctx->gpu_map_transpose_i64_small_total_runtime = 0;
    ctx->gpu_map_transpose_i64_small_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_232638,
                                           ctx->cuda.module,
                                           "mainzicopy_232638"));
    ctx->mainzicopy_232638_total_runtime = 0;
    ctx->mainzicopy_232638_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_232839,
                                           ctx->cuda.module,
                                           "mainzicopy_232839"));
    ctx->mainzicopy_232839_total_runtime = 0;
    ctx->mainzicopy_232839_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_234876,
                                           ctx->cuda.module,
                                           "mainzicopy_234876"));
    ctx->mainzicopy_234876_total_runtime = 0;
    ctx->mainzicopy_234876_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235075,
                                           ctx->cuda.module,
                                           "mainzicopy_235075"));
    ctx->mainzicopy_235075_total_runtime = 0;
    ctx->mainzicopy_235075_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235325,
                                           ctx->cuda.module,
                                           "mainzicopy_235325"));
    ctx->mainzicopy_235325_total_runtime = 0;
    ctx->mainzicopy_235325_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235703,
                                           ctx->cuda.module,
                                           "mainzicopy_235703"));
    ctx->mainzicopy_235703_total_runtime = 0;
    ctx->mainzicopy_235703_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_235925,
                                           ctx->cuda.module,
                                           "mainzicopy_235925"));
    ctx->mainzicopy_235925_total_runtime = 0;
    ctx->mainzicopy_235925_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzicopy_236198,
                                           ctx->cuda.module,
                                           "mainzicopy_236198"));
    ctx->mainzicopy_236198_total_runtime = 0;
    ctx->mainzicopy_236198_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_206959,
                                           ctx->cuda.module,
                                           "mainzisegmap_206959"));
    ctx->mainzisegmap_206959_total_runtime = 0;
    ctx->mainzisegmap_206959_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_207135,
                                           ctx->cuda.module,
                                           "mainzisegmap_207135"));
    ctx->mainzisegmap_207135_total_runtime = 0;
    ctx->mainzisegmap_207135_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_207260,
                                           ctx->cuda.module,
                                           "mainzisegmap_207260"));
    ctx->mainzisegmap_207260_total_runtime = 0;
    ctx->mainzisegmap_207260_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_207695,
                                           ctx->cuda.module,
                                           "mainzisegmap_207695"));
    ctx->mainzisegmap_207695_total_runtime = 0;
    ctx->mainzisegmap_207695_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_208908,
                                           ctx->cuda.module,
                                           "mainzisegmap_208908"));
    ctx->mainzisegmap_208908_total_runtime = 0;
    ctx->mainzisegmap_208908_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_208922,
                                           ctx->cuda.module,
                                           "mainzisegmap_208922"));
    ctx->mainzisegmap_208922_total_runtime = 0;
    ctx->mainzisegmap_208922_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_208946,
                                           ctx->cuda.module,
                                           "mainzisegmap_208946"));
    ctx->mainzisegmap_208946_total_runtime = 0;
    ctx->mainzisegmap_208946_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_209556,
                                           ctx->cuda.module,
                                           "mainzisegmap_209556"));
    ctx->mainzisegmap_209556_total_runtime = 0;
    ctx->mainzisegmap_209556_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_209568,
                                           ctx->cuda.module,
                                           "mainzisegmap_209568"));
    ctx->mainzisegmap_209568_total_runtime = 0;
    ctx->mainzisegmap_209568_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_209589,
                                           ctx->cuda.module,
                                           "mainzisegmap_209589"));
    ctx->mainzisegmap_209589_total_runtime = 0;
    ctx->mainzisegmap_209589_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210182,
                                           ctx->cuda.module,
                                           "mainzisegmap_210182"));
    ctx->mainzisegmap_210182_total_runtime = 0;
    ctx->mainzisegmap_210182_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210194,
                                           ctx->cuda.module,
                                           "mainzisegmap_210194"));
    ctx->mainzisegmap_210194_total_runtime = 0;
    ctx->mainzisegmap_210194_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210215,
                                           ctx->cuda.module,
                                           "mainzisegmap_210215"));
    ctx->mainzisegmap_210215_total_runtime = 0;
    ctx->mainzisegmap_210215_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210357,
                                           ctx->cuda.module,
                                           "mainzisegmap_210357"));
    ctx->mainzisegmap_210357_total_runtime = 0;
    ctx->mainzisegmap_210357_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210502,
                                           ctx->cuda.module,
                                           "mainzisegmap_210502"));
    ctx->mainzisegmap_210502_total_runtime = 0;
    ctx->mainzisegmap_210502_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_210632,
                                           ctx->cuda.module,
                                           "mainzisegmap_210632"));
    ctx->mainzisegmap_210632_total_runtime = 0;
    ctx->mainzisegmap_210632_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_211772,
                                           ctx->cuda.module,
                                           "mainzisegmap_211772"));
    ctx->mainzisegmap_211772_total_runtime = 0;
    ctx->mainzisegmap_211772_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_211980,
                                           ctx->cuda.module,
                                           "mainzisegmap_211980"));
    ctx->mainzisegmap_211980_total_runtime = 0;
    ctx->mainzisegmap_211980_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_212069,
                                           ctx->cuda.module,
                                           "mainzisegmap_212069"));
    ctx->mainzisegmap_212069_total_runtime = 0;
    ctx->mainzisegmap_212069_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_212141,
                                           ctx->cuda.module,
                                           "mainzisegmap_212141"));
    ctx->mainzisegmap_212141_total_runtime = 0;
    ctx->mainzisegmap_212141_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_212355,
                                           ctx->cuda.module,
                                           "mainzisegmap_212355"));
    ctx->mainzisegmap_212355_total_runtime = 0;
    ctx->mainzisegmap_212355_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_213809,
                                           ctx->cuda.module,
                                           "mainzisegmap_213809"));
    ctx->mainzisegmap_213809_total_runtime = 0;
    ctx->mainzisegmap_213809_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214084,
                                           ctx->cuda.module,
                                           "mainzisegmap_214084"));
    ctx->mainzisegmap_214084_total_runtime = 0;
    ctx->mainzisegmap_214084_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214201,
                                           ctx->cuda.module,
                                           "mainzisegmap_214201"));
    ctx->mainzisegmap_214201_total_runtime = 0;
    ctx->mainzisegmap_214201_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214285,
                                           ctx->cuda.module,
                                           "mainzisegmap_214285"));
    ctx->mainzisegmap_214285_total_runtime = 0;
    ctx->mainzisegmap_214285_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_214560,
                                           ctx->cuda.module,
                                           "mainzisegmap_214560"));
    ctx->mainzisegmap_214560_total_runtime = 0;
    ctx->mainzisegmap_214560_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216352,
                                           ctx->cuda.module,
                                           "mainzisegmap_216352"));
    ctx->mainzisegmap_216352_total_runtime = 0;
    ctx->mainzisegmap_216352_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216697,
                                           ctx->cuda.module,
                                           "mainzisegmap_216697"));
    ctx->mainzisegmap_216697_total_runtime = 0;
    ctx->mainzisegmap_216697_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216846,
                                           ctx->cuda.module,
                                           "mainzisegmap_216846"));
    ctx->mainzisegmap_216846_total_runtime = 0;
    ctx->mainzisegmap_216846_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_216942,
                                           ctx->cuda.module,
                                           "mainzisegmap_216942"));
    ctx->mainzisegmap_216942_total_runtime = 0;
    ctx->mainzisegmap_216942_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218503,
                                           ctx->cuda.module,
                                           "mainzisegmap_218503"));
    ctx->mainzisegmap_218503_total_runtime = 0;
    ctx->mainzisegmap_218503_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218652,
                                           ctx->cuda.module,
                                           "mainzisegmap_218652"));
    ctx->mainzisegmap_218652_total_runtime = 0;
    ctx->mainzisegmap_218652_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218688,
                                           ctx->cuda.module,
                                           "mainzisegmap_218688"));
    ctx->mainzisegmap_218688_total_runtime = 0;
    ctx->mainzisegmap_218688_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218819,
                                           ctx->cuda.module,
                                           "mainzisegmap_218819"));
    ctx->mainzisegmap_218819_total_runtime = 0;
    ctx->mainzisegmap_218819_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_218950,
                                           ctx->cuda.module,
                                           "mainzisegmap_218950"));
    ctx->mainzisegmap_218950_total_runtime = 0;
    ctx->mainzisegmap_218950_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219139,
                                           ctx->cuda.module,
                                           "mainzisegmap_219139"));
    ctx->mainzisegmap_219139_total_runtime = 0;
    ctx->mainzisegmap_219139_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219524,
                                           ctx->cuda.module,
                                           "mainzisegmap_219524"));
    ctx->mainzisegmap_219524_total_runtime = 0;
    ctx->mainzisegmap_219524_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219641,
                                           ctx->cuda.module,
                                           "mainzisegmap_219641"));
    ctx->mainzisegmap_219641_total_runtime = 0;
    ctx->mainzisegmap_219641_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_219802,
                                           ctx->cuda.module,
                                           "mainzisegmap_219802"));
    ctx->mainzisegmap_219802_total_runtime = 0;
    ctx->mainzisegmap_219802_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_220323,
                                           ctx->cuda.module,
                                           "mainzisegmap_220323"));
    ctx->mainzisegmap_220323_total_runtime = 0;
    ctx->mainzisegmap_220323_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_220480,
                                           ctx->cuda.module,
                                           "mainzisegmap_220480"));
    ctx->mainzisegmap_220480_total_runtime = 0;
    ctx->mainzisegmap_220480_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_220699,
                                           ctx->cuda.module,
                                           "mainzisegmap_220699"));
    ctx->mainzisegmap_220699_total_runtime = 0;
    ctx->mainzisegmap_220699_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_221368,
                                           ctx->cuda.module,
                                           "mainzisegmap_221368"));
    ctx->mainzisegmap_221368_total_runtime = 0;
    ctx->mainzisegmap_221368_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_221569,
                                           ctx->cuda.module,
                                           "mainzisegmap_221569"));
    ctx->mainzisegmap_221569_total_runtime = 0;
    ctx->mainzisegmap_221569_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_222439,
                                           ctx->cuda.module,
                                           "mainzisegmap_222439"));
    ctx->mainzisegmap_222439_total_runtime = 0;
    ctx->mainzisegmap_222439_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_222534,
                                           ctx->cuda.module,
                                           "mainzisegmap_222534"));
    ctx->mainzisegmap_222534_total_runtime = 0;
    ctx->mainzisegmap_222534_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_222641,
                                           ctx->cuda.module,
                                           "mainzisegmap_222641"));
    ctx->mainzisegmap_222641_total_runtime = 0;
    ctx->mainzisegmap_222641_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223157,
                                           ctx->cuda.module,
                                           "mainzisegmap_223157"));
    ctx->mainzisegmap_223157_total_runtime = 0;
    ctx->mainzisegmap_223157_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223174,
                                           ctx->cuda.module,
                                           "mainzisegmap_223174"));
    ctx->mainzisegmap_223174_total_runtime = 0;
    ctx->mainzisegmap_223174_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223202,
                                           ctx->cuda.module,
                                           "mainzisegmap_223202"));
    ctx->mainzisegmap_223202_total_runtime = 0;
    ctx->mainzisegmap_223202_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223326,
                                           ctx->cuda.module,
                                           "mainzisegmap_223326"));
    ctx->mainzisegmap_223326_total_runtime = 0;
    ctx->mainzisegmap_223326_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_223513,
                                           ctx->cuda.module,
                                           "mainzisegmap_223513"));
    ctx->mainzisegmap_223513_total_runtime = 0;
    ctx->mainzisegmap_223513_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224163,
                                           ctx->cuda.module,
                                           "mainzisegmap_224163"));
    ctx->mainzisegmap_224163_total_runtime = 0;
    ctx->mainzisegmap_224163_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224180,
                                           ctx->cuda.module,
                                           "mainzisegmap_224180"));
    ctx->mainzisegmap_224180_total_runtime = 0;
    ctx->mainzisegmap_224180_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224210,
                                           ctx->cuda.module,
                                           "mainzisegmap_224210"));
    ctx->mainzisegmap_224210_total_runtime = 0;
    ctx->mainzisegmap_224210_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224374,
                                           ctx->cuda.module,
                                           "mainzisegmap_224374"));
    ctx->mainzisegmap_224374_total_runtime = 0;
    ctx->mainzisegmap_224374_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_224619,
                                           ctx->cuda.module,
                                           "mainzisegmap_224619"));
    ctx->mainzisegmap_224619_total_runtime = 0;
    ctx->mainzisegmap_224619_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225417,
                                           ctx->cuda.module,
                                           "mainzisegmap_225417"));
    ctx->mainzisegmap_225417_total_runtime = 0;
    ctx->mainzisegmap_225417_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225434,
                                           ctx->cuda.module,
                                           "mainzisegmap_225434"));
    ctx->mainzisegmap_225434_total_runtime = 0;
    ctx->mainzisegmap_225434_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225464,
                                           ctx->cuda.module,
                                           "mainzisegmap_225464"));
    ctx->mainzisegmap_225464_total_runtime = 0;
    ctx->mainzisegmap_225464_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225672,
                                           ctx->cuda.module,
                                           "mainzisegmap_225672"));
    ctx->mainzisegmap_225672_total_runtime = 0;
    ctx->mainzisegmap_225672_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225963,
                                           ctx->cuda.module,
                                           "mainzisegmap_225963"));
    ctx->mainzisegmap_225963_total_runtime = 0;
    ctx->mainzisegmap_225963_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_225980,
                                           ctx->cuda.module,
                                           "mainzisegmap_225980"));
    ctx->mainzisegmap_225980_total_runtime = 0;
    ctx->mainzisegmap_225980_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226275,
                                           ctx->cuda.module,
                                           "mainzisegmap_226275"));
    ctx->mainzisegmap_226275_total_runtime = 0;
    ctx->mainzisegmap_226275_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226292,
                                           ctx->cuda.module,
                                           "mainzisegmap_226292"));
    ctx->mainzisegmap_226292_total_runtime = 0;
    ctx->mainzisegmap_226292_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226679,
                                           ctx->cuda.module,
                                           "mainzisegmap_226679"));
    ctx->mainzisegmap_226679_total_runtime = 0;
    ctx->mainzisegmap_226679_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226696,
                                           ctx->cuda.module,
                                           "mainzisegmap_226696"));
    ctx->mainzisegmap_226696_total_runtime = 0;
    ctx->mainzisegmap_226696_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_226984,
                                           ctx->cuda.module,
                                           "mainzisegmap_226984"));
    ctx->mainzisegmap_226984_total_runtime = 0;
    ctx->mainzisegmap_226984_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227201,
                                           ctx->cuda.module,
                                           "mainzisegmap_227201"));
    ctx->mainzisegmap_227201_total_runtime = 0;
    ctx->mainzisegmap_227201_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227222,
                                           ctx->cuda.module,
                                           "mainzisegmap_227222"));
    ctx->mainzisegmap_227222_total_runtime = 0;
    ctx->mainzisegmap_227222_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_227351,
                                           ctx->cuda.module,
                                           "mainzisegmap_227351"));
    ctx->mainzisegmap_227351_total_runtime = 0;
    ctx->mainzisegmap_227351_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228076,
                                           ctx->cuda.module,
                                           "mainzisegmap_228076"));
    ctx->mainzisegmap_228076_total_runtime = 0;
    ctx->mainzisegmap_228076_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228131,
                                           ctx->cuda.module,
                                           "mainzisegmap_228131"));
    ctx->mainzisegmap_228131_total_runtime = 0;
    ctx->mainzisegmap_228131_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228193,
                                           ctx->cuda.module,
                                           "mainzisegmap_228193"));
    ctx->mainzisegmap_228193_total_runtime = 0;
    ctx->mainzisegmap_228193_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228279,
                                           ctx->cuda.module,
                                           "mainzisegmap_228279"));
    ctx->mainzisegmap_228279_total_runtime = 0;
    ctx->mainzisegmap_228279_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_228302,
                                           ctx->cuda.module,
                                           "mainzisegmap_228302"));
    ctx->mainzisegmap_228302_total_runtime = 0;
    ctx->mainzisegmap_228302_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_206983,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_206983"));
    ctx->mainzisegmap_intragroup_206983_total_runtime = 0;
    ctx->mainzisegmap_intragroup_206983_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_207338,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_207338"));
    ctx->mainzisegmap_intragroup_207338_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207338_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_207614,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_207614"));
    ctx->mainzisegmap_intragroup_207614_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207614_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_207867,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_207867"));
    ctx->mainzisegmap_intragroup_207867_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207867_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_208771,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_208771"));
    ctx->mainzisegmap_intragroup_208771_total_runtime = 0;
    ctx->mainzisegmap_intragroup_208771_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_209172,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_209172"));
    ctx->mainzisegmap_intragroup_209172_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209172_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_209798,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_209798"));
    ctx->mainzisegmap_intragroup_209798_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209798_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_211858,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_211858"));
    ctx->mainzisegmap_intragroup_211858_total_runtime = 0;
    ctx->mainzisegmap_intragroup_211858_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_213926,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_213926"));
    ctx->mainzisegmap_intragroup_213926_total_runtime = 0;
    ctx->mainzisegmap_intragroup_213926_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_216501,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_216501"));
    ctx->mainzisegmap_intragroup_216501_total_runtime = 0;
    ctx->mainzisegmap_intragroup_216501_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_217273,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_217273"));
    ctx->mainzisegmap_intragroup_217273_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217273_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_217594,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_217594"));
    ctx->mainzisegmap_intragroup_217594_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217594_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_218045,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_218045"));
    ctx->mainzisegmap_intragroup_218045_total_runtime = 0;
    ctx->mainzisegmap_intragroup_218045_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_221759,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_221759"));
    ctx->mainzisegmap_intragroup_221759_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221759_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_221926,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_221926"));
    ctx->mainzisegmap_intragroup_221926_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221926_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_222183,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_222183"));
    ctx->mainzisegmap_intragroup_222183_total_runtime = 0;
    ctx->mainzisegmap_intragroup_222183_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_226007,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_226007"));
    ctx->mainzisegmap_intragroup_226007_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226007_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_226320,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_226320"));
    ctx->mainzisegmap_intragroup_226320_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226320_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_226724,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_226724"));
    ctx->mainzisegmap_intragroup_226724_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226724_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_227074,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_227074"));
    ctx->mainzisegmap_intragroup_227074_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227074_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_227449,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_227449"));
    ctx->mainzisegmap_intragroup_227449_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227449_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegmap_intragroup_227905,
                                           ctx->cuda.module,
                                           "mainzisegmap_intragroup_227905"));
    ctx->mainzisegmap_intragroup_227905_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227905_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_212093,
                                           ctx->cuda.module,
                                           "mainzisegred_large_212093"));
    ctx->mainzisegred_large_212093_total_runtime = 0;
    ctx->mainzisegred_large_212093_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_212167,
                                           ctx->cuda.module,
                                           "mainzisegred_large_212167"));
    ctx->mainzisegred_large_212167_total_runtime = 0;
    ctx->mainzisegred_large_212167_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_214227,
                                           ctx->cuda.module,
                                           "mainzisegred_large_214227"));
    ctx->mainzisegred_large_214227_total_runtime = 0;
    ctx->mainzisegred_large_214227_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_214321,
                                           ctx->cuda.module,
                                           "mainzisegred_large_214321"));
    ctx->mainzisegred_large_214321_total_runtime = 0;
    ctx->mainzisegred_large_214321_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_216874,
                                           ctx->cuda.module,
                                           "mainzisegred_large_216874"));
    ctx->mainzisegred_large_216874_total_runtime = 0;
    ctx->mainzisegred_large_216874_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_216997,
                                           ctx->cuda.module,
                                           "mainzisegred_large_216997"));
    ctx->mainzisegred_large_216997_total_runtime = 0;
    ctx->mainzisegred_large_216997_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_218721,
                                           ctx->cuda.module,
                                           "mainzisegred_large_218721"));
    ctx->mainzisegred_large_218721_total_runtime = 0;
    ctx->mainzisegred_large_218721_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_218852,
                                           ctx->cuda.module,
                                           "mainzisegred_large_218852"));
    ctx->mainzisegred_large_218852_total_runtime = 0;
    ctx->mainzisegred_large_218852_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_218983,
                                           ctx->cuda.module,
                                           "mainzisegred_large_218983"));
    ctx->mainzisegred_large_218983_total_runtime = 0;
    ctx->mainzisegred_large_218983_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_219605,
                                           ctx->cuda.module,
                                           "mainzisegred_large_219605"));
    ctx->mainzisegred_large_219605_total_runtime = 0;
    ctx->mainzisegred_large_219605_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_219654,
                                           ctx->cuda.module,
                                           "mainzisegred_large_219654"));
    ctx->mainzisegred_large_219654_total_runtime = 0;
    ctx->mainzisegred_large_219654_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_220434,
                                           ctx->cuda.module,
                                           "mainzisegred_large_220434"));
    ctx->mainzisegred_large_220434_total_runtime = 0;
    ctx->mainzisegred_large_220434_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_220503,
                                           ctx->cuda.module,
                                           "mainzisegred_large_220503"));
    ctx->mainzisegred_large_220503_total_runtime = 0;
    ctx->mainzisegred_large_220503_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_221513,
                                           ctx->cuda.module,
                                           "mainzisegred_large_221513"));
    ctx->mainzisegred_large_221513_total_runtime = 0;
    ctx->mainzisegred_large_221513_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_221611,
                                           ctx->cuda.module,
                                           "mainzisegred_large_221611"));
    ctx->mainzisegred_large_221611_total_runtime = 0;
    ctx->mainzisegred_large_221611_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_223287,
                                           ctx->cuda.module,
                                           "mainzisegred_large_223287"));
    ctx->mainzisegred_large_223287_total_runtime = 0;
    ctx->mainzisegred_large_223287_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_223339,
                                           ctx->cuda.module,
                                           "mainzisegred_large_223339"));
    ctx->mainzisegred_large_223339_total_runtime = 0;
    ctx->mainzisegred_large_223339_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_224325,
                                           ctx->cuda.module,
                                           "mainzisegred_large_224325"));
    ctx->mainzisegred_large_224325_total_runtime = 0;
    ctx->mainzisegred_large_224325_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_224397,
                                           ctx->cuda.module,
                                           "mainzisegred_large_224397"));
    ctx->mainzisegred_large_224397_total_runtime = 0;
    ctx->mainzisegred_large_224397_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_225613,
                                           ctx->cuda.module,
                                           "mainzisegred_large_225613"));
    ctx->mainzisegred_large_225613_total_runtime = 0;
    ctx->mainzisegred_large_225613_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_225714,
                                           ctx->cuda.module,
                                           "mainzisegred_large_225714"));
    ctx->mainzisegred_large_225714_total_runtime = 0;
    ctx->mainzisegred_large_225714_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_large_228180,
                                           ctx->cuda.module,
                                           "mainzisegred_large_228180"));
    ctx->mainzisegred_large_228180_total_runtime = 0;
    ctx->mainzisegred_large_228180_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_212093,
                                           ctx->cuda.module,
                                           "mainzisegred_small_212093"));
    ctx->mainzisegred_small_212093_total_runtime = 0;
    ctx->mainzisegred_small_212093_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_212167,
                                           ctx->cuda.module,
                                           "mainzisegred_small_212167"));
    ctx->mainzisegred_small_212167_total_runtime = 0;
    ctx->mainzisegred_small_212167_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_214227,
                                           ctx->cuda.module,
                                           "mainzisegred_small_214227"));
    ctx->mainzisegred_small_214227_total_runtime = 0;
    ctx->mainzisegred_small_214227_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_214321,
                                           ctx->cuda.module,
                                           "mainzisegred_small_214321"));
    ctx->mainzisegred_small_214321_total_runtime = 0;
    ctx->mainzisegred_small_214321_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_216874,
                                           ctx->cuda.module,
                                           "mainzisegred_small_216874"));
    ctx->mainzisegred_small_216874_total_runtime = 0;
    ctx->mainzisegred_small_216874_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_216997,
                                           ctx->cuda.module,
                                           "mainzisegred_small_216997"));
    ctx->mainzisegred_small_216997_total_runtime = 0;
    ctx->mainzisegred_small_216997_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_218721,
                                           ctx->cuda.module,
                                           "mainzisegred_small_218721"));
    ctx->mainzisegred_small_218721_total_runtime = 0;
    ctx->mainzisegred_small_218721_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_218852,
                                           ctx->cuda.module,
                                           "mainzisegred_small_218852"));
    ctx->mainzisegred_small_218852_total_runtime = 0;
    ctx->mainzisegred_small_218852_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_218983,
                                           ctx->cuda.module,
                                           "mainzisegred_small_218983"));
    ctx->mainzisegred_small_218983_total_runtime = 0;
    ctx->mainzisegred_small_218983_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_219605,
                                           ctx->cuda.module,
                                           "mainzisegred_small_219605"));
    ctx->mainzisegred_small_219605_total_runtime = 0;
    ctx->mainzisegred_small_219605_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_219654,
                                           ctx->cuda.module,
                                           "mainzisegred_small_219654"));
    ctx->mainzisegred_small_219654_total_runtime = 0;
    ctx->mainzisegred_small_219654_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_220434,
                                           ctx->cuda.module,
                                           "mainzisegred_small_220434"));
    ctx->mainzisegred_small_220434_total_runtime = 0;
    ctx->mainzisegred_small_220434_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_220503,
                                           ctx->cuda.module,
                                           "mainzisegred_small_220503"));
    ctx->mainzisegred_small_220503_total_runtime = 0;
    ctx->mainzisegred_small_220503_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_221513,
                                           ctx->cuda.module,
                                           "mainzisegred_small_221513"));
    ctx->mainzisegred_small_221513_total_runtime = 0;
    ctx->mainzisegred_small_221513_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_221611,
                                           ctx->cuda.module,
                                           "mainzisegred_small_221611"));
    ctx->mainzisegred_small_221611_total_runtime = 0;
    ctx->mainzisegred_small_221611_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_223287,
                                           ctx->cuda.module,
                                           "mainzisegred_small_223287"));
    ctx->mainzisegred_small_223287_total_runtime = 0;
    ctx->mainzisegred_small_223287_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_223339,
                                           ctx->cuda.module,
                                           "mainzisegred_small_223339"));
    ctx->mainzisegred_small_223339_total_runtime = 0;
    ctx->mainzisegred_small_223339_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_224325,
                                           ctx->cuda.module,
                                           "mainzisegred_small_224325"));
    ctx->mainzisegred_small_224325_total_runtime = 0;
    ctx->mainzisegred_small_224325_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_224397,
                                           ctx->cuda.module,
                                           "mainzisegred_small_224397"));
    ctx->mainzisegred_small_224397_total_runtime = 0;
    ctx->mainzisegred_small_224397_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_225613,
                                           ctx->cuda.module,
                                           "mainzisegred_small_225613"));
    ctx->mainzisegred_small_225613_total_runtime = 0;
    ctx->mainzisegred_small_225613_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_225714,
                                           ctx->cuda.module,
                                           "mainzisegred_small_225714"));
    ctx->mainzisegred_small_225714_total_runtime = 0;
    ctx->mainzisegred_small_225714_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegred_small_228180,
                                           ctx->cuda.module,
                                           "mainzisegred_small_228180"));
    ctx->mainzisegred_small_228180_total_runtime = 0;
    ctx->mainzisegred_small_228180_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_206957,
                                           ctx->cuda.module,
                                           "mainzisegscan_206957"));
    ctx->mainzisegscan_206957_total_runtime = 0;
    ctx->mainzisegscan_206957_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_207097,
                                           ctx->cuda.module,
                                           "mainzisegscan_207097"));
    ctx->mainzisegscan_207097_total_runtime = 0;
    ctx->mainzisegscan_207097_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_207649,
                                           ctx->cuda.module,
                                           "mainzisegscan_207649"));
    ctx->mainzisegscan_207649_total_runtime = 0;
    ctx->mainzisegscan_207649_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_218773,
                                           ctx->cuda.module,
                                           "mainzisegscan_218773"));
    ctx->mainzisegscan_218773_total_runtime = 0;
    ctx->mainzisegscan_218773_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_218904,
                                           ctx->cuda.module,
                                           "mainzisegscan_218904"));
    ctx->mainzisegscan_218904_total_runtime = 0;
    ctx->mainzisegscan_218904_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_219035,
                                           ctx->cuda.module,
                                           "mainzisegscan_219035"));
    ctx->mainzisegscan_219035_total_runtime = 0;
    ctx->mainzisegscan_219035_runs = 0;
    CUDA_SUCCEED_FATAL(cuModuleGetFunction(&ctx->mainzisegscan_228005,
                                           ctx->cuda.module,
                                           "mainzisegscan_228005"));
    ctx->mainzisegscan_228005_total_runtime = 0;
    ctx->mainzisegscan_228005_runs = 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->mainziid_counter_mem_232365.references = NULL;
        ctx->mainziid_counter_mem_232365.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_232365.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_232365.mem,
                                            mainziid_counter_mem_realtype_237256,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_232515.references = NULL;
        ctx->mainziid_counter_mem_232515.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_232515.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_232515.mem,
                                            mainziid_counter_mem_realtype_237290,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_232722.references = NULL;
        ctx->mainziid_counter_mem_232722.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_232722.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_232722.mem,
                                            mainziid_counter_mem_realtype_237338,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233296.references = NULL;
        ctx->mainzicounter_mem_233296.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233296.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233296.mem,
                                            mainzicounter_mem_realtype_237577,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233384.references = NULL;
        ctx->mainzicounter_mem_233384.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233384.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233384.mem,
                                            mainzicounter_mem_realtype_237614,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233645.references = NULL;
        ctx->mainzicounter_mem_233645.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233645.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233645.mem,
                                            mainzicounter_mem_realtype_237730,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_233753.references = NULL;
        ctx->mainzicounter_mem_233753.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_233753.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_233753.mem,
                                            mainzicounter_mem_realtype_237784,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234058.references = NULL;
        ctx->mainzicounter_mem_234058.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234058.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234058.mem,
                                            mainzicounter_mem_realtype_237924,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234178.references = NULL;
        ctx->mainzicounter_mem_234178.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234178.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234178.mem,
                                            mainzicounter_mem_realtype_237992,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234373.references = NULL;
        ctx->mainzicounter_mem_234373.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234373.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234373.mem,
                                            mainzicounter_mem_realtype_238116,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_234410.references = NULL;
        ctx->mainziid_counter_mem_234410.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_234410.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_234410.mem,
                                            mainziid_counter_mem_realtype_238128,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234554.references = NULL;
        ctx->mainzicounter_mem_234554.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234554.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234554.mem,
                                            mainzicounter_mem_realtype_238153,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_234591.references = NULL;
        ctx->mainziid_counter_mem_234591.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_234591.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_234591.mem,
                                            mainziid_counter_mem_realtype_238165,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234735.references = NULL;
        ctx->mainzicounter_mem_234735.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234735.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234735.mem,
                                            mainzicounter_mem_realtype_238190,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_234772.references = NULL;
        ctx->mainziid_counter_mem_234772.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_234772.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_234772.mem,
                                            mainziid_counter_mem_realtype_238202,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_234952.references = NULL;
        ctx->mainzicounter_mem_234952.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_234952.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_234952.mem,
                                            mainzicounter_mem_realtype_238246,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235034.references = NULL;
        ctx->mainzicounter_mem_235034.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235034.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235034.mem,
                                            mainzicounter_mem_realtype_238276,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235176.references = NULL;
        ctx->mainzicounter_mem_235176.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235176.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235176.mem,
                                            mainzicounter_mem_realtype_238332,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235278.references = NULL;
        ctx->mainzicounter_mem_235278.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235278.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235278.mem,
                                            mainzicounter_mem_realtype_238379,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235446.references = NULL;
        ctx->mainzicounter_mem_235446.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235446.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235446.mem,
                                            mainzicounter_mem_realtype_238447,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235560.references = NULL;
        ctx->mainzicounter_mem_235560.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235560.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235560.mem,
                                            mainzicounter_mem_realtype_238508,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235802.references = NULL;
        ctx->mainzicounter_mem_235802.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235802.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235802.mem,
                                            mainzicounter_mem_realtype_238666,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_235884.references = NULL;
        ctx->mainzicounter_mem_235884.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_235884.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_235884.mem,
                                            mainzicounter_mem_realtype_238700,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236049.references = NULL;
        ctx->mainzicounter_mem_236049.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236049.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236049.mem,
                                            mainzicounter_mem_realtype_238781,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236151.references = NULL;
        ctx->mainzicounter_mem_236151.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236151.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236151.mem,
                                            mainzicounter_mem_realtype_238832,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236342.references = NULL;
        ctx->mainzicounter_mem_236342.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236342.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236342.mem,
                                            mainzicounter_mem_realtype_238925,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_236456.references = NULL;
        ctx->mainzicounter_mem_236456.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_236456.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_236456.mem,
                                            mainzicounter_mem_realtype_238990,
                                            10240 * sizeof(int32_t)));
    }
    {
        ctx->mainziid_counter_mem_236799.references = NULL;
        ctx->mainziid_counter_mem_236799.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainziid_counter_mem_236799.mem,
                                      (1 > 0 ? 1 : 1) * sizeof(int32_t)));
        if (1 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainziid_counter_mem_236799.mem,
                                            mainziid_counter_mem_realtype_239212,
                                            1 * sizeof(int32_t)));
    }
    {
        ctx->mainzicounter_mem_237113.references = NULL;
        ctx->mainzicounter_mem_237113.size = 0;
        CUDA_SUCCEED_FATAL(cuMemAlloc(&ctx->mainzicounter_mem_237113.mem,
                                      (10240 > 0 ? 10240 : 1) *
                                      sizeof(int32_t)));
        if (10240 > 0)
            CUDA_SUCCEED_FATAL(cuMemcpyHtoD(ctx->mainzicounter_mem_237113.mem,
                                            mainzicounter_mem_realtype_239258,
                                            10240 * sizeof(int32_t)));
    }
    ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_233082 =
        &cfg->tuning_params[0];
    ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232623 =
        &cfg->tuning_params[1];
    ctx->tuning_params.builtinzhreplicate_i8zigroup_sizze_232380 =
        &cfg->tuning_params[2];
    ctx->tuning_params.mainzigroup_sizze_232641 = &cfg->tuning_params[3];
    ctx->tuning_params.mainzigroup_sizze_232842 = &cfg->tuning_params[4];
    ctx->tuning_params.mainzigroup_sizze_234879 = &cfg->tuning_params[5];
    ctx->tuning_params.mainzigroup_sizze_235078 = &cfg->tuning_params[6];
    ctx->tuning_params.mainzigroup_sizze_235328 = &cfg->tuning_params[7];
    ctx->tuning_params.mainzigroup_sizze_235706 = &cfg->tuning_params[8];
    ctx->tuning_params.mainzigroup_sizze_235928 = &cfg->tuning_params[9];
    ctx->tuning_params.mainzigroup_sizze_236201 = &cfg->tuning_params[10];
    ctx->tuning_params.mainzisegmap_group_sizze_206961 =
        &cfg->tuning_params[11];
    ctx->tuning_params.mainzisegmap_group_sizze_207015 =
        &cfg->tuning_params[12];
    ctx->tuning_params.mainzisegmap_group_sizze_207172 =
        &cfg->tuning_params[13];
    ctx->tuning_params.mainzisegmap_group_sizze_207440 =
        &cfg->tuning_params[14];
    ctx->tuning_params.mainzisegmap_group_sizze_208295 =
        &cfg->tuning_params[15];
    ctx->tuning_params.mainzisegmap_group_sizze_208534 =
        &cfg->tuning_params[16];
    ctx->tuning_params.mainzisegmap_group_sizze_208565 =
        &cfg->tuning_params[17];
    ctx->tuning_params.mainzisegmap_group_sizze_209297 =
        &cfg->tuning_params[18];
    ctx->tuning_params.mainzisegmap_group_sizze_209501 =
        &cfg->tuning_params[19];
    ctx->tuning_params.mainzisegmap_group_sizze_209527 =
        &cfg->tuning_params[20];
    ctx->tuning_params.mainzisegmap_group_sizze_209923 =
        &cfg->tuning_params[21];
    ctx->tuning_params.mainzisegmap_group_sizze_210127 =
        &cfg->tuning_params[22];
    ctx->tuning_params.mainzisegmap_group_sizze_210153 =
        &cfg->tuning_params[23];
    ctx->tuning_params.mainzisegmap_group_sizze_210326 =
        &cfg->tuning_params[24];
    ctx->tuning_params.mainzisegmap_group_sizze_210389 =
        &cfg->tuning_params[25];
    ctx->tuning_params.mainzisegmap_group_sizze_210531 =
        &cfg->tuning_params[26];
    ctx->tuning_params.mainzisegmap_group_sizze_210726 =
        &cfg->tuning_params[27];
    ctx->tuning_params.mainzisegmap_group_sizze_211061 =
        &cfg->tuning_params[28];
    ctx->tuning_params.mainzisegmap_group_sizze_211236 =
        &cfg->tuning_params[29];
    ctx->tuning_params.mainzisegmap_group_sizze_211322 =
        &cfg->tuning_params[30];
    ctx->tuning_params.mainzisegmap_group_sizze_212223 =
        &cfg->tuning_params[31];
    ctx->tuning_params.mainzisegmap_group_sizze_212479 =
        &cfg->tuning_params[32];
    ctx->tuning_params.mainzisegmap_group_sizze_212912 =
        &cfg->tuning_params[33];
    ctx->tuning_params.mainzisegmap_group_sizze_213144 =
        &cfg->tuning_params[34];
    ctx->tuning_params.mainzisegmap_group_sizze_213247 =
        &cfg->tuning_params[35];
    ctx->tuning_params.mainzisegmap_group_sizze_214396 =
        &cfg->tuning_params[36];
    ctx->tuning_params.mainzisegmap_group_sizze_214716 =
        &cfg->tuning_params[37];
    ctx->tuning_params.mainzisegmap_group_sizze_215257 =
        &cfg->tuning_params[38];
    ctx->tuning_params.mainzisegmap_group_sizze_215544 =
        &cfg->tuning_params[39];
    ctx->tuning_params.mainzisegmap_group_sizze_215674 =
        &cfg->tuning_params[40];
    ctx->tuning_params.mainzisegmap_group_sizze_218205 =
        &cfg->tuning_params[41];
    ctx->tuning_params.mainzisegmap_group_sizze_218601 =
        &cfg->tuning_params[42];
    ctx->tuning_params.mainzisegmap_group_sizze_218672 =
        &cfg->tuning_params[43];
    ctx->tuning_params.mainzisegmap_group_sizze_218803 =
        &cfg->tuning_params[44];
    ctx->tuning_params.mainzisegmap_group_sizze_218934 =
        &cfg->tuning_params[45];
    ctx->tuning_params.mainzisegmap_group_sizze_219065 =
        &cfg->tuning_params[46];
    ctx->tuning_params.mainzisegmap_group_sizze_219206 =
        &cfg->tuning_params[47];
    ctx->tuning_params.mainzisegmap_group_sizze_219337 =
        &cfg->tuning_params[48];
    ctx->tuning_params.mainzisegmap_group_sizze_219698 =
        &cfg->tuning_params[49];
    ctx->tuning_params.mainzisegmap_group_sizze_219898 =
        &cfg->tuning_params[50];
    ctx->tuning_params.mainzisegmap_group_sizze_220080 =
        &cfg->tuning_params[51];
    ctx->tuning_params.mainzisegmap_group_sizze_220563 =
        &cfg->tuning_params[52];
    ctx->tuning_params.mainzisegmap_group_sizze_220827 =
        &cfg->tuning_params[53];
    ctx->tuning_params.mainzisegmap_group_sizze_221058 =
        &cfg->tuning_params[54];
    ctx->tuning_params.mainzisegmap_group_sizze_222316 =
        &cfg->tuning_params[55];
    ctx->tuning_params.mainzisegmap_group_sizze_222503 =
        &cfg->tuning_params[56];
    ctx->tuning_params.mainzisegmap_group_sizze_222544 =
        &cfg->tuning_params[57];
    ctx->tuning_params.mainzisegmap_group_sizze_222733 =
        &cfg->tuning_params[58];
    ctx->tuning_params.mainzisegmap_group_sizze_222871 =
        &cfg->tuning_params[59];
    ctx->tuning_params.mainzisegmap_group_sizze_223070 =
        &cfg->tuning_params[60];
    ctx->tuning_params.mainzisegmap_group_sizze_223126 =
        &cfg->tuning_params[61];
    ctx->tuning_params.mainzisegmap_group_sizze_223386 =
        &cfg->tuning_params[62];
    ctx->tuning_params.mainzisegmap_group_sizze_223634 =
        &cfg->tuning_params[63];
    ctx->tuning_params.mainzisegmap_group_sizze_223823 =
        &cfg->tuning_params[64];
    ctx->tuning_params.mainzisegmap_group_sizze_224076 =
        &cfg->tuning_params[65];
    ctx->tuning_params.mainzisegmap_group_sizze_224132 =
        &cfg->tuning_params[66];
    ctx->tuning_params.mainzisegmap_group_sizze_224460 =
        &cfg->tuning_params[67];
    ctx->tuning_params.mainzisegmap_group_sizze_224772 =
        &cfg->tuning_params[68];
    ctx->tuning_params.mainzisegmap_group_sizze_225010 =
        &cfg->tuning_params[69];
    ctx->tuning_params.mainzisegmap_group_sizze_225330 =
        &cfg->tuning_params[70];
    ctx->tuning_params.mainzisegmap_group_sizze_225386 =
        &cfg->tuning_params[71];
    ctx->tuning_params.mainzisegmap_group_sizze_225876 =
        &cfg->tuning_params[72];
    ctx->tuning_params.mainzisegmap_group_sizze_225932 =
        &cfg->tuning_params[73];
    ctx->tuning_params.mainzisegmap_group_sizze_226188 =
        &cfg->tuning_params[74];
    ctx->tuning_params.mainzisegmap_group_sizze_226244 =
        &cfg->tuning_params[75];
    ctx->tuning_params.mainzisegmap_group_sizze_226592 =
        &cfg->tuning_params[76];
    ctx->tuning_params.mainzisegmap_group_sizze_226648 =
        &cfg->tuning_params[77];
    ctx->tuning_params.mainzisegmap_group_sizze_226861 =
        &cfg->tuning_params[78];
    ctx->tuning_params.mainzisegmap_group_sizze_227117 =
        &cfg->tuning_params[79];
    ctx->tuning_params.mainzisegmap_group_sizze_227160 =
        &cfg->tuning_params[80];
    ctx->tuning_params.mainzisegmap_group_sizze_227248 =
        &cfg->tuning_params[81];
    ctx->tuning_params.mainzisegmap_group_sizze_227667 =
        &cfg->tuning_params[82];
    ctx->tuning_params.mainzisegmap_group_sizze_228110 =
        &cfg->tuning_params[83];
    ctx->tuning_params.mainzisegmap_group_sizze_228145 =
        &cfg->tuning_params[84];
    ctx->tuning_params.mainzisegmap_group_sizze_228214 =
        &cfg->tuning_params[85];
    ctx->tuning_params.mainzisegmap_group_sizze_228304 =
        &cfg->tuning_params[86];
    ctx->tuning_params.mainzisegmap_num_groups_206963 = &cfg->tuning_params[87];
    ctx->tuning_params.mainzisegmap_num_groups_210533 = &cfg->tuning_params[88];
    ctx->tuning_params.mainzisegmap_num_groups_210728 = &cfg->tuning_params[89];
    ctx->tuning_params.mainzisegmap_num_groups_212225 = &cfg->tuning_params[90];
    ctx->tuning_params.mainzisegmap_num_groups_212481 = &cfg->tuning_params[91];
    ctx->tuning_params.mainzisegmap_num_groups_214398 = &cfg->tuning_params[92];
    ctx->tuning_params.mainzisegmap_num_groups_214718 = &cfg->tuning_params[93];
    ctx->tuning_params.mainzisegmap_num_groups_219067 = &cfg->tuning_params[94];
    ctx->tuning_params.mainzisegmap_num_groups_219700 = &cfg->tuning_params[95];
    ctx->tuning_params.mainzisegmap_num_groups_220565 = &cfg->tuning_params[96];
    ctx->tuning_params.mainzisegmap_num_groups_222546 = &cfg->tuning_params[97];
    ctx->tuning_params.mainzisegmap_num_groups_223388 = &cfg->tuning_params[98];
    ctx->tuning_params.mainzisegmap_num_groups_224462 = &cfg->tuning_params[99];
    ctx->tuning_params.mainzisegmap_num_groups_227250 =
        &cfg->tuning_params[100];
    ctx->tuning_params.mainzisegmap_num_groups_228306 =
        &cfg->tuning_params[101];
    ctx->tuning_params.mainzisegred_group_sizze_211164 =
        &cfg->tuning_params[102];
    ctx->tuning_params.mainzisegred_group_sizze_211266 =
        &cfg->tuning_params[103];
    ctx->tuning_params.mainzisegred_group_sizze_213050 =
        &cfg->tuning_params[104];
    ctx->tuning_params.mainzisegred_group_sizze_213183 =
        &cfg->tuning_params[105];
    ctx->tuning_params.mainzisegred_group_sizze_215433 =
        &cfg->tuning_params[106];
    ctx->tuning_params.mainzisegred_group_sizze_215602 =
        &cfg->tuning_params[107];
    ctx->tuning_params.mainzisegred_group_sizze_218698 =
        &cfg->tuning_params[108];
    ctx->tuning_params.mainzisegred_group_sizze_218829 =
        &cfg->tuning_params[109];
    ctx->tuning_params.mainzisegred_group_sizze_218960 =
        &cfg->tuning_params[110];
    ctx->tuning_params.mainzisegred_group_sizze_219283 =
        &cfg->tuning_params[111];
    ctx->tuning_params.mainzisegred_group_sizze_219350 =
        &cfg->tuning_params[112];
    ctx->tuning_params.mainzisegred_group_sizze_220008 =
        &cfg->tuning_params[113];
    ctx->tuning_params.mainzisegred_group_sizze_220102 =
        &cfg->tuning_params[114];
    ctx->tuning_params.mainzisegred_group_sizze_220973 =
        &cfg->tuning_params[115];
    ctx->tuning_params.mainzisegred_group_sizze_221099 =
        &cfg->tuning_params[116];
    ctx->tuning_params.mainzisegred_group_sizze_222814 =
        &cfg->tuning_params[117];
    ctx->tuning_params.mainzisegred_group_sizze_222884 =
        &cfg->tuning_params[118];
    ctx->tuning_params.mainzisegred_group_sizze_223748 =
        &cfg->tuning_params[119];
    ctx->tuning_params.mainzisegred_group_sizze_223845 =
        &cfg->tuning_params[120];
    ctx->tuning_params.mainzisegred_group_sizze_224922 =
        &cfg->tuning_params[121];
    ctx->tuning_params.mainzisegred_group_sizze_225051 =
        &cfg->tuning_params[122];
    ctx->tuning_params.mainzisegred_group_sizze_228157 =
        &cfg->tuning_params[123];
    ctx->tuning_params.mainzisegred_num_groups_211166 =
        &cfg->tuning_params[124];
    ctx->tuning_params.mainzisegred_num_groups_211268 =
        &cfg->tuning_params[125];
    ctx->tuning_params.mainzisegred_num_groups_213052 =
        &cfg->tuning_params[126];
    ctx->tuning_params.mainzisegred_num_groups_213185 =
        &cfg->tuning_params[127];
    ctx->tuning_params.mainzisegred_num_groups_215435 =
        &cfg->tuning_params[128];
    ctx->tuning_params.mainzisegred_num_groups_215604 =
        &cfg->tuning_params[129];
    ctx->tuning_params.mainzisegred_num_groups_218700 =
        &cfg->tuning_params[130];
    ctx->tuning_params.mainzisegred_num_groups_218831 =
        &cfg->tuning_params[131];
    ctx->tuning_params.mainzisegred_num_groups_218962 =
        &cfg->tuning_params[132];
    ctx->tuning_params.mainzisegred_num_groups_219285 =
        &cfg->tuning_params[133];
    ctx->tuning_params.mainzisegred_num_groups_219352 =
        &cfg->tuning_params[134];
    ctx->tuning_params.mainzisegred_num_groups_220010 =
        &cfg->tuning_params[135];
    ctx->tuning_params.mainzisegred_num_groups_220104 =
        &cfg->tuning_params[136];
    ctx->tuning_params.mainzisegred_num_groups_220975 =
        &cfg->tuning_params[137];
    ctx->tuning_params.mainzisegred_num_groups_221101 =
        &cfg->tuning_params[138];
    ctx->tuning_params.mainzisegred_num_groups_222816 =
        &cfg->tuning_params[139];
    ctx->tuning_params.mainzisegred_num_groups_222886 =
        &cfg->tuning_params[140];
    ctx->tuning_params.mainzisegred_num_groups_223750 =
        &cfg->tuning_params[141];
    ctx->tuning_params.mainzisegred_num_groups_223847 =
        &cfg->tuning_params[142];
    ctx->tuning_params.mainzisegred_num_groups_224924 =
        &cfg->tuning_params[143];
    ctx->tuning_params.mainzisegred_num_groups_225053 =
        &cfg->tuning_params[144];
    ctx->tuning_params.mainzisegred_num_groups_228159 =
        &cfg->tuning_params[145];
    ctx->tuning_params.mainzisegscan_group_sizze_206951 =
        &cfg->tuning_params[146];
    ctx->tuning_params.mainzisegscan_group_sizze_207071 =
        &cfg->tuning_params[147];
    ctx->tuning_params.mainzisegscan_group_sizze_207509 =
        &cfg->tuning_params[148];
    ctx->tuning_params.mainzisegscan_group_sizze_218731 =
        &cfg->tuning_params[149];
    ctx->tuning_params.mainzisegscan_group_sizze_218862 =
        &cfg->tuning_params[150];
    ctx->tuning_params.mainzisegscan_group_sizze_218993 =
        &cfg->tuning_params[151];
    ctx->tuning_params.mainzisegscan_group_sizze_227715 =
        &cfg->tuning_params[152];
    ctx->tuning_params.mainzisegscan_num_groups_206953 =
        &cfg->tuning_params[153];
    ctx->tuning_params.mainzisegscan_num_groups_207073 =
        &cfg->tuning_params[154];
    ctx->tuning_params.mainzisegscan_num_groups_207511 =
        &cfg->tuning_params[155];
    ctx->tuning_params.mainzisegscan_num_groups_218733 =
        &cfg->tuning_params[156];
    ctx->tuning_params.mainzisegscan_num_groups_218864 =
        &cfg->tuning_params[157];
    ctx->tuning_params.mainzisegscan_num_groups_218995 =
        &cfg->tuning_params[158];
    ctx->tuning_params.mainzisegscan_num_groups_227717 =
        &cfg->tuning_params[159];
    ctx->tuning_params.mainzisuff_intra_par_0 = &cfg->tuning_params[160];
    ctx->tuning_params.mainzisuff_intra_par_1 = &cfg->tuning_params[161];
    ctx->tuning_params.mainzisuff_intra_par_13 = &cfg->tuning_params[162];
    ctx->tuning_params.mainzisuff_intra_par_17 = &cfg->tuning_params[163];
    ctx->tuning_params.mainzisuff_intra_par_2 = &cfg->tuning_params[164];
    ctx->tuning_params.mainzisuff_intra_par_3 = &cfg->tuning_params[165];
    ctx->tuning_params.mainzisuff_intra_par_34 = &cfg->tuning_params[166];
    ctx->tuning_params.mainzisuff_intra_par_36 = &cfg->tuning_params[167];
    ctx->tuning_params.mainzisuff_intra_par_37 = &cfg->tuning_params[168];
    ctx->tuning_params.mainzisuff_intra_par_4 = &cfg->tuning_params[169];
    ctx->tuning_params.mainzisuff_intra_par_5 = &cfg->tuning_params[170];
    ctx->tuning_params.mainzisuff_intra_par_6 = &cfg->tuning_params[171];
    ctx->tuning_params.mainzisuff_intra_par_9 = &cfg->tuning_params[172];
    ctx->tuning_params.mainzisuff_outer_par_10 = &cfg->tuning_params[173];
    ctx->tuning_params.mainzisuff_outer_par_11 = &cfg->tuning_params[174];
    ctx->tuning_params.mainzisuff_outer_par_12 = &cfg->tuning_params[175];
    ctx->tuning_params.mainzisuff_outer_par_14 = &cfg->tuning_params[176];
    ctx->tuning_params.mainzisuff_outer_par_15 = &cfg->tuning_params[177];
    ctx->tuning_params.mainzisuff_outer_par_16 = &cfg->tuning_params[178];
    ctx->tuning_params.mainzisuff_outer_par_18 = &cfg->tuning_params[179];
    ctx->tuning_params.mainzisuff_outer_par_19 = &cfg->tuning_params[180];
    ctx->tuning_params.mainzisuff_outer_par_20 = &cfg->tuning_params[181];
    ctx->tuning_params.mainzisuff_outer_par_21 = &cfg->tuning_params[182];
    ctx->tuning_params.mainzisuff_outer_par_22 = &cfg->tuning_params[183];
    ctx->tuning_params.mainzisuff_outer_par_23 = &cfg->tuning_params[184];
    ctx->tuning_params.mainzisuff_outer_par_24 = &cfg->tuning_params[185];
    ctx->tuning_params.mainzisuff_outer_par_25 = &cfg->tuning_params[186];
    ctx->tuning_params.mainzisuff_outer_par_26 = &cfg->tuning_params[187];
    ctx->tuning_params.mainzisuff_outer_par_27 = &cfg->tuning_params[188];
    ctx->tuning_params.mainzisuff_outer_par_28 = &cfg->tuning_params[189];
    ctx->tuning_params.mainzisuff_outer_par_29 = &cfg->tuning_params[190];
    ctx->tuning_params.mainzisuff_outer_par_30 = &cfg->tuning_params[191];
    ctx->tuning_params.mainzisuff_outer_par_31 = &cfg->tuning_params[192];
    ctx->tuning_params.mainzisuff_outer_par_32 = &cfg->tuning_params[193];
    ctx->tuning_params.mainzisuff_outer_par_33 = &cfg->tuning_params[194];
    ctx->tuning_params.mainzisuff_outer_par_35 = &cfg->tuning_params[195];
    ctx->tuning_params.mainzisuff_outer_par_38 = &cfg->tuning_params[196];
    ctx->tuning_params.mainzisuff_outer_par_7 = &cfg->tuning_params[197];
    ctx->tuning_params.mainzisuff_outer_par_8 = &cfg->tuning_params[198];
    init_constants(ctx);
    // Clear the free list of any deallocations that occurred while initialising constants.
    CUDA_SUCCEED_FATAL(cuda_free_all(&ctx->cuda));
    futhark_context_sync(ctx);
    return ctx;
}
void futhark_context_free(struct futhark_context *ctx)
{
    free_constants(ctx);
    cuda_cleanup(&ctx->cuda);
    free_lock(&ctx->lock);
    ctx->cfg->in_use = 0;
    free(ctx);
}
int futhark_context_sync(struct futhark_context *ctx)
{
    CUDA_SUCCEED_OR_RETURN(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    CUDA_SUCCEED_OR_RETURN(cuCtxSynchronize());
    if (ctx->failure_is_an_option) {
        int32_t failure_idx;
        
        CUDA_SUCCEED_OR_RETURN(cuMemcpyDtoH(&failure_idx, ctx->global_failure,
                                            sizeof(int32_t)));
        ctx->failure_is_an_option = 0;
        if (failure_idx >= 0) {
            int32_t no_failure = -1;
            
            CUDA_SUCCEED_OR_RETURN(cuMemcpyHtoD(ctx->global_failure,
                                                &no_failure, sizeof(int32_t)));
            
            int64_t args[4 + 1];
            
            CUDA_SUCCEED_OR_RETURN(cuMemcpyDtoH(&args, ctx->global_failure_args,
                                                sizeof(args)));
            switch (failure_idx) {
                
              case 0:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:406:66-71\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:404:36-407:52\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:403:29-408:37\n   #9  stl.fut:402:22-409:28\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 1:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:124:33-40\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:119:20-125:36\n   #5  /prelude/soacs.fut:59:3-10\n   #6  /prelude/array.fut:195:3-17\n   #7  utils.fut:6:3-16\n   #8  stl.fut:117:12-126:20\n   #9  stl.fut:116:5-127:11\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 2:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 3:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 4:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 5:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 6:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 7:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 8:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 9:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 10:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 11:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 12:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 13:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 14:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:517:15-50\n   #6  stl.fut:142:20-80\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:141:12-143:40\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:140:5-144:36\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 15:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 16:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:518:16-54\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 17:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 18:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 19:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 20:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 21:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 22:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 23:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 24:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:150:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:148:5-151:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 25:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 26:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 27:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 28:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 29:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 30:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 31:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 32:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:450:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 33:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 34:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:461:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:443:3-470:10\n   #5  loess.fut:503:15-61\n   #6  stl.fut:157:13-60\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:155:5-158:26\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 35:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:485:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 36:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:480:3-488:25\n   #4  loess.fut:504:16-51\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 37:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:193:42-57\n   #1  stl.fut:188:28-194:44\n   #2  /prelude/soacs.fut:67:19-23\n   #3  /prelude/soacs.fut:67:3-37\n   #4  stl.fut:186:21-195:50\n   #5  /prelude/soacs.fut:75:22-28\n   #6  /prelude/soacs.fut:75:3-45\n   #7  stl.fut:184:13-196:57\n   #8  stl.fut:415:61-429:75\n   #9  stl.fut:455:3-469:34\n   #10 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 38:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  /prelude/array.fut:21:29-32\n   #1  loess.fut:559:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 39:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  /prelude/array.fut:26:29-34\n   #1  loess.fut:561:12-20\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 40:
                {
                    ctx->error =
                        msgprintf("division by zero\n-> #0  loess.fut:563:22-35\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:557:3-566:9\n   #5  stl.fut:220:31-96\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:219:23-221:48\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:218:15-222:44\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n");
                    break;
                }
                
              case 41:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:565:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 42:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:565:15-52\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:557:3-566:9\n   #6  stl.fut:220:31-96\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:219:23-221:48\n   #10 /prelude/soacs.fut:67:19-23\n   #11 /prelude/soacs.fut:67:3-37\n   #12 stl.fut:218:15-222:44\n   #13 stl.fut:415:61-429:75\n   #14 stl.fut:455:3-469:34\n   #15 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 43:
                {
                    ctx->error =
                        msgprintf("Index [%lld, %lld] out of bounds for array of shape [%lld][%lld].\n-> #0  stl.fut:226:39-67\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                                  args[0], args[1], args[2], args[3]);
                    break;
                }
                
              case 44:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 45:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  stl.fut:38:3-36\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 46:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 47:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-64\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 48:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:23-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 49:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:32:40-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:27:13-33:19\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:26:5-34:23\n   #8  /prelude/functional.fut:9:42-44\n   #9  stl.fut:38:3-84\n   #10 stl.fut:231:23-47\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 50:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 51:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:252:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:250:15-253:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 52:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 53:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 54:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 55:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 56:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 57:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 58:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 59:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 60:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 61:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 62:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 63:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 64:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 65:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 66:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 67:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 68:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:281:33-58\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 69:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:42:43-70\n   #3  stl.fut:282:33-64\n   #4  /prelude/soacs.fut:75:22-28\n   #5  /prelude/soacs.fut:75:3-45\n   #6  stl.fut:279:13-284:41\n   #7  stl.fut:415:61-429:75\n   #8  stl.fut:455:3-469:34\n   #9  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 70:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-33\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 71:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:537:27-37\n   #1  loess.fut:549:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:546:3-550:9\n   #6  stl.fut:304:23-75\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  stl.fut:303:15-305:43\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 72:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
                
              case 73:
                {
                    ctx->error =
                        msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:32:29-33\n   #1  utils.fut:32:3-49\n   #2  stl.fut:334:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:332:13-335:35\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n",
                                  args[0], args[1]);
                    break;
                }
            }
            return 1;
        }
    }
    CUDA_SUCCEED_OR_RETURN(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    return 0;
}
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;
            CUDA_SUCCEED_OR_RETURN(cuda_free(&ctx->cuda, 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");
    CUDA_SUCCEED_OR_RETURN(cuda_alloc(&ctx->cuda, (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) {
        CUDA_SUCCEED_FATAL(cuda_tally_profiling_records(&ctx->cuda));
        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_233079 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f64zireplicate_233079_runs,
                    (long) ctx->builtinzhreplicate_f64zireplicate_233079_total_runtime /
                    (ctx->builtinzhreplicate_f64zireplicate_233079_runs !=
                     0 ? ctx->builtinzhreplicate_f64zireplicate_233079_runs : 1),
                    (long) ctx->builtinzhreplicate_f64zireplicate_233079_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f64zireplicate_233079_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f64zireplicate_233079_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_232620 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_232620_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_232620_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_232620_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_232620_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_232620_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_232620_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_232620_runs;
        str_builder(&builder,
                    "builtin#replicate_i8.replicate_232377  ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i8zireplicate_232377_runs,
                    (long) ctx->builtinzhreplicate_i8zireplicate_232377_total_runtime /
                    (ctx->builtinzhreplicate_i8zireplicate_232377_runs !=
                     0 ? ctx->builtinzhreplicate_i8zireplicate_232377_runs : 1),
                    (long) ctx->builtinzhreplicate_i8zireplicate_232377_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i8zireplicate_232377_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i8zireplicate_232377_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_232638                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232638_runs,
                    (long) ctx->mainzicopy_232638_total_runtime /
                    (ctx->mainzicopy_232638_runs !=
                     0 ? ctx->mainzicopy_232638_runs : 1),
                    (long) ctx->mainzicopy_232638_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232638_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232638_runs;
        str_builder(&builder,
                    "main.copy_232839                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232839_runs,
                    (long) ctx->mainzicopy_232839_total_runtime /
                    (ctx->mainzicopy_232839_runs !=
                     0 ? ctx->mainzicopy_232839_runs : 1),
                    (long) ctx->mainzicopy_232839_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232839_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232839_runs;
        str_builder(&builder,
                    "main.copy_234876                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234876_runs,
                    (long) ctx->mainzicopy_234876_total_runtime /
                    (ctx->mainzicopy_234876_runs !=
                     0 ? ctx->mainzicopy_234876_runs : 1),
                    (long) ctx->mainzicopy_234876_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234876_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234876_runs;
        str_builder(&builder,
                    "main.copy_235075                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235075_runs,
                    (long) ctx->mainzicopy_235075_total_runtime /
                    (ctx->mainzicopy_235075_runs !=
                     0 ? ctx->mainzicopy_235075_runs : 1),
                    (long) ctx->mainzicopy_235075_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235075_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235075_runs;
        str_builder(&builder,
                    "main.copy_235325                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235325_runs,
                    (long) ctx->mainzicopy_235325_total_runtime /
                    (ctx->mainzicopy_235325_runs !=
                     0 ? ctx->mainzicopy_235325_runs : 1),
                    (long) ctx->mainzicopy_235325_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235325_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235325_runs;
        str_builder(&builder,
                    "main.copy_235703                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235703_runs,
                    (long) ctx->mainzicopy_235703_total_runtime /
                    (ctx->mainzicopy_235703_runs !=
                     0 ? ctx->mainzicopy_235703_runs : 1),
                    (long) ctx->mainzicopy_235703_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235703_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235703_runs;
        str_builder(&builder,
                    "main.copy_235925                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235925_runs,
                    (long) ctx->mainzicopy_235925_total_runtime /
                    (ctx->mainzicopy_235925_runs !=
                     0 ? ctx->mainzicopy_235925_runs : 1),
                    (long) ctx->mainzicopy_235925_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235925_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235925_runs;
        str_builder(&builder,
                    "main.copy_236198                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_236198_runs,
                    (long) ctx->mainzicopy_236198_total_runtime /
                    (ctx->mainzicopy_236198_runs !=
                     0 ? ctx->mainzicopy_236198_runs : 1),
                    (long) ctx->mainzicopy_236198_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_236198_total_runtime;
        ctx->total_runs += ctx->mainzicopy_236198_runs;
        str_builder(&builder,
                    "main.segmap_206959                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_206959_runs,
                    (long) ctx->mainzisegmap_206959_total_runtime /
                    (ctx->mainzisegmap_206959_runs !=
                     0 ? ctx->mainzisegmap_206959_runs : 1),
                    (long) ctx->mainzisegmap_206959_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_206959_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_206959_runs;
        str_builder(&builder,
                    "main.segmap_207135                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207135_runs,
                    (long) ctx->mainzisegmap_207135_total_runtime /
                    (ctx->mainzisegmap_207135_runs !=
                     0 ? ctx->mainzisegmap_207135_runs : 1),
                    (long) ctx->mainzisegmap_207135_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207135_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207135_runs;
        str_builder(&builder,
                    "main.segmap_207260                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207260_runs,
                    (long) ctx->mainzisegmap_207260_total_runtime /
                    (ctx->mainzisegmap_207260_runs !=
                     0 ? ctx->mainzisegmap_207260_runs : 1),
                    (long) ctx->mainzisegmap_207260_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207260_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207260_runs;
        str_builder(&builder,
                    "main.segmap_207695                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207695_runs,
                    (long) ctx->mainzisegmap_207695_total_runtime /
                    (ctx->mainzisegmap_207695_runs !=
                     0 ? ctx->mainzisegmap_207695_runs : 1),
                    (long) ctx->mainzisegmap_207695_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207695_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207695_runs;
        str_builder(&builder,
                    "main.segmap_208908                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208908_runs,
                    (long) ctx->mainzisegmap_208908_total_runtime /
                    (ctx->mainzisegmap_208908_runs !=
                     0 ? ctx->mainzisegmap_208908_runs : 1),
                    (long) ctx->mainzisegmap_208908_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208908_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208908_runs;
        str_builder(&builder,
                    "main.segmap_208922                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208922_runs,
                    (long) ctx->mainzisegmap_208922_total_runtime /
                    (ctx->mainzisegmap_208922_runs !=
                     0 ? ctx->mainzisegmap_208922_runs : 1),
                    (long) ctx->mainzisegmap_208922_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208922_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208922_runs;
        str_builder(&builder,
                    "main.segmap_208946                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208946_runs,
                    (long) ctx->mainzisegmap_208946_total_runtime /
                    (ctx->mainzisegmap_208946_runs !=
                     0 ? ctx->mainzisegmap_208946_runs : 1),
                    (long) ctx->mainzisegmap_208946_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208946_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208946_runs;
        str_builder(&builder,
                    "main.segmap_209556                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209556_runs,
                    (long) ctx->mainzisegmap_209556_total_runtime /
                    (ctx->mainzisegmap_209556_runs !=
                     0 ? ctx->mainzisegmap_209556_runs : 1),
                    (long) ctx->mainzisegmap_209556_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209556_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209556_runs;
        str_builder(&builder,
                    "main.segmap_209568                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209568_runs,
                    (long) ctx->mainzisegmap_209568_total_runtime /
                    (ctx->mainzisegmap_209568_runs !=
                     0 ? ctx->mainzisegmap_209568_runs : 1),
                    (long) ctx->mainzisegmap_209568_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209568_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209568_runs;
        str_builder(&builder,
                    "main.segmap_209589                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209589_runs,
                    (long) ctx->mainzisegmap_209589_total_runtime /
                    (ctx->mainzisegmap_209589_runs !=
                     0 ? ctx->mainzisegmap_209589_runs : 1),
                    (long) ctx->mainzisegmap_209589_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209589_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209589_runs;
        str_builder(&builder,
                    "main.segmap_210182                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210182_runs,
                    (long) ctx->mainzisegmap_210182_total_runtime /
                    (ctx->mainzisegmap_210182_runs !=
                     0 ? ctx->mainzisegmap_210182_runs : 1),
                    (long) ctx->mainzisegmap_210182_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210182_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210182_runs;
        str_builder(&builder,
                    "main.segmap_210194                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210194_runs,
                    (long) ctx->mainzisegmap_210194_total_runtime /
                    (ctx->mainzisegmap_210194_runs !=
                     0 ? ctx->mainzisegmap_210194_runs : 1),
                    (long) ctx->mainzisegmap_210194_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210194_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210194_runs;
        str_builder(&builder,
                    "main.segmap_210215                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210215_runs,
                    (long) ctx->mainzisegmap_210215_total_runtime /
                    (ctx->mainzisegmap_210215_runs !=
                     0 ? ctx->mainzisegmap_210215_runs : 1),
                    (long) ctx->mainzisegmap_210215_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210215_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210215_runs;
        str_builder(&builder,
                    "main.segmap_210357                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210357_runs,
                    (long) ctx->mainzisegmap_210357_total_runtime /
                    (ctx->mainzisegmap_210357_runs !=
                     0 ? ctx->mainzisegmap_210357_runs : 1),
                    (long) ctx->mainzisegmap_210357_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210357_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210357_runs;
        str_builder(&builder,
                    "main.segmap_210502                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210502_runs,
                    (long) ctx->mainzisegmap_210502_total_runtime /
                    (ctx->mainzisegmap_210502_runs !=
                     0 ? ctx->mainzisegmap_210502_runs : 1),
                    (long) ctx->mainzisegmap_210502_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210502_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210502_runs;
        str_builder(&builder,
                    "main.segmap_210632                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210632_runs,
                    (long) ctx->mainzisegmap_210632_total_runtime /
                    (ctx->mainzisegmap_210632_runs !=
                     0 ? ctx->mainzisegmap_210632_runs : 1),
                    (long) ctx->mainzisegmap_210632_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210632_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210632_runs;
        str_builder(&builder,
                    "main.segmap_211772                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211772_runs,
                    (long) ctx->mainzisegmap_211772_total_runtime /
                    (ctx->mainzisegmap_211772_runs !=
                     0 ? ctx->mainzisegmap_211772_runs : 1),
                    (long) ctx->mainzisegmap_211772_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211772_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211772_runs;
        str_builder(&builder,
                    "main.segmap_211980                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211980_runs,
                    (long) ctx->mainzisegmap_211980_total_runtime /
                    (ctx->mainzisegmap_211980_runs !=
                     0 ? ctx->mainzisegmap_211980_runs : 1),
                    (long) ctx->mainzisegmap_211980_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211980_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211980_runs;
        str_builder(&builder,
                    "main.segmap_212069                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212069_runs,
                    (long) ctx->mainzisegmap_212069_total_runtime /
                    (ctx->mainzisegmap_212069_runs !=
                     0 ? ctx->mainzisegmap_212069_runs : 1),
                    (long) ctx->mainzisegmap_212069_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212069_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212069_runs;
        str_builder(&builder,
                    "main.segmap_212141                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212141_runs,
                    (long) ctx->mainzisegmap_212141_total_runtime /
                    (ctx->mainzisegmap_212141_runs !=
                     0 ? ctx->mainzisegmap_212141_runs : 1),
                    (long) ctx->mainzisegmap_212141_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212141_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212141_runs;
        str_builder(&builder,
                    "main.segmap_212355                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212355_runs,
                    (long) ctx->mainzisegmap_212355_total_runtime /
                    (ctx->mainzisegmap_212355_runs !=
                     0 ? ctx->mainzisegmap_212355_runs : 1),
                    (long) ctx->mainzisegmap_212355_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212355_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212355_runs;
        str_builder(&builder,
                    "main.segmap_213809                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_213809_runs,
                    (long) ctx->mainzisegmap_213809_total_runtime /
                    (ctx->mainzisegmap_213809_runs !=
                     0 ? ctx->mainzisegmap_213809_runs : 1),
                    (long) ctx->mainzisegmap_213809_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_213809_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_213809_runs;
        str_builder(&builder,
                    "main.segmap_214084                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214084_runs,
                    (long) ctx->mainzisegmap_214084_total_runtime /
                    (ctx->mainzisegmap_214084_runs !=
                     0 ? ctx->mainzisegmap_214084_runs : 1),
                    (long) ctx->mainzisegmap_214084_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214084_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214084_runs;
        str_builder(&builder,
                    "main.segmap_214201                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214201_runs,
                    (long) ctx->mainzisegmap_214201_total_runtime /
                    (ctx->mainzisegmap_214201_runs !=
                     0 ? ctx->mainzisegmap_214201_runs : 1),
                    (long) ctx->mainzisegmap_214201_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214201_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214201_runs;
        str_builder(&builder,
                    "main.segmap_214285                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214285_runs,
                    (long) ctx->mainzisegmap_214285_total_runtime /
                    (ctx->mainzisegmap_214285_runs !=
                     0 ? ctx->mainzisegmap_214285_runs : 1),
                    (long) ctx->mainzisegmap_214285_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214285_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214285_runs;
        str_builder(&builder,
                    "main.segmap_214560                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214560_runs,
                    (long) ctx->mainzisegmap_214560_total_runtime /
                    (ctx->mainzisegmap_214560_runs !=
                     0 ? ctx->mainzisegmap_214560_runs : 1),
                    (long) ctx->mainzisegmap_214560_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214560_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214560_runs;
        str_builder(&builder,
                    "main.segmap_216352                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216352_runs,
                    (long) ctx->mainzisegmap_216352_total_runtime /
                    (ctx->mainzisegmap_216352_runs !=
                     0 ? ctx->mainzisegmap_216352_runs : 1),
                    (long) ctx->mainzisegmap_216352_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216352_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216352_runs;
        str_builder(&builder,
                    "main.segmap_216697                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216697_runs,
                    (long) ctx->mainzisegmap_216697_total_runtime /
                    (ctx->mainzisegmap_216697_runs !=
                     0 ? ctx->mainzisegmap_216697_runs : 1),
                    (long) ctx->mainzisegmap_216697_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216697_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216697_runs;
        str_builder(&builder,
                    "main.segmap_216846                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216846_runs,
                    (long) ctx->mainzisegmap_216846_total_runtime /
                    (ctx->mainzisegmap_216846_runs !=
                     0 ? ctx->mainzisegmap_216846_runs : 1),
                    (long) ctx->mainzisegmap_216846_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216846_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216846_runs;
        str_builder(&builder,
                    "main.segmap_216942                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216942_runs,
                    (long) ctx->mainzisegmap_216942_total_runtime /
                    (ctx->mainzisegmap_216942_runs !=
                     0 ? ctx->mainzisegmap_216942_runs : 1),
                    (long) ctx->mainzisegmap_216942_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216942_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216942_runs;
        str_builder(&builder,
                    "main.segmap_218503                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218503_runs,
                    (long) ctx->mainzisegmap_218503_total_runtime /
                    (ctx->mainzisegmap_218503_runs !=
                     0 ? ctx->mainzisegmap_218503_runs : 1),
                    (long) ctx->mainzisegmap_218503_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218503_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218503_runs;
        str_builder(&builder,
                    "main.segmap_218652                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218652_runs,
                    (long) ctx->mainzisegmap_218652_total_runtime /
                    (ctx->mainzisegmap_218652_runs !=
                     0 ? ctx->mainzisegmap_218652_runs : 1),
                    (long) ctx->mainzisegmap_218652_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218652_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218652_runs;
        str_builder(&builder,
                    "main.segmap_218688                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218688_runs,
                    (long) ctx->mainzisegmap_218688_total_runtime /
                    (ctx->mainzisegmap_218688_runs !=
                     0 ? ctx->mainzisegmap_218688_runs : 1),
                    (long) ctx->mainzisegmap_218688_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218688_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218688_runs;
        str_builder(&builder,
                    "main.segmap_218819                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218819_runs,
                    (long) ctx->mainzisegmap_218819_total_runtime /
                    (ctx->mainzisegmap_218819_runs !=
                     0 ? ctx->mainzisegmap_218819_runs : 1),
                    (long) ctx->mainzisegmap_218819_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218819_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218819_runs;
        str_builder(&builder,
                    "main.segmap_218950                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218950_runs,
                    (long) ctx->mainzisegmap_218950_total_runtime /
                    (ctx->mainzisegmap_218950_runs !=
                     0 ? ctx->mainzisegmap_218950_runs : 1),
                    (long) ctx->mainzisegmap_218950_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218950_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218950_runs;
        str_builder(&builder,
                    "main.segmap_219139                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219139_runs,
                    (long) ctx->mainzisegmap_219139_total_runtime /
                    (ctx->mainzisegmap_219139_runs !=
                     0 ? ctx->mainzisegmap_219139_runs : 1),
                    (long) ctx->mainzisegmap_219139_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219139_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219139_runs;
        str_builder(&builder,
                    "main.segmap_219524                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219524_runs,
                    (long) ctx->mainzisegmap_219524_total_runtime /
                    (ctx->mainzisegmap_219524_runs !=
                     0 ? ctx->mainzisegmap_219524_runs : 1),
                    (long) ctx->mainzisegmap_219524_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219524_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219524_runs;
        str_builder(&builder,
                    "main.segmap_219641                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219641_runs,
                    (long) ctx->mainzisegmap_219641_total_runtime /
                    (ctx->mainzisegmap_219641_runs !=
                     0 ? ctx->mainzisegmap_219641_runs : 1),
                    (long) ctx->mainzisegmap_219641_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219641_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219641_runs;
        str_builder(&builder,
                    "main.segmap_219802                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219802_runs,
                    (long) ctx->mainzisegmap_219802_total_runtime /
                    (ctx->mainzisegmap_219802_runs !=
                     0 ? ctx->mainzisegmap_219802_runs : 1),
                    (long) ctx->mainzisegmap_219802_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219802_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219802_runs;
        str_builder(&builder,
                    "main.segmap_220323                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220323_runs,
                    (long) ctx->mainzisegmap_220323_total_runtime /
                    (ctx->mainzisegmap_220323_runs !=
                     0 ? ctx->mainzisegmap_220323_runs : 1),
                    (long) ctx->mainzisegmap_220323_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220323_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220323_runs;
        str_builder(&builder,
                    "main.segmap_220480                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220480_runs,
                    (long) ctx->mainzisegmap_220480_total_runtime /
                    (ctx->mainzisegmap_220480_runs !=
                     0 ? ctx->mainzisegmap_220480_runs : 1),
                    (long) ctx->mainzisegmap_220480_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220480_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220480_runs;
        str_builder(&builder,
                    "main.segmap_220699                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220699_runs,
                    (long) ctx->mainzisegmap_220699_total_runtime /
                    (ctx->mainzisegmap_220699_runs !=
                     0 ? ctx->mainzisegmap_220699_runs : 1),
                    (long) ctx->mainzisegmap_220699_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220699_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220699_runs;
        str_builder(&builder,
                    "main.segmap_221368                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221368_runs,
                    (long) ctx->mainzisegmap_221368_total_runtime /
                    (ctx->mainzisegmap_221368_runs !=
                     0 ? ctx->mainzisegmap_221368_runs : 1),
                    (long) ctx->mainzisegmap_221368_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221368_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221368_runs;
        str_builder(&builder,
                    "main.segmap_221569                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221569_runs,
                    (long) ctx->mainzisegmap_221569_total_runtime /
                    (ctx->mainzisegmap_221569_runs !=
                     0 ? ctx->mainzisegmap_221569_runs : 1),
                    (long) ctx->mainzisegmap_221569_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221569_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221569_runs;
        str_builder(&builder,
                    "main.segmap_222439                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222439_runs,
                    (long) ctx->mainzisegmap_222439_total_runtime /
                    (ctx->mainzisegmap_222439_runs !=
                     0 ? ctx->mainzisegmap_222439_runs : 1),
                    (long) ctx->mainzisegmap_222439_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222439_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222439_runs;
        str_builder(&builder,
                    "main.segmap_222534                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222534_runs,
                    (long) ctx->mainzisegmap_222534_total_runtime /
                    (ctx->mainzisegmap_222534_runs !=
                     0 ? ctx->mainzisegmap_222534_runs : 1),
                    (long) ctx->mainzisegmap_222534_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222534_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222534_runs;
        str_builder(&builder,
                    "main.segmap_222641                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222641_runs,
                    (long) ctx->mainzisegmap_222641_total_runtime /
                    (ctx->mainzisegmap_222641_runs !=
                     0 ? ctx->mainzisegmap_222641_runs : 1),
                    (long) ctx->mainzisegmap_222641_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222641_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222641_runs;
        str_builder(&builder,
                    "main.segmap_223157                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223157_runs,
                    (long) ctx->mainzisegmap_223157_total_runtime /
                    (ctx->mainzisegmap_223157_runs !=
                     0 ? ctx->mainzisegmap_223157_runs : 1),
                    (long) ctx->mainzisegmap_223157_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223157_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223157_runs;
        str_builder(&builder,
                    "main.segmap_223174                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223174_runs,
                    (long) ctx->mainzisegmap_223174_total_runtime /
                    (ctx->mainzisegmap_223174_runs !=
                     0 ? ctx->mainzisegmap_223174_runs : 1),
                    (long) ctx->mainzisegmap_223174_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223174_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223174_runs;
        str_builder(&builder,
                    "main.segmap_223202                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223202_runs,
                    (long) ctx->mainzisegmap_223202_total_runtime /
                    (ctx->mainzisegmap_223202_runs !=
                     0 ? ctx->mainzisegmap_223202_runs : 1),
                    (long) ctx->mainzisegmap_223202_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223202_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223202_runs;
        str_builder(&builder,
                    "main.segmap_223326                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223326_runs,
                    (long) ctx->mainzisegmap_223326_total_runtime /
                    (ctx->mainzisegmap_223326_runs !=
                     0 ? ctx->mainzisegmap_223326_runs : 1),
                    (long) ctx->mainzisegmap_223326_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223326_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223326_runs;
        str_builder(&builder,
                    "main.segmap_223513                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223513_runs,
                    (long) ctx->mainzisegmap_223513_total_runtime /
                    (ctx->mainzisegmap_223513_runs !=
                     0 ? ctx->mainzisegmap_223513_runs : 1),
                    (long) ctx->mainzisegmap_223513_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223513_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223513_runs;
        str_builder(&builder,
                    "main.segmap_224163                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224163_runs,
                    (long) ctx->mainzisegmap_224163_total_runtime /
                    (ctx->mainzisegmap_224163_runs !=
                     0 ? ctx->mainzisegmap_224163_runs : 1),
                    (long) ctx->mainzisegmap_224163_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224163_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224163_runs;
        str_builder(&builder,
                    "main.segmap_224180                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224180_runs,
                    (long) ctx->mainzisegmap_224180_total_runtime /
                    (ctx->mainzisegmap_224180_runs !=
                     0 ? ctx->mainzisegmap_224180_runs : 1),
                    (long) ctx->mainzisegmap_224180_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224180_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224180_runs;
        str_builder(&builder,
                    "main.segmap_224210                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224210_runs,
                    (long) ctx->mainzisegmap_224210_total_runtime /
                    (ctx->mainzisegmap_224210_runs !=
                     0 ? ctx->mainzisegmap_224210_runs : 1),
                    (long) ctx->mainzisegmap_224210_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224210_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224210_runs;
        str_builder(&builder,
                    "main.segmap_224374                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224374_runs,
                    (long) ctx->mainzisegmap_224374_total_runtime /
                    (ctx->mainzisegmap_224374_runs !=
                     0 ? ctx->mainzisegmap_224374_runs : 1),
                    (long) ctx->mainzisegmap_224374_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224374_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224374_runs;
        str_builder(&builder,
                    "main.segmap_224619                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224619_runs,
                    (long) ctx->mainzisegmap_224619_total_runtime /
                    (ctx->mainzisegmap_224619_runs !=
                     0 ? ctx->mainzisegmap_224619_runs : 1),
                    (long) ctx->mainzisegmap_224619_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224619_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224619_runs;
        str_builder(&builder,
                    "main.segmap_225417                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225417_runs,
                    (long) ctx->mainzisegmap_225417_total_runtime /
                    (ctx->mainzisegmap_225417_runs !=
                     0 ? ctx->mainzisegmap_225417_runs : 1),
                    (long) ctx->mainzisegmap_225417_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225417_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225417_runs;
        str_builder(&builder,
                    "main.segmap_225434                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225434_runs,
                    (long) ctx->mainzisegmap_225434_total_runtime /
                    (ctx->mainzisegmap_225434_runs !=
                     0 ? ctx->mainzisegmap_225434_runs : 1),
                    (long) ctx->mainzisegmap_225434_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225434_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225434_runs;
        str_builder(&builder,
                    "main.segmap_225464                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225464_runs,
                    (long) ctx->mainzisegmap_225464_total_runtime /
                    (ctx->mainzisegmap_225464_runs !=
                     0 ? ctx->mainzisegmap_225464_runs : 1),
                    (long) ctx->mainzisegmap_225464_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225464_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225464_runs;
        str_builder(&builder,
                    "main.segmap_225672                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225672_runs,
                    (long) ctx->mainzisegmap_225672_total_runtime /
                    (ctx->mainzisegmap_225672_runs !=
                     0 ? ctx->mainzisegmap_225672_runs : 1),
                    (long) ctx->mainzisegmap_225672_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225672_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225672_runs;
        str_builder(&builder,
                    "main.segmap_225963                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225963_runs,
                    (long) ctx->mainzisegmap_225963_total_runtime /
                    (ctx->mainzisegmap_225963_runs !=
                     0 ? ctx->mainzisegmap_225963_runs : 1),
                    (long) ctx->mainzisegmap_225963_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225963_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225963_runs;
        str_builder(&builder,
                    "main.segmap_225980                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225980_runs,
                    (long) ctx->mainzisegmap_225980_total_runtime /
                    (ctx->mainzisegmap_225980_runs !=
                     0 ? ctx->mainzisegmap_225980_runs : 1),
                    (long) ctx->mainzisegmap_225980_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225980_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225980_runs;
        str_builder(&builder,
                    "main.segmap_226275                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226275_runs,
                    (long) ctx->mainzisegmap_226275_total_runtime /
                    (ctx->mainzisegmap_226275_runs !=
                     0 ? ctx->mainzisegmap_226275_runs : 1),
                    (long) ctx->mainzisegmap_226275_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226275_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226275_runs;
        str_builder(&builder,
                    "main.segmap_226292                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226292_runs,
                    (long) ctx->mainzisegmap_226292_total_runtime /
                    (ctx->mainzisegmap_226292_runs !=
                     0 ? ctx->mainzisegmap_226292_runs : 1),
                    (long) ctx->mainzisegmap_226292_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226292_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226292_runs;
        str_builder(&builder,
                    "main.segmap_226679                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226679_runs,
                    (long) ctx->mainzisegmap_226679_total_runtime /
                    (ctx->mainzisegmap_226679_runs !=
                     0 ? ctx->mainzisegmap_226679_runs : 1),
                    (long) ctx->mainzisegmap_226679_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226679_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226679_runs;
        str_builder(&builder,
                    "main.segmap_226696                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226696_runs,
                    (long) ctx->mainzisegmap_226696_total_runtime /
                    (ctx->mainzisegmap_226696_runs !=
                     0 ? ctx->mainzisegmap_226696_runs : 1),
                    (long) ctx->mainzisegmap_226696_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226696_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226696_runs;
        str_builder(&builder,
                    "main.segmap_226984                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226984_runs,
                    (long) ctx->mainzisegmap_226984_total_runtime /
                    (ctx->mainzisegmap_226984_runs !=
                     0 ? ctx->mainzisegmap_226984_runs : 1),
                    (long) ctx->mainzisegmap_226984_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226984_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226984_runs;
        str_builder(&builder,
                    "main.segmap_227201                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227201_runs,
                    (long) ctx->mainzisegmap_227201_total_runtime /
                    (ctx->mainzisegmap_227201_runs !=
                     0 ? ctx->mainzisegmap_227201_runs : 1),
                    (long) ctx->mainzisegmap_227201_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227201_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227201_runs;
        str_builder(&builder,
                    "main.segmap_227222                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227222_runs,
                    (long) ctx->mainzisegmap_227222_total_runtime /
                    (ctx->mainzisegmap_227222_runs !=
                     0 ? ctx->mainzisegmap_227222_runs : 1),
                    (long) ctx->mainzisegmap_227222_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227222_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227222_runs;
        str_builder(&builder,
                    "main.segmap_227351                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227351_runs,
                    (long) ctx->mainzisegmap_227351_total_runtime /
                    (ctx->mainzisegmap_227351_runs !=
                     0 ? ctx->mainzisegmap_227351_runs : 1),
                    (long) ctx->mainzisegmap_227351_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227351_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227351_runs;
        str_builder(&builder,
                    "main.segmap_228076                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228076_runs,
                    (long) ctx->mainzisegmap_228076_total_runtime /
                    (ctx->mainzisegmap_228076_runs !=
                     0 ? ctx->mainzisegmap_228076_runs : 1),
                    (long) ctx->mainzisegmap_228076_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228076_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228076_runs;
        str_builder(&builder,
                    "main.segmap_228131                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228131_runs,
                    (long) ctx->mainzisegmap_228131_total_runtime /
                    (ctx->mainzisegmap_228131_runs !=
                     0 ? ctx->mainzisegmap_228131_runs : 1),
                    (long) ctx->mainzisegmap_228131_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228131_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228131_runs;
        str_builder(&builder,
                    "main.segmap_228193                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228193_runs,
                    (long) ctx->mainzisegmap_228193_total_runtime /
                    (ctx->mainzisegmap_228193_runs !=
                     0 ? ctx->mainzisegmap_228193_runs : 1),
                    (long) ctx->mainzisegmap_228193_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228193_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228193_runs;
        str_builder(&builder,
                    "main.segmap_228279                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228279_runs,
                    (long) ctx->mainzisegmap_228279_total_runtime /
                    (ctx->mainzisegmap_228279_runs !=
                     0 ? ctx->mainzisegmap_228279_runs : 1),
                    (long) ctx->mainzisegmap_228279_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228279_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228279_runs;
        str_builder(&builder,
                    "main.segmap_228302                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228302_runs,
                    (long) ctx->mainzisegmap_228302_total_runtime /
                    (ctx->mainzisegmap_228302_runs !=
                     0 ? ctx->mainzisegmap_228302_runs : 1),
                    (long) ctx->mainzisegmap_228302_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228302_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228302_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_206983          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_206983_runs,
                    (long) ctx->mainzisegmap_intragroup_206983_total_runtime /
                    (ctx->mainzisegmap_intragroup_206983_runs !=
                     0 ? ctx->mainzisegmap_intragroup_206983_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_206983_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_206983_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_206983_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207338          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207338_runs,
                    (long) ctx->mainzisegmap_intragroup_207338_total_runtime /
                    (ctx->mainzisegmap_intragroup_207338_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207338_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207338_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207338_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207338_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207614          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207614_runs,
                    (long) ctx->mainzisegmap_intragroup_207614_total_runtime /
                    (ctx->mainzisegmap_intragroup_207614_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207614_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207614_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207614_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207614_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207867          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207867_runs,
                    (long) ctx->mainzisegmap_intragroup_207867_total_runtime /
                    (ctx->mainzisegmap_intragroup_207867_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207867_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207867_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207867_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207867_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_208771          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_208771_runs,
                    (long) ctx->mainzisegmap_intragroup_208771_total_runtime /
                    (ctx->mainzisegmap_intragroup_208771_runs !=
                     0 ? ctx->mainzisegmap_intragroup_208771_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_208771_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_208771_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_208771_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209172          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209172_runs,
                    (long) ctx->mainzisegmap_intragroup_209172_total_runtime /
                    (ctx->mainzisegmap_intragroup_209172_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209172_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209172_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209172_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209172_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209798          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209798_runs,
                    (long) ctx->mainzisegmap_intragroup_209798_total_runtime /
                    (ctx->mainzisegmap_intragroup_209798_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209798_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209798_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209798_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209798_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_211858          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_211858_runs,
                    (long) ctx->mainzisegmap_intragroup_211858_total_runtime /
                    (ctx->mainzisegmap_intragroup_211858_runs !=
                     0 ? ctx->mainzisegmap_intragroup_211858_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_211858_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_211858_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_211858_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_213926          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_213926_runs,
                    (long) ctx->mainzisegmap_intragroup_213926_total_runtime /
                    (ctx->mainzisegmap_intragroup_213926_runs !=
                     0 ? ctx->mainzisegmap_intragroup_213926_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_213926_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_213926_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_213926_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_216501          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_216501_runs,
                    (long) ctx->mainzisegmap_intragroup_216501_total_runtime /
                    (ctx->mainzisegmap_intragroup_216501_runs !=
                     0 ? ctx->mainzisegmap_intragroup_216501_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_216501_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_216501_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_216501_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217273          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217273_runs,
                    (long) ctx->mainzisegmap_intragroup_217273_total_runtime /
                    (ctx->mainzisegmap_intragroup_217273_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217273_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217273_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217273_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217273_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217594          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217594_runs,
                    (long) ctx->mainzisegmap_intragroup_217594_total_runtime /
                    (ctx->mainzisegmap_intragroup_217594_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217594_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217594_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217594_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217594_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_218045          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_218045_runs,
                    (long) ctx->mainzisegmap_intragroup_218045_total_runtime /
                    (ctx->mainzisegmap_intragroup_218045_runs !=
                     0 ? ctx->mainzisegmap_intragroup_218045_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_218045_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_218045_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_218045_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221759          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221759_runs,
                    (long) ctx->mainzisegmap_intragroup_221759_total_runtime /
                    (ctx->mainzisegmap_intragroup_221759_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221759_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221759_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221759_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221759_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221926          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221926_runs,
                    (long) ctx->mainzisegmap_intragroup_221926_total_runtime /
                    (ctx->mainzisegmap_intragroup_221926_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221926_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221926_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221926_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221926_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_222183          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_222183_runs,
                    (long) ctx->mainzisegmap_intragroup_222183_total_runtime /
                    (ctx->mainzisegmap_intragroup_222183_runs !=
                     0 ? ctx->mainzisegmap_intragroup_222183_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_222183_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_222183_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_222183_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226007          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226007_runs,
                    (long) ctx->mainzisegmap_intragroup_226007_total_runtime /
                    (ctx->mainzisegmap_intragroup_226007_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226007_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226007_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226007_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226007_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226320          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226320_runs,
                    (long) ctx->mainzisegmap_intragroup_226320_total_runtime /
                    (ctx->mainzisegmap_intragroup_226320_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226320_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226320_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226320_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226320_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226724          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226724_runs,
                    (long) ctx->mainzisegmap_intragroup_226724_total_runtime /
                    (ctx->mainzisegmap_intragroup_226724_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226724_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226724_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226724_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226724_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227074          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227074_runs,
                    (long) ctx->mainzisegmap_intragroup_227074_total_runtime /
                    (ctx->mainzisegmap_intragroup_227074_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227074_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227074_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227074_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227074_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227449          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227449_runs,
                    (long) ctx->mainzisegmap_intragroup_227449_total_runtime /
                    (ctx->mainzisegmap_intragroup_227449_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227449_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227449_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227449_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227449_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227905          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227905_runs,
                    (long) ctx->mainzisegmap_intragroup_227905_total_runtime /
                    (ctx->mainzisegmap_intragroup_227905_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227905_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227905_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227905_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227905_runs;
        str_builder(&builder,
                    "main.segred_large_212093               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212093_runs,
                    (long) ctx->mainzisegred_large_212093_total_runtime /
                    (ctx->mainzisegred_large_212093_runs !=
                     0 ? ctx->mainzisegred_large_212093_runs : 1),
                    (long) ctx->mainzisegred_large_212093_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212093_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212093_runs;
        str_builder(&builder,
                    "main.segred_large_212167               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212167_runs,
                    (long) ctx->mainzisegred_large_212167_total_runtime /
                    (ctx->mainzisegred_large_212167_runs !=
                     0 ? ctx->mainzisegred_large_212167_runs : 1),
                    (long) ctx->mainzisegred_large_212167_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212167_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212167_runs;
        str_builder(&builder,
                    "main.segred_large_214227               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214227_runs,
                    (long) ctx->mainzisegred_large_214227_total_runtime /
                    (ctx->mainzisegred_large_214227_runs !=
                     0 ? ctx->mainzisegred_large_214227_runs : 1),
                    (long) ctx->mainzisegred_large_214227_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214227_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214227_runs;
        str_builder(&builder,
                    "main.segred_large_214321               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214321_runs,
                    (long) ctx->mainzisegred_large_214321_total_runtime /
                    (ctx->mainzisegred_large_214321_runs !=
                     0 ? ctx->mainzisegred_large_214321_runs : 1),
                    (long) ctx->mainzisegred_large_214321_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214321_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214321_runs;
        str_builder(&builder,
                    "main.segred_large_216874               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216874_runs,
                    (long) ctx->mainzisegred_large_216874_total_runtime /
                    (ctx->mainzisegred_large_216874_runs !=
                     0 ? ctx->mainzisegred_large_216874_runs : 1),
                    (long) ctx->mainzisegred_large_216874_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216874_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216874_runs;
        str_builder(&builder,
                    "main.segred_large_216997               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216997_runs,
                    (long) ctx->mainzisegred_large_216997_total_runtime /
                    (ctx->mainzisegred_large_216997_runs !=
                     0 ? ctx->mainzisegred_large_216997_runs : 1),
                    (long) ctx->mainzisegred_large_216997_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216997_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216997_runs;
        str_builder(&builder,
                    "main.segred_large_218721               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218721_runs,
                    (long) ctx->mainzisegred_large_218721_total_runtime /
                    (ctx->mainzisegred_large_218721_runs !=
                     0 ? ctx->mainzisegred_large_218721_runs : 1),
                    (long) ctx->mainzisegred_large_218721_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218721_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218721_runs;
        str_builder(&builder,
                    "main.segred_large_218852               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218852_runs,
                    (long) ctx->mainzisegred_large_218852_total_runtime /
                    (ctx->mainzisegred_large_218852_runs !=
                     0 ? ctx->mainzisegred_large_218852_runs : 1),
                    (long) ctx->mainzisegred_large_218852_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218852_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218852_runs;
        str_builder(&builder,
                    "main.segred_large_218983               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218983_runs,
                    (long) ctx->mainzisegred_large_218983_total_runtime /
                    (ctx->mainzisegred_large_218983_runs !=
                     0 ? ctx->mainzisegred_large_218983_runs : 1),
                    (long) ctx->mainzisegred_large_218983_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218983_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218983_runs;
        str_builder(&builder,
                    "main.segred_large_219605               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219605_runs,
                    (long) ctx->mainzisegred_large_219605_total_runtime /
                    (ctx->mainzisegred_large_219605_runs !=
                     0 ? ctx->mainzisegred_large_219605_runs : 1),
                    (long) ctx->mainzisegred_large_219605_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219605_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219605_runs;
        str_builder(&builder,
                    "main.segred_large_219654               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219654_runs,
                    (long) ctx->mainzisegred_large_219654_total_runtime /
                    (ctx->mainzisegred_large_219654_runs !=
                     0 ? ctx->mainzisegred_large_219654_runs : 1),
                    (long) ctx->mainzisegred_large_219654_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219654_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219654_runs;
        str_builder(&builder,
                    "main.segred_large_220434               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220434_runs,
                    (long) ctx->mainzisegred_large_220434_total_runtime /
                    (ctx->mainzisegred_large_220434_runs !=
                     0 ? ctx->mainzisegred_large_220434_runs : 1),
                    (long) ctx->mainzisegred_large_220434_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220434_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220434_runs;
        str_builder(&builder,
                    "main.segred_large_220503               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220503_runs,
                    (long) ctx->mainzisegred_large_220503_total_runtime /
                    (ctx->mainzisegred_large_220503_runs !=
                     0 ? ctx->mainzisegred_large_220503_runs : 1),
                    (long) ctx->mainzisegred_large_220503_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220503_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220503_runs;
        str_builder(&builder,
                    "main.segred_large_221513               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221513_runs,
                    (long) ctx->mainzisegred_large_221513_total_runtime /
                    (ctx->mainzisegred_large_221513_runs !=
                     0 ? ctx->mainzisegred_large_221513_runs : 1),
                    (long) ctx->mainzisegred_large_221513_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221513_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221513_runs;
        str_builder(&builder,
                    "main.segred_large_221611               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221611_runs,
                    (long) ctx->mainzisegred_large_221611_total_runtime /
                    (ctx->mainzisegred_large_221611_runs !=
                     0 ? ctx->mainzisegred_large_221611_runs : 1),
                    (long) ctx->mainzisegred_large_221611_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221611_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221611_runs;
        str_builder(&builder,
                    "main.segred_large_223287               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223287_runs,
                    (long) ctx->mainzisegred_large_223287_total_runtime /
                    (ctx->mainzisegred_large_223287_runs !=
                     0 ? ctx->mainzisegred_large_223287_runs : 1),
                    (long) ctx->mainzisegred_large_223287_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223287_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223287_runs;
        str_builder(&builder,
                    "main.segred_large_223339               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223339_runs,
                    (long) ctx->mainzisegred_large_223339_total_runtime /
                    (ctx->mainzisegred_large_223339_runs !=
                     0 ? ctx->mainzisegred_large_223339_runs : 1),
                    (long) ctx->mainzisegred_large_223339_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223339_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223339_runs;
        str_builder(&builder,
                    "main.segred_large_224325               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224325_runs,
                    (long) ctx->mainzisegred_large_224325_total_runtime /
                    (ctx->mainzisegred_large_224325_runs !=
                     0 ? ctx->mainzisegred_large_224325_runs : 1),
                    (long) ctx->mainzisegred_large_224325_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224325_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224325_runs;
        str_builder(&builder,
                    "main.segred_large_224397               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224397_runs,
                    (long) ctx->mainzisegred_large_224397_total_runtime /
                    (ctx->mainzisegred_large_224397_runs !=
                     0 ? ctx->mainzisegred_large_224397_runs : 1),
                    (long) ctx->mainzisegred_large_224397_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224397_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224397_runs;
        str_builder(&builder,
                    "main.segred_large_225613               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225613_runs,
                    (long) ctx->mainzisegred_large_225613_total_runtime /
                    (ctx->mainzisegred_large_225613_runs !=
                     0 ? ctx->mainzisegred_large_225613_runs : 1),
                    (long) ctx->mainzisegred_large_225613_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225613_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225613_runs;
        str_builder(&builder,
                    "main.segred_large_225714               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225714_runs,
                    (long) ctx->mainzisegred_large_225714_total_runtime /
                    (ctx->mainzisegred_large_225714_runs !=
                     0 ? ctx->mainzisegred_large_225714_runs : 1),
                    (long) ctx->mainzisegred_large_225714_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225714_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225714_runs;
        str_builder(&builder,
                    "main.segred_large_228180               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_228180_runs,
                    (long) ctx->mainzisegred_large_228180_total_runtime /
                    (ctx->mainzisegred_large_228180_runs !=
                     0 ? ctx->mainzisegred_large_228180_runs : 1),
                    (long) ctx->mainzisegred_large_228180_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_228180_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_228180_runs;
        str_builder(&builder,
                    "main.segred_small_212093               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212093_runs,
                    (long) ctx->mainzisegred_small_212093_total_runtime /
                    (ctx->mainzisegred_small_212093_runs !=
                     0 ? ctx->mainzisegred_small_212093_runs : 1),
                    (long) ctx->mainzisegred_small_212093_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212093_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212093_runs;
        str_builder(&builder,
                    "main.segred_small_212167               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212167_runs,
                    (long) ctx->mainzisegred_small_212167_total_runtime /
                    (ctx->mainzisegred_small_212167_runs !=
                     0 ? ctx->mainzisegred_small_212167_runs : 1),
                    (long) ctx->mainzisegred_small_212167_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212167_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212167_runs;
        str_builder(&builder,
                    "main.segred_small_214227               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214227_runs,
                    (long) ctx->mainzisegred_small_214227_total_runtime /
                    (ctx->mainzisegred_small_214227_runs !=
                     0 ? ctx->mainzisegred_small_214227_runs : 1),
                    (long) ctx->mainzisegred_small_214227_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214227_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214227_runs;
        str_builder(&builder,
                    "main.segred_small_214321               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214321_runs,
                    (long) ctx->mainzisegred_small_214321_total_runtime /
                    (ctx->mainzisegred_small_214321_runs !=
                     0 ? ctx->mainzisegred_small_214321_runs : 1),
                    (long) ctx->mainzisegred_small_214321_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214321_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214321_runs;
        str_builder(&builder,
                    "main.segred_small_216874               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216874_runs,
                    (long) ctx->mainzisegred_small_216874_total_runtime /
                    (ctx->mainzisegred_small_216874_runs !=
                     0 ? ctx->mainzisegred_small_216874_runs : 1),
                    (long) ctx->mainzisegred_small_216874_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216874_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216874_runs;
        str_builder(&builder,
                    "main.segred_small_216997               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216997_runs,
                    (long) ctx->mainzisegred_small_216997_total_runtime /
                    (ctx->mainzisegred_small_216997_runs !=
                     0 ? ctx->mainzisegred_small_216997_runs : 1),
                    (long) ctx->mainzisegred_small_216997_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216997_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216997_runs;
        str_builder(&builder,
                    "main.segred_small_218721               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218721_runs,
                    (long) ctx->mainzisegred_small_218721_total_runtime /
                    (ctx->mainzisegred_small_218721_runs !=
                     0 ? ctx->mainzisegred_small_218721_runs : 1),
                    (long) ctx->mainzisegred_small_218721_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218721_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218721_runs;
        str_builder(&builder,
                    "main.segred_small_218852               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218852_runs,
                    (long) ctx->mainzisegred_small_218852_total_runtime /
                    (ctx->mainzisegred_small_218852_runs !=
                     0 ? ctx->mainzisegred_small_218852_runs : 1),
                    (long) ctx->mainzisegred_small_218852_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218852_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218852_runs;
        str_builder(&builder,
                    "main.segred_small_218983               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218983_runs,
                    (long) ctx->mainzisegred_small_218983_total_runtime /
                    (ctx->mainzisegred_small_218983_runs !=
                     0 ? ctx->mainzisegred_small_218983_runs : 1),
                    (long) ctx->mainzisegred_small_218983_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218983_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218983_runs;
        str_builder(&builder,
                    "main.segred_small_219605               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219605_runs,
                    (long) ctx->mainzisegred_small_219605_total_runtime /
                    (ctx->mainzisegred_small_219605_runs !=
                     0 ? ctx->mainzisegred_small_219605_runs : 1),
                    (long) ctx->mainzisegred_small_219605_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219605_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219605_runs;
        str_builder(&builder,
                    "main.segred_small_219654               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219654_runs,
                    (long) ctx->mainzisegred_small_219654_total_runtime /
                    (ctx->mainzisegred_small_219654_runs !=
                     0 ? ctx->mainzisegred_small_219654_runs : 1),
                    (long) ctx->mainzisegred_small_219654_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219654_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219654_runs;
        str_builder(&builder,
                    "main.segred_small_220434               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220434_runs,
                    (long) ctx->mainzisegred_small_220434_total_runtime /
                    (ctx->mainzisegred_small_220434_runs !=
                     0 ? ctx->mainzisegred_small_220434_runs : 1),
                    (long) ctx->mainzisegred_small_220434_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220434_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220434_runs;
        str_builder(&builder,
                    "main.segred_small_220503               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220503_runs,
                    (long) ctx->mainzisegred_small_220503_total_runtime /
                    (ctx->mainzisegred_small_220503_runs !=
                     0 ? ctx->mainzisegred_small_220503_runs : 1),
                    (long) ctx->mainzisegred_small_220503_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220503_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220503_runs;
        str_builder(&builder,
                    "main.segred_small_221513               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221513_runs,
                    (long) ctx->mainzisegred_small_221513_total_runtime /
                    (ctx->mainzisegred_small_221513_runs !=
                     0 ? ctx->mainzisegred_small_221513_runs : 1),
                    (long) ctx->mainzisegred_small_221513_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221513_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221513_runs;
        str_builder(&builder,
                    "main.segred_small_221611               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221611_runs,
                    (long) ctx->mainzisegred_small_221611_total_runtime /
                    (ctx->mainzisegred_small_221611_runs !=
                     0 ? ctx->mainzisegred_small_221611_runs : 1),
                    (long) ctx->mainzisegred_small_221611_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221611_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221611_runs;
        str_builder(&builder,
                    "main.segred_small_223287               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223287_runs,
                    (long) ctx->mainzisegred_small_223287_total_runtime /
                    (ctx->mainzisegred_small_223287_runs !=
                     0 ? ctx->mainzisegred_small_223287_runs : 1),
                    (long) ctx->mainzisegred_small_223287_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223287_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223287_runs;
        str_builder(&builder,
                    "main.segred_small_223339               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223339_runs,
                    (long) ctx->mainzisegred_small_223339_total_runtime /
                    (ctx->mainzisegred_small_223339_runs !=
                     0 ? ctx->mainzisegred_small_223339_runs : 1),
                    (long) ctx->mainzisegred_small_223339_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223339_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223339_runs;
        str_builder(&builder,
                    "main.segred_small_224325               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224325_runs,
                    (long) ctx->mainzisegred_small_224325_total_runtime /
                    (ctx->mainzisegred_small_224325_runs !=
                     0 ? ctx->mainzisegred_small_224325_runs : 1),
                    (long) ctx->mainzisegred_small_224325_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224325_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224325_runs;
        str_builder(&builder,
                    "main.segred_small_224397               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224397_runs,
                    (long) ctx->mainzisegred_small_224397_total_runtime /
                    (ctx->mainzisegred_small_224397_runs !=
                     0 ? ctx->mainzisegred_small_224397_runs : 1),
                    (long) ctx->mainzisegred_small_224397_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224397_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224397_runs;
        str_builder(&builder,
                    "main.segred_small_225613               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225613_runs,
                    (long) ctx->mainzisegred_small_225613_total_runtime /
                    (ctx->mainzisegred_small_225613_runs !=
                     0 ? ctx->mainzisegred_small_225613_runs : 1),
                    (long) ctx->mainzisegred_small_225613_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225613_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225613_runs;
        str_builder(&builder,
                    "main.segred_small_225714               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225714_runs,
                    (long) ctx->mainzisegred_small_225714_total_runtime /
                    (ctx->mainzisegred_small_225714_runs !=
                     0 ? ctx->mainzisegred_small_225714_runs : 1),
                    (long) ctx->mainzisegred_small_225714_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225714_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225714_runs;
        str_builder(&builder,
                    "main.segred_small_228180               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_228180_runs,
                    (long) ctx->mainzisegred_small_228180_total_runtime /
                    (ctx->mainzisegred_small_228180_runs !=
                     0 ? ctx->mainzisegred_small_228180_runs : 1),
                    (long) ctx->mainzisegred_small_228180_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_228180_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_228180_runs;
        str_builder(&builder,
                    "main.segscan_206957                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_206957_runs,
                    (long) ctx->mainzisegscan_206957_total_runtime /
                    (ctx->mainzisegscan_206957_runs !=
                     0 ? ctx->mainzisegscan_206957_runs : 1),
                    (long) ctx->mainzisegscan_206957_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_206957_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_206957_runs;
        str_builder(&builder,
                    "main.segscan_207097                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_207097_runs,
                    (long) ctx->mainzisegscan_207097_total_runtime /
                    (ctx->mainzisegscan_207097_runs !=
                     0 ? ctx->mainzisegscan_207097_runs : 1),
                    (long) ctx->mainzisegscan_207097_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_207097_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_207097_runs;
        str_builder(&builder,
                    "main.segscan_207649                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_207649_runs,
                    (long) ctx->mainzisegscan_207649_total_runtime /
                    (ctx->mainzisegscan_207649_runs !=
                     0 ? ctx->mainzisegscan_207649_runs : 1),
                    (long) ctx->mainzisegscan_207649_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_207649_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_207649_runs;
        str_builder(&builder,
                    "main.segscan_218773                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_218773_runs,
                    (long) ctx->mainzisegscan_218773_total_runtime /
                    (ctx->mainzisegscan_218773_runs !=
                     0 ? ctx->mainzisegscan_218773_runs : 1),
                    (long) ctx->mainzisegscan_218773_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_218773_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_218773_runs;
        str_builder(&builder,
                    "main.segscan_218904                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_218904_runs,
                    (long) ctx->mainzisegscan_218904_total_runtime /
                    (ctx->mainzisegscan_218904_runs !=
                     0 ? ctx->mainzisegscan_218904_runs : 1),
                    (long) ctx->mainzisegscan_218904_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_218904_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_218904_runs;
        str_builder(&builder,
                    "main.segscan_219035                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_219035_runs,
                    (long) ctx->mainzisegscan_219035_total_runtime /
                    (ctx->mainzisegscan_219035_runs !=
                     0 ? ctx->mainzisegscan_219035_runs : 1),
                    (long) ctx->mainzisegscan_219035_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_219035_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_219035_runs;
        str_builder(&builder,
                    "main.segscan_228005                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegscan_228005_runs,
                    (long) ctx->mainzisegscan_228005_total_runtime /
                    (ctx->mainzisegscan_228005_runs !=
                     0 ? ctx->mainzisegscan_228005_runs : 1),
                    (long) ctx->mainzisegscan_228005_total_runtime);
        ctx->total_runtime += ctx->mainzisegscan_228005_total_runtime;
        ctx->total_runs += ctx->mainzisegscan_228005_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);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    ctx->peak_mem_usage_device = 0;
    ctx->peak_mem_usage_default = 0;
    if (ctx->error == NULL)
        CUDA_SUCCEED_NONFATAL(cuda_free_all(&ctx->cuda));
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    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_233075,
                                         int32_t num_elems_233076,
                                         double val_233077);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232616,
                                         int32_t num_elems_232617,
                                         int64_t val_232618);
static int futrts_builtinzhreplicate_i8(struct futhark_context *ctx,
                                        struct memblock_device mem_232373,
                                        int32_t num_elems_232374,
                                        int8_t val_232375);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_237253,
                             struct memblock_device *mem_out_p_237254,
                             struct memblock_device *mem_out_p_237255,
                             struct memblock_device Y_mem_229239,
                             int64_t m_203571, int64_t n_203572,
                             int64_t n_p_203574, int64_t q_s_203575,
                             int64_t q_t_203576, int64_t q_l_203577,
                             int64_t d_s_203578, int64_t d_t_203579,
                             int64_t d_l_203580, int64_t jump_s_203581,
                             int64_t jump_t_203582, int64_t jump_l_203583,
                             int64_t n_inner_203584, int64_t n_outer_203585,
                             int64_t jump_threshold_203586,
                             int64_t q_threshold_203587);

static int init_constants(struct futhark_context *ctx)
{
    (void) ctx;
    
    int err = 0;
    
    
  cleanup:
    return err;
}
static int free_constants(struct futhark_context *ctx)
{
    (void) ctx;
    return 0;
}
struct futhark_f64_2d {
    struct memblock_device mem;
    int64_t shape[2];
};
struct futhark_f64_2d *futhark_new_f64_2d(struct futhark_context *ctx, const
                                          double *data, int64_t dim0,
                                          int64_t dim1)
{
    struct futhark_f64_2d *bad = NULL;
    struct futhark_f64_2d *arr =
                          (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    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;
    {
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda, &ctx->copy_host_to_dev_runs,
                                      &ctx->copy_host_to_dev_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuMemcpyHtoD(arr->mem.mem + 0, data + 0,
                                            (size_t) (dim0 * dim1) * 8));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
    }
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    lock_unlock(&ctx->lock);
    return arr;
}
struct futhark_f64_2d *futhark_new_raw_f64_2d(struct futhark_context *ctx, const
                                              CUdeviceptr 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);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    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;
    {
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda, &ctx->copy_dev_to_dev_runs,
                                      &ctx->copy_dev_to_dev_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuMemcpy(arr->mem.mem + 0, data + offset,
                                        (size_t) (dim0 * dim1) * 8));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
    }
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    lock_unlock(&ctx->lock);
    return arr;
}
int futhark_free_f64_2d(struct futhark_context *ctx, struct futhark_f64_2d *arr)
{
    lock_lock(&ctx->lock);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    if (memblock_unref_device(ctx, &arr->mem, "arr->mem") != 0)
        return 1;
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    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);
    CUDA_SUCCEED_FATAL(cuCtxPushCurrent(ctx->cuda.cu_ctx));
    {
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda, &ctx->copy_dev_to_host_runs,
                                      &ctx->copy_dev_to_host_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuMemcpyDtoH(data + 0, arr->mem.mem + 0,
                                            (size_t) (arr->shape[0] *
                                                      arr->shape[1]) * 8));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
    }
    CUDA_SUCCEED_FATAL(cuCtxPopCurrent(&ctx->cuda.cu_ctx));
    lock_unlock(&ctx->lock);
    return 0;
}
CUdeviceptr 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)) {
            {
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->copy_dev_to_dev_runs,
                                              &ctx->copy_dev_to_dev_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuMemcpy(destmem_0.mem +
                                                sext_i32_i64(destoffset_1),
                                                srcmem_2.mem +
                                                sext_i32_i64(srcoffset_3),
                                                sext_i32_i64(x_elems_5 *
                                                y_elems_6 * 8)));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            }
        } else {
            if (sle32(x_elems_5, 8) && slt32(16, y_elems_6)) {
                unsigned int shared_sizze_237188 = (int64_t) 2176;
                CUdeviceptr kernel_arg_237190 = destmem_0.mem;
                CUdeviceptr kernel_arg_237191 = srcmem_2.mem;
                unsigned int shared_offset_237189 = 0;
                
                if ((((((1 && sdiv_up32(x_elems_5, 16) != 0) &&
                        sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16) != 0) &&
                       num_arrays_4 != 0) && 16 != 0) && 16 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16) >= 1 <<
                        16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (num_arrays_4 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = sdiv_up32(x_elems_5, 16);
                    grid[perm[1]] = sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16);
                    grid[perm[2]] = num_arrays_4;
                    
                    void *kernel_args_237185[] = {&perm[0], &perm[1], &perm[2],
                                                  &shared_offset_237189,
                                                  &destoffset_1, &srcoffset_3,
                                                  &num_arrays_4, &x_elems_5,
                                                  &y_elems_6, &mulx_7, &muly_8,
                                                  &kernel_arg_237190,
                                                  &kernel_arg_237191};
                    int64_t time_start_237186 = 0, time_end_237187 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "gpu_map_transpose_f64_low_width",
                                (long) sdiv_up32(x_elems_5, 16),
                                (long) sdiv_up32(sdiv_up32(y_elems_6, muly_8),
                                                 16), (long) num_arrays_4,
                                (long) 16, (long) 16, (long) 1, (int) (0 +
                                                                       (shared_sizze_237188 +
                                                                        (8 -
                                                                         shared_sizze_237188 %
                                                                         8) %
                                                                        8)));
                        time_start_237186 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->gpu_map_transpose_f64_low_width_runs,
                                                  &ctx->gpu_map_transpose_f64_low_width_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f64_low_width,
                                                          grid[0], grid[1],
                                                          grid[2], 16, 16, 1,
                                                          0 +
                                                          (shared_sizze_237188 +
                                                           (8 -
                                                            shared_sizze_237188 %
                                                            8) % 8), NULL,
                                                          kernel_args_237185,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237187 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f64_low_width",
                                time_end_237187 - time_start_237186);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    unsigned int shared_sizze_237195 = (int64_t) 2176;
                    CUdeviceptr kernel_arg_237197 = destmem_0.mem;
                    CUdeviceptr kernel_arg_237198 = srcmem_2.mem;
                    unsigned int shared_offset_237196 = 0;
                    
                    if ((((((1 && sdiv_up32(sdiv_up32(x_elems_5, mulx_7), 16) !=
                             0) && sdiv_up32(y_elems_6, 16) != 0) &&
                           num_arrays_4 != 0) && 16 != 0) && 16 != 0) && 1 !=
                        0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (sdiv_up32(y_elems_6, 16) >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (num_arrays_4 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = sdiv_up32(sdiv_up32(x_elems_5, mulx_7),
                                                  16);
                        grid[perm[1]] = sdiv_up32(y_elems_6, 16);
                        grid[perm[2]] = num_arrays_4;
                        
                        void *kernel_args_237192[] = {&perm[0], &perm[1],
                                                      &perm[2],
                                                      &shared_offset_237196,
                                                      &destoffset_1,
                                                      &srcoffset_3,
                                                      &num_arrays_4, &x_elems_5,
                                                      &y_elems_6, &mulx_7,
                                                      &muly_8,
                                                      &kernel_arg_237197,
                                                      &kernel_arg_237198};
                        int64_t time_start_237193 = 0, time_end_237194 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "gpu_map_transpose_f64_low_height",
                                    (long) sdiv_up32(sdiv_up32(x_elems_5,
                                                               mulx_7), 16),
                                    (long) sdiv_up32(y_elems_6, 16),
                                    (long) num_arrays_4, (long) 16, (long) 16,
                                    (long) 1, (int) (0 + (shared_sizze_237195 +
                                                          (8 -
                                                           shared_sizze_237195 %
                                                           8) % 8)));
                            time_start_237193 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->gpu_map_transpose_f64_low_height_runs,
                                                      &ctx->gpu_map_transpose_f64_low_height_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f64_low_height,
                                                              grid[0], grid[1],
                                                              grid[2], 16, 16,
                                                              1, 0 +
                                                              (shared_sizze_237195 +
                                                               (8 -
                                                                shared_sizze_237195 %
                                                                8) % 8), NULL,
                                                              kernel_args_237192,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_237194 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f64_low_height",
                                    time_end_237194 - time_start_237193);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        unsigned int shared_sizze_237202 = (int64_t) 1;
                        CUdeviceptr kernel_arg_237204 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237205 = srcmem_2.mem;
                        unsigned int shared_offset_237203 = 0;
                        
                        if ((((((1 && sdiv_up32(num_arrays_4 * x_elems_5 *
                                                y_elems_6, 256) != 0) && 1 !=
                                0) && 1 != 0) && 256 != 0) && 1 != 0) && 1 !=
                            0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = sdiv_up32(num_arrays_4 * x_elems_5 *
                                                      y_elems_6, 256);
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_237199[] = {&shared_offset_237203,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237204,
                                                          &kernel_arg_237205};
                            int64_t time_start_237200 = 0, time_end_237201 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "gpu_map_transpose_f64_small",
                                        (long) sdiv_up32(num_arrays_4 *
                                                         x_elems_5 * y_elems_6,
                                                         256), (long) 1,
                                        (long) 1, (long) 256, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_237202 +
                                                          (8 -
                                                           shared_sizze_237202 %
                                                           8) % 8)));
                                time_start_237200 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->gpu_map_transpose_f64_small_runs,
                                                          &ctx->gpu_map_transpose_f64_small_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f64_small,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2], 256,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_237202 +
                                                                   (8 -
                                                                    shared_sizze_237202 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237199,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237201 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64_small",
                                        time_end_237201 - time_start_237200);
                            }
                        }
                    } else {
                        unsigned int shared_sizze_237209 = (int64_t) 8448;
                        CUdeviceptr kernel_arg_237211 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237212 = srcmem_2.mem;
                        unsigned int shared_offset_237210 = 0;
                        
                        if ((((((1 && sdiv_up32(x_elems_5, 32) != 0) &&
                                sdiv_up32(y_elems_6, 32) != 0) &&
                               num_arrays_4 != 0) && 32 != 0) && 8 != 0) && 1 !=
                            0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (sdiv_up32(y_elems_6, 32) >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (num_arrays_4 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = sdiv_up32(x_elems_5, 32);
                            grid[perm[1]] = sdiv_up32(y_elems_6, 32);
                            grid[perm[2]] = num_arrays_4;
                            
                            void *kernel_args_237206[] = {&perm[0], &perm[1],
                                                          &perm[2],
                                                          &shared_offset_237210,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237211,
                                                          &kernel_arg_237212};
                            int64_t time_start_237207 = 0, time_end_237208 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "gpu_map_transpose_f64",
                                        (long) sdiv_up32(x_elems_5, 32),
                                        (long) sdiv_up32(y_elems_6, 32),
                                        (long) num_arrays_4, (long) 32,
                                        (long) 8, (long) 1, (int) (0 +
                                                                   (shared_sizze_237209 +
                                                                    (8 -
                                                                     shared_sizze_237209 %
                                                                     8) % 8)));
                                time_start_237207 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->gpu_map_transpose_f64_runs,
                                                          &ctx->gpu_map_transpose_f64_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_f64,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2], 32,
                                                                  8, 1, 0 +
                                                                  (shared_sizze_237209 +
                                                                   (8 -
                                                                    shared_sizze_237209 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237206,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237208 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64",
                                        time_end_237208 - time_start_237207);
                            }
                        }
                    }
                }
            }
        }
    }
    
  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)) {
            {
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->copy_dev_to_dev_runs,
                                              &ctx->copy_dev_to_dev_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuMemcpy(destmem_0.mem +
                                                sext_i32_i64(destoffset_1),
                                                srcmem_2.mem +
                                                sext_i32_i64(srcoffset_3),
                                                sext_i32_i64(x_elems_5 *
                                                y_elems_6 * 8)));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            }
        } else {
            if (sle32(x_elems_5, 8) && slt32(16, y_elems_6)) {
                unsigned int shared_sizze_237216 = (int64_t) 2176;
                CUdeviceptr kernel_arg_237218 = destmem_0.mem;
                CUdeviceptr kernel_arg_237219 = srcmem_2.mem;
                unsigned int shared_offset_237217 = 0;
                
                if ((((((1 && sdiv_up32(x_elems_5, 16) != 0) &&
                        sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16) != 0) &&
                       num_arrays_4 != 0) && 16 != 0) && 16 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16) >= 1 <<
                        16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (num_arrays_4 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = sdiv_up32(x_elems_5, 16);
                    grid[perm[1]] = sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16);
                    grid[perm[2]] = num_arrays_4;
                    
                    void *kernel_args_237213[] = {&perm[0], &perm[1], &perm[2],
                                                  &shared_offset_237217,
                                                  &destoffset_1, &srcoffset_3,
                                                  &num_arrays_4, &x_elems_5,
                                                  &y_elems_6, &mulx_7, &muly_8,
                                                  &kernel_arg_237218,
                                                  &kernel_arg_237219};
                    int64_t time_start_237214 = 0, time_end_237215 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "gpu_map_transpose_i64_low_width",
                                (long) sdiv_up32(x_elems_5, 16),
                                (long) sdiv_up32(sdiv_up32(y_elems_6, muly_8),
                                                 16), (long) num_arrays_4,
                                (long) 16, (long) 16, (long) 1, (int) (0 +
                                                                       (shared_sizze_237216 +
                                                                        (8 -
                                                                         shared_sizze_237216 %
                                                                         8) %
                                                                        8)));
                        time_start_237214 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->gpu_map_transpose_i64_low_width_runs,
                                                  &ctx->gpu_map_transpose_i64_low_width_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_i64_low_width,
                                                          grid[0], grid[1],
                                                          grid[2], 16, 16, 1,
                                                          0 +
                                                          (shared_sizze_237216 +
                                                           (8 -
                                                            shared_sizze_237216 %
                                                            8) % 8), NULL,
                                                          kernel_args_237213,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237215 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_i64_low_width",
                                time_end_237215 - time_start_237214);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    unsigned int shared_sizze_237223 = (int64_t) 2176;
                    CUdeviceptr kernel_arg_237225 = destmem_0.mem;
                    CUdeviceptr kernel_arg_237226 = srcmem_2.mem;
                    unsigned int shared_offset_237224 = 0;
                    
                    if ((((((1 && sdiv_up32(sdiv_up32(x_elems_5, mulx_7), 16) !=
                             0) && sdiv_up32(y_elems_6, 16) != 0) &&
                           num_arrays_4 != 0) && 16 != 0) && 16 != 0) && 1 !=
                        0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (sdiv_up32(y_elems_6, 16) >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (num_arrays_4 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = sdiv_up32(sdiv_up32(x_elems_5, mulx_7),
                                                  16);
                        grid[perm[1]] = sdiv_up32(y_elems_6, 16);
                        grid[perm[2]] = num_arrays_4;
                        
                        void *kernel_args_237220[] = {&perm[0], &perm[1],
                                                      &perm[2],
                                                      &shared_offset_237224,
                                                      &destoffset_1,
                                                      &srcoffset_3,
                                                      &num_arrays_4, &x_elems_5,
                                                      &y_elems_6, &mulx_7,
                                                      &muly_8,
                                                      &kernel_arg_237225,
                                                      &kernel_arg_237226};
                        int64_t time_start_237221 = 0, time_end_237222 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "gpu_map_transpose_i64_low_height",
                                    (long) sdiv_up32(sdiv_up32(x_elems_5,
                                                               mulx_7), 16),
                                    (long) sdiv_up32(y_elems_6, 16),
                                    (long) num_arrays_4, (long) 16, (long) 16,
                                    (long) 1, (int) (0 + (shared_sizze_237223 +
                                                          (8 -
                                                           shared_sizze_237223 %
                                                           8) % 8)));
                            time_start_237221 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->gpu_map_transpose_i64_low_height_runs,
                                                      &ctx->gpu_map_transpose_i64_low_height_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_i64_low_height,
                                                              grid[0], grid[1],
                                                              grid[2], 16, 16,
                                                              1, 0 +
                                                              (shared_sizze_237223 +
                                                               (8 -
                                                                shared_sizze_237223 %
                                                                8) % 8), NULL,
                                                              kernel_args_237220,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_237222 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_i64_low_height",
                                    time_end_237222 - time_start_237221);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        unsigned int shared_sizze_237230 = (int64_t) 1;
                        CUdeviceptr kernel_arg_237232 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237233 = srcmem_2.mem;
                        unsigned int shared_offset_237231 = 0;
                        
                        if ((((((1 && sdiv_up32(num_arrays_4 * x_elems_5 *
                                                y_elems_6, 256) != 0) && 1 !=
                                0) && 1 != 0) && 256 != 0) && 1 != 0) && 1 !=
                            0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = sdiv_up32(num_arrays_4 * x_elems_5 *
                                                      y_elems_6, 256);
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_237227[] = {&shared_offset_237231,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237232,
                                                          &kernel_arg_237233};
                            int64_t time_start_237228 = 0, time_end_237229 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "gpu_map_transpose_i64_small",
                                        (long) sdiv_up32(num_arrays_4 *
                                                         x_elems_5 * y_elems_6,
                                                         256), (long) 1,
                                        (long) 1, (long) 256, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_237230 +
                                                          (8 -
                                                           shared_sizze_237230 %
                                                           8) % 8)));
                                time_start_237228 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->gpu_map_transpose_i64_small_runs,
                                                          &ctx->gpu_map_transpose_i64_small_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_i64_small,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2], 256,
                                                                  1, 1, 0 +
                                                                  (shared_sizze_237230 +
                                                                   (8 -
                                                                    shared_sizze_237230 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237227,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237229 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64_small",
                                        time_end_237229 - time_start_237228);
                            }
                        }
                    } else {
                        unsigned int shared_sizze_237237 = (int64_t) 8448;
                        CUdeviceptr kernel_arg_237239 = destmem_0.mem;
                        CUdeviceptr kernel_arg_237240 = srcmem_2.mem;
                        unsigned int shared_offset_237238 = 0;
                        
                        if ((((((1 && sdiv_up32(x_elems_5, 32) != 0) &&
                                sdiv_up32(y_elems_6, 32) != 0) &&
                               num_arrays_4 != 0) && 32 != 0) && 8 != 0) && 1 !=
                            0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (sdiv_up32(y_elems_6, 32) >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (num_arrays_4 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = sdiv_up32(x_elems_5, 32);
                            grid[perm[1]] = sdiv_up32(y_elems_6, 32);
                            grid[perm[2]] = num_arrays_4;
                            
                            void *kernel_args_237234[] = {&perm[0], &perm[1],
                                                          &perm[2],
                                                          &shared_offset_237238,
                                                          &destoffset_1,
                                                          &srcoffset_3,
                                                          &num_arrays_4,
                                                          &x_elems_5,
                                                          &y_elems_6, &mulx_7,
                                                          &muly_8,
                                                          &kernel_arg_237239,
                                                          &kernel_arg_237240};
                            int64_t time_start_237235 = 0, time_end_237236 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "gpu_map_transpose_i64",
                                        (long) sdiv_up32(x_elems_5, 32),
                                        (long) sdiv_up32(y_elems_6, 32),
                                        (long) num_arrays_4, (long) 32,
                                        (long) 8, (long) 1, (int) (0 +
                                                                   (shared_sizze_237237 +
                                                                    (8 -
                                                                     shared_sizze_237237 %
                                                                     8) % 8)));
                                time_start_237235 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->gpu_map_transpose_i64_runs,
                                                          &ctx->gpu_map_transpose_i64_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->gpu_map_transpose_i64,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2], 32,
                                                                  8, 1, 0 +
                                                                  (shared_sizze_237237 +
                                                                   (8 -
                                                                    shared_sizze_237237 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_237234,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237236 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64",
                                        time_end_237236 - time_start_237235);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f64(struct futhark_context *ctx,
                                         struct memblock_device mem_233075,
                                         int32_t num_elems_233076,
                                         double val_233077)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_233082;
    
    group_sizze_233082 =
        *ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_233082;
    
    int64_t num_groups_233083 = sdiv_up64(num_elems_233076, group_sizze_233082);
    CUdeviceptr kernel_arg_237244 = mem_233075.mem;
    
    if ((((((1 && num_groups_233083 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_233082 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[1] = perm[0];
            perm[0] = 1;
        }
        if (1 >= 1 << 16) {
            perm[2] = perm[0];
            perm[0] = 2;
        }
        
        size_t grid[3];
        
        grid[perm[0]] = num_groups_233083;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237241[] = {&num_elems_233076, &val_233077,
                                      &kernel_arg_237244};
        int64_t time_start_237242 = 0, time_end_237243 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                    "builtin#replicate_f64.replicate_233079",
                    (long) num_groups_233083, (long) 1, (long) 1,
                    (long) group_sizze_233082, (long) 1, (long) 1, (int) 0);
            time_start_237242 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_f64zireplicate_233079_runs,
                                      &ctx->builtinzhreplicate_f64zireplicate_233079_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_f64zireplicate_233079,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_233082, 1, 1, 0, NULL,
                                              kernel_args_237241, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237243 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_f64.replicate_233079", time_end_237243 -
                    time_start_237242);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232616,
                                         int32_t num_elems_232617,
                                         int64_t val_232618)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232623;
    
    group_sizze_232623 =
        *ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232623;
    
    int64_t num_groups_232624 = sdiv_up64(num_elems_232617, group_sizze_232623);
    CUdeviceptr kernel_arg_237248 = mem_232616.mem;
    
    if ((((((1 && num_groups_232624 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_232623 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[1] = perm[0];
            perm[0] = 1;
        }
        if (1 >= 1 << 16) {
            perm[2] = perm[0];
            perm[0] = 2;
        }
        
        size_t grid[3];
        
        grid[perm[0]] = num_groups_232624;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237245[] = {&num_elems_232617, &val_232618,
                                      &kernel_arg_237248};
        int64_t time_start_237246 = 0, time_end_237247 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                    "builtin#replicate_i64.replicate_232620",
                    (long) num_groups_232624, (long) 1, (long) 1,
                    (long) group_sizze_232623, (long) 1, (long) 1, (int) 0);
            time_start_237246 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_i64zireplicate_232620_runs,
                                      &ctx->builtinzhreplicate_i64zireplicate_232620_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_i64zireplicate_232620,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_232623, 1, 1, 0, NULL,
                                              kernel_args_237245, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237247 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_232620", time_end_237247 -
                    time_start_237246);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i8(struct futhark_context *ctx,
                                        struct memblock_device mem_232373,
                                        int32_t num_elems_232374,
                                        int8_t val_232375)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232380;
    
    group_sizze_232380 =
        *ctx->tuning_params.builtinzhreplicate_i8zigroup_sizze_232380;
    
    int64_t num_groups_232381 = sdiv_up64(num_elems_232374, group_sizze_232380);
    CUdeviceptr kernel_arg_237252 = mem_232373.mem;
    
    if ((((((1 && num_groups_232381 != 0) && 1 != 0) && 1 != 0) &&
          group_sizze_232380 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[1] = perm[0];
            perm[0] = 1;
        }
        if (1 >= 1 << 16) {
            perm[2] = perm[0];
            perm[0] = 2;
        }
        
        size_t grid[3];
        
        grid[perm[0]] = num_groups_232381;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237249[] = {&num_elems_232374, &val_232375,
                                      &kernel_arg_237252};
        int64_t time_start_237250 = 0, time_end_237251 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                    "builtin#replicate_i8.replicate_232377",
                    (long) num_groups_232381, (long) 1, (long) 1,
                    (long) group_sizze_232380, (long) 1, (long) 1, (int) 0);
            time_start_237250 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->builtinzhreplicate_i8zireplicate_232377_runs,
                                      &ctx->builtinzhreplicate_i8zireplicate_232377_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->builtinzhreplicate_i8zireplicate_232377,
                                              grid[0], grid[1], grid[2],
                                              group_sizze_232380, 1, 1, 0, NULL,
                                              kernel_args_237249, NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237251 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "builtin#replicate_i8.replicate_232377", time_end_237251 -
                    time_start_237250);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_237253,
                             struct memblock_device *mem_out_p_237254,
                             struct memblock_device *mem_out_p_237255,
                             struct memblock_device Y_mem_229239,
                             int64_t m_203571, int64_t n_203572,
                             int64_t n_p_203574, int64_t q_s_203575,
                             int64_t q_t_203576, int64_t q_l_203577,
                             int64_t d_s_203578, int64_t d_t_203579,
                             int64_t d_l_203580, int64_t jump_s_203581,
                             int64_t jump_t_203582, int64_t jump_l_203583,
                             int64_t n_inner_203584, int64_t n_outer_203585,
                             int64_t jump_threshold_203586,
                             int64_t q_threshold_203587)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device mem_out_232359;
    
    mem_out_232359.references = NULL;
    
    struct memblock_device mem_out_232360;
    
    mem_out_232360.references = NULL;
    
    struct memblock_device mem_out_232361;
    
    mem_out_232361.references = NULL;
    
    double i64_res_203588 = sitofp_i64_f64(n_203572);
    double i64_res_203589 = sitofp_i64_f64(n_p_203574);
    double ceil_arg_203590 = i64_res_203588 / i64_res_203589;
    double ceil_res_203591;
    
    ceil_res_203591 = futrts_ceil64(ceil_arg_203590);
    
    int64_t defunc_0_f_res_203592 = fptosi_f64_i64(ceil_res_203591);
    bool bounds_invalid_upwards_203593 = slt64(n_p_203574, (int64_t) 0);
    bool valid_203594 = !bounds_invalid_upwards_203593;
    bool range_valid_c_203595;
    
    if (!valid_203594) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) n_p_203574, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:403:29-408:37\n   #4  stl.fut:402:22-409:28\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_203597 = slt64(defunc_0_f_res_203592,
                                               (int64_t) 0);
    bool valid_203598 = !bounds_invalid_upwards_203597;
    bool range_valid_c_203599;
    
    if (!valid_203598) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_203592,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:404:36-407:52\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:403:29-408:37\n   #8  stl.fut:402:22-409:28\n   #9  stl.fut:455:3-469:34\n   #10 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segscan_group_sizze_206952;
    
    segscan_group_sizze_206952 =
        *ctx->tuning_params.mainzisegscan_group_sizze_206951;
    
    int64_t num_groups_206954;
    int32_t max_num_groups_232362;
    
    max_num_groups_232362 = *ctx->tuning_params.mainzisegscan_num_groups_206953;
    num_groups_206954 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203571,
                                                             segscan_group_sizze_206952),
                                                   sext_i32_i64(max_num_groups_232362))));
    
    int64_t binop_x_229240 = m_203571 * n_203572;
    int64_t bytes_229241 = (int64_t) 8 * binop_x_229240;
    struct memblock_device mem_229242;
    
    mem_229242.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229242, bytes_229241, "mem_229242")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_229242, (int64_t) 0,
                                              Y_mem_229239, (int64_t) 0,
                                              (int64_t) 1, n_203572,
                                              m_203571) != 0) {
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_229258 = (int64_t) 8 * m_203571;
    int64_t bytes_229259 = smax64((int64_t) 0, binop_y_229258);
    struct memblock_device mem_229260;
    
    mem_229260.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229260, bytes_229259, "mem_229260")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229263;
    
    mem_229263.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229263, bytes_229259, "mem_229263")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_229264 = smax64((int64_t) 0, m_203571);
    struct memblock_device mem_229265;
    
    mem_229265.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229265, bytes_229264, "mem_229265")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_229244 = smax64((int64_t) 0, defunc_0_f_res_203592);
    int64_t num_threads_232195 = segscan_group_sizze_206952 * num_groups_206954;
    int64_t total_sizze_232196 = bytes_229244 * num_threads_232195;
    struct memblock_device color_232074;
    
    color_232074.references = NULL;
    if (memblock_alloc_device(ctx, &color_232074, total_sizze_232196,
                              "color_232074")) {
        err = 1;
        goto cleanup;
    }
    if (slt64((int64_t) 0, m_203571)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegScan");
        if (ctx->debugging)
            fprintf(ctx->log, "%s: %llu%c",
                    "SegScan: number of elements processed sequentially per thread is m:",
                    (long long) 11, '\n');
        if (ctx->debugging)
            fprintf(ctx->log, "%s: %llu%c", "SegScan: memory constraints is: ",
                    (long long) 11, '\n');
        if (ctx->debugging)
            fprintf(ctx->log, "%s: %llu%c",
                    "SegScan: register constraints is: ", (long long) 15, '\n');
        if (ctx->debugging)
            fprintf(ctx->log, "%s: %llu%c", "SegScan: sumT' is: ",
                    (long long) 2, '\n');
        
        int64_t numThreads_232363 = sdiv_up64(m_203571,
                                              segscan_group_sizze_206952 *
                                              (int64_t) 11) *
                segscan_group_sizze_206952;
        int64_t numGroups_232364 = sdiv_up64(m_203571,
                                             segscan_group_sizze_206952 *
                                             (int64_t) 11);
        struct memblock_device mainziid_counter_mem_232365 =
                               ctx->mainziid_counter_mem_232365;
        struct memblock_device status_flags_mem_232367;
        
        status_flags_mem_232367.references = NULL;
        if (memblock_alloc_device(ctx, &status_flags_mem_232367,
                                  numGroups_232364,
                                  "status_flags_mem_232367")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device aggregates_mem_232369;
        
        aggregates_mem_232369.references = NULL;
        if (memblock_alloc_device(ctx, &aggregates_mem_232369, (int64_t) 8 *
                                  numGroups_232364, "aggregates_mem_232369")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device incprefixes_mem_232371;
        
        incprefixes_mem_232371.references = NULL;
        if (memblock_alloc_device(ctx, &incprefixes_mem_232371, (int64_t) 8 *
                                  numGroups_232364, "incprefixes_mem_232371")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_232367,
                                         numGroups_232364, (int8_t) 0) != 0) {
            if (memblock_unref_device(ctx, &incprefixes_mem_232371,
                                      "incprefixes_mem_232371") != 0)
                return 1;
            if (memblock_unref_device(ctx, &aggregates_mem_232369,
                                      "aggregates_mem_232369") != 0)
                return 1;
            if (memblock_unref_device(ctx, &status_flags_mem_232367,
                                      "status_flags_mem_232367") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        unsigned int shared_sizze_237260 = smax64(smax64((int64_t) 288,
                                                         (int64_t) 8 *
                                                         segscan_group_sizze_206952),
                                                  (int64_t) 11 *
                                                  segscan_group_sizze_206952 *
                                                  (int64_t) 8);
        CUdeviceptr kernel_arg_237262 = mem_229242.mem;
        CUdeviceptr kernel_arg_237263 = mem_229260.mem;
        CUdeviceptr kernel_arg_237264 = mem_229263.mem;
        CUdeviceptr kernel_arg_237265 = mem_229265.mem;
        CUdeviceptr kernel_arg_237266 = color_232074.mem;
        CUdeviceptr kernel_arg_237267 = mainziid_counter_mem_232365.mem;
        CUdeviceptr kernel_arg_237268 = status_flags_mem_232367.mem;
        CUdeviceptr kernel_arg_237269 = aggregates_mem_232369.mem;
        CUdeviceptr kernel_arg_237270 = incprefixes_mem_232371.mem;
        unsigned int shared_offset_237261 = 0;
        
        if ((((((1 && sdiv_up64(m_203571, segscan_group_sizze_206952 *
                                (int64_t) 11) != 0) && 1 != 0) && 1 != 0) &&
              segscan_group_sizze_206952 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = sdiv_up64(m_203571, segscan_group_sizze_206952 *
                                      (int64_t) 11);
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237257[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237261, &m_203571,
                                          &n_203572, &n_p_203574,
                                          &defunc_0_f_res_203592,
                                          &num_threads_232195,
                                          &kernel_arg_237262,
                                          &kernel_arg_237263,
                                          &kernel_arg_237264,
                                          &kernel_arg_237265,
                                          &kernel_arg_237266,
                                          &kernel_arg_237267,
                                          &kernel_arg_237268,
                                          &kernel_arg_237269,
                                          &kernel_arg_237270};
            int64_t time_start_237258 = 0, time_end_237259 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segscan_206957", (long) sdiv_up64(m_203571,
                                                                segscan_group_sizze_206952 *
                                                                (int64_t) 11),
                        (long) 1, (long) 1, (long) segscan_group_sizze_206952,
                        (long) 1, (long) 1, (int) (0 + (shared_sizze_237260 +
                                                        (8 -
                                                         shared_sizze_237260 %
                                                         8) % 8)));
                time_start_237258 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegscan_206957_runs,
                                          &ctx->mainzisegscan_206957_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_206957,
                                                  grid[0], grid[1], grid[2],
                                                  segscan_group_sizze_206952, 1,
                                                  1, 0 + (shared_sizze_237260 +
                                                          (8 -
                                                           shared_sizze_237260 %
                                                           8) % 8), NULL,
                                                  kernel_args_237257, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237259 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segscan_206957", time_end_237259 -
                        time_start_237258);
            }
        }
        ctx->failure_is_an_option = 1;
        if (memblock_unref_device(ctx, &incprefixes_mem_232371,
                                  "incprefixes_mem_232371") != 0)
            return 1;
        if (memblock_unref_device(ctx, &aggregates_mem_232369,
                                  "aggregates_mem_232369") != 0)
            return 1;
        if (memblock_unref_device(ctx, &status_flags_mem_232367,
                                  "status_flags_mem_232367") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
        return 1;
    
    int64_t last_index_203665 = m_203571 - (int64_t) 1;
    bool is_empty_203666 = m_203571 == (int64_t) 0;
    int64_t partition_sizze_203667;
    
    if (is_empty_203666) {
        partition_sizze_203667 = (int64_t) 0;
    } else {
        int64_t last_offset_203668;
        int64_t read_res_237271;
        
        {
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->copy_scalar_from_dev_runs,
                                          &ctx->copy_scalar_from_dev_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuMemcpyDtoH(&read_res_237271,
                                                mem_229260.mem +
                                                last_index_203665 *
                                                sizeof(int64_t),
                                                sizeof(int64_t)));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        }
        if (futhark_context_sync(ctx) != 0)
            return 1;
        last_offset_203668 = read_res_237271;
        partition_sizze_203667 = last_offset_203668;
    }
    
    int64_t bytes_229268 = smax64((int64_t) 0, bytes_229241);
    struct memblock_device mem_229269;
    
    mem_229269.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229269, bytes_229268, "mem_229269")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229272;
    
    mem_229272.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229272, bytes_229259, "mem_229272")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_206962;
    
    segmap_group_sizze_206962 =
        *ctx->tuning_params.mainzisegmap_group_sizze_206961;
    
    int64_t num_groups_206964;
    int32_t max_num_groups_232473;
    
    max_num_groups_232473 = *ctx->tuning_params.mainzisegmap_num_groups_206963;
    num_groups_206964 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203571,
                                                             segmap_group_sizze_206962),
                                                   sext_i32_i64(max_num_groups_232473))));
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    
    CUdeviceptr kernel_arg_237275 = mem_229242.mem;
    CUdeviceptr kernel_arg_237276 = mem_229260.mem;
    CUdeviceptr kernel_arg_237277 = mem_229263.mem;
    CUdeviceptr kernel_arg_237278 = mem_229269.mem;
    CUdeviceptr kernel_arg_237279 = mem_229272.mem;
    
    if ((((((1 && num_groups_206964 != 0) && 1 != 0) && 1 != 0) &&
          segmap_group_sizze_206962 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[1] = perm[0];
            perm[0] = 1;
        }
        if (1 >= 1 << 16) {
            perm[2] = perm[0];
            perm[0] = 2;
        }
        
        size_t grid[3];
        
        grid[perm[0]] = num_groups_206964;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237272[] = {&ctx->global_failure, &m_203571,
                                      &n_203572, &num_groups_206964,
                                      &kernel_arg_237275, &kernel_arg_237276,
                                      &kernel_arg_237277, &kernel_arg_237278,
                                      &kernel_arg_237279};
        int64_t time_start_237273 = 0, time_end_237274 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                    "main.segmap_206959", (long) num_groups_206964, (long) 1,
                    (long) 1, (long) segmap_group_sizze_206962, (long) 1,
                    (long) 1, (int) 0);
            time_start_237273 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->mainzisegmap_206959_runs,
                                      &ctx->mainzisegmap_206959_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_206959, grid[0],
                                              grid[1], grid[2],
                                              segmap_group_sizze_206962, 1, 1,
                                              0, NULL, kernel_args_237272,
                                              NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237274 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "main.segmap_206959", time_end_237274 - time_start_237273);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
        return 1;
    
    bool empty_slice_203681 = partition_sizze_203667 == (int64_t) 0;
    int64_t m_203682 = sub64(partition_sizze_203667, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_203683 = sle64((int64_t) 0, m_203682);
    bool i_p_m_t_s_leq_w_203684 = slt64(m_203682, m_203571);
    bool i_lte_j_203685 = sle64((int64_t) 0, partition_sizze_203667);
    bool y_203686 = zzero_leq_i_p_m_t_s_203683 && i_p_m_t_s_leq_w_203684;
    bool y_203687 = i_lte_j_203685 && y_203686;
    bool ok_or_empty_203688 = empty_slice_203681 || y_203687;
    bool index_certs_203689;
    
    if (!ok_or_empty_203688) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) partition_sizze_203667,
                               "] out of bounds for array of shape [",
                               (long long) m_203571, "].",
                               "-> #0  /prelude/soacs.fut:163:6-16\n   #1  stl.fut:412:7-66\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203692 = sle64((int64_t) 4, n_p_203574);
    bool assert_c_203693;
    
    if (!assert_cond_203692) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (n_p >= 4)",
                               "-> #0  stl.fut:69:13-33\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203694 = smod64(q_t_203576, (int64_t) 2);
    bool assert_cond_203695 = x_203694 == (int64_t) 1;
    bool assert_c_203696;
    
    if (!assert_cond_203695) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:71:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203697 = slt64((int64_t) 0, q_t_203576);
    bool assert_c_203698;
    
    if (!assert_cond_203697) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:71:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203699 = smod64(q_l_203577, (int64_t) 2);
    bool assert_cond_203700 = x_203699 == (int64_t) 1;
    bool assert_c_203701;
    
    if (!assert_cond_203700) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:20:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:72:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203702 = slt64((int64_t) 0, q_l_203577);
    bool assert_c_203703;
    
    if (!assert_cond_203702) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:72:13-25\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203704 = sle64((int64_t) 0, d_t_203579);
    bool assert_cond_t_res_203705 = sle64(d_t_203579, (int64_t) 2);
    bool x_203706 = cond_203704 && assert_cond_t_res_203705;
    bool assert_c_203707;
    
    if (!x_203706) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:74:13-25\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203708 = sle64((int64_t) 0, d_l_203580);
    bool assert_cond_t_res_203709 = sle64(d_l_203580, (int64_t) 2);
    bool x_203710 = cond_203708 && assert_cond_t_res_203709;
    bool assert_c_203711;
    
    if (!x_203710) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:23:3-29\n   #1  stl.fut:75:13-25\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203712 = slt64((int64_t) 0, jump_t_203582);
    bool assert_c_203713;
    
    if (!assert_cond_203712) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:77:16-31\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203714 = slt64((int64_t) 0, jump_l_203583);
    bool assert_c_203715;
    
    if (!assert_cond_203714) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:78:16-31\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203716 = slt64((int64_t) 0, n_inner_203584);
    bool assert_c_203717;
    
    if (!assert_cond_203716) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:80:17-33\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203718 = slt64((int64_t) 0, n_outer_203585);
    bool assert_c_203719;
    
    if (!assert_cond_203718) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:17:3-18\n   #1  stl.fut:81:17-33\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    double ceil_res_203720;
    
    ceil_res_203720 = futrts_ceil64(ceil_arg_203590);
    
    int64_t defunc_0_f_res_203721 = fptosi_f64_i64(ceil_res_203720);
    int64_t pad_css_len_203722 = add64((int64_t) 2, defunc_0_f_res_203721);
    int64_t y_203723 = mul64((int64_t) 2, n_p_203574);
    int64_t C_len_203724 = add64(n_203572, y_203723);
    bool cond_203725 = jump_s_203581 == (int64_t) 1;
    int64_t s_n_m_203726;
    
    if (cond_203725) {
        s_n_m_203726 = pad_css_len_203722;
    } else {
        bool zzero_203727 = jump_s_203581 == (int64_t) 0;
        bool nonzzero_203728 = !zzero_203727;
        bool nonzzero_cert_203729;
        
        if (!nonzzero_203728) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:88:52-71\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203730 = sdiv64(defunc_0_f_res_203721, jump_s_203581);
        int64_t s_n_m_f_res_203731 = add64((int64_t) 3, x_203730);
        
        s_n_m_203726 = s_n_m_f_res_203731;
    }
    
    bool cond_203732 = jump_l_203583 == (int64_t) 1;
    int64_t l_n_m_203733;
    
    if (cond_203732) {
        l_n_m_203733 = n_203572;
    } else {
        bool zzero_203734 = jump_l_203583 == (int64_t) 0;
        bool nonzzero_203735 = !zzero_203734;
        bool nonzzero_cert_203736;
        
        if (!nonzzero_203735) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:94:42-51\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203737 = sdiv64(n_203572, jump_l_203583);
        int64_t l_n_m_f_res_203738 = add64((int64_t) 1, x_203737);
        
        l_n_m_203733 = l_n_m_f_res_203738;
    }
    
    bool cond_203739 = jump_t_203582 == (int64_t) 1;
    int64_t t_n_m_203740;
    
    if (cond_203739) {
        t_n_m_203740 = n_203572;
    } else {
        bool zzero_203741 = jump_t_203582 == (int64_t) 0;
        bool nonzzero_203742 = !zzero_203741;
        bool nonzzero_cert_203743;
        
        if (!nonzzero_203742) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:98:42-51\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203744 = sdiv64(n_203572, jump_t_203582);
        int64_t t_n_m_f_res_203745 = add64((int64_t) 1, x_203744);
        
        t_n_m_203740 = t_n_m_f_res_203745;
    }
    
    double x_203746 = i64_res_203588 / 2.0;
    double floor_arg_203747 = 1.0 + x_203746;
    double floor_res_203748;
    
    floor_res_203748 = futrts_floor64(floor_arg_203747);
    
    int64_t defunc_0_f_res_203749 = fptosi_f64_i64(floor_res_203748);
    int64_t x_203750 = sub64(n_203572, defunc_0_f_res_203749);
    int64_t mid2_203751 = add64((int64_t) 1, x_203750);
    bool cond_203752 = defunc_0_f_res_203749 == mid2_203751;
    int64_t stl_res_t_res_203753 = sub64(defunc_0_f_res_203749, (int64_t) 1);
    int64_t stl_res_203754;
    int64_t stl_res_203755;
    
    if (cond_203752) {
        stl_res_203754 = stl_res_t_res_203753;
        stl_res_203755 = defunc_0_f_res_203749;
    } else {
        int64_t min_res_203756 = smin64(defunc_0_f_res_203749, mid2_203751);
        int64_t stl_res_f_res_203757 = sub64(min_res_203756, (int64_t) 1);
        int64_t max_res_203758 = smax64(defunc_0_f_res_203749, mid2_203751);
        
        stl_res_203754 = stl_res_f_res_203757;
        stl_res_203755 = max_res_203758;
    }
    
    int64_t i_203760 = sub64(n_203572, (int64_t) 1);
    bool x_203761 = sle64((int64_t) 0, i_203760);
    bool y_203762 = slt64(i_203760, n_203572);
    bool bounds_check_203763 = x_203761 && y_203762;
    bool index_certs_203764;
    
    if (!bounds_check_203763) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203760,
                               "] out of bounds for array of shape [",
                               (long long) n_203572, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:112:31-49\n   #3  stl.fut:415:61-429:75\n   #4  stl.fut:455:3-469:34\n   #5  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t max_group_sizze_206977;
    
    max_group_sizze_206977 = ctx->cuda.max_block_size;
    
    bool fits_206978 = sle64(n_203572, max_group_sizze_206977);
    bool suff_intra_par_206976;
    
    suff_intra_par_206976 = *ctx->tuning_params.mainzisuff_intra_par_0 <=
        n_203572;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_0",
                (long) n_203572, suff_intra_par_206976 ? "true" : "false");
    
    bool intra_suff_and_fits_206979 = suff_intra_par_206976 && fits_206978;
    int64_t nest_sizze_207090 = n_203572 * partition_sizze_203667;
    int64_t segscan_group_sizze_207091;
    
    segscan_group_sizze_207091 =
        *ctx->tuning_params.mainzisegscan_group_sizze_207071;
    
    int64_t num_groups_207092;
    int32_t max_num_groups_232487;
    
    max_num_groups_232487 = *ctx->tuning_params.mainzisegscan_num_groups_207073;
    num_groups_207092 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207090,
                                                             segscan_group_sizze_207091),
                                                   sext_i32_i64(max_num_groups_232487))));
    
    int64_t segmap_group_sizze_207130;
    
    segmap_group_sizze_207130 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207015;
    
    int64_t binop_y_229284 = (int64_t) 8 * nest_sizze_207090;
    int64_t bytes_229285 = smax64((int64_t) 0, binop_y_229284);
    int64_t binop_y_229287 = (int64_t) 8 * partition_sizze_203667;
    int64_t bytes_229288 = smax64((int64_t) 0, binop_y_229287);
    int64_t binop_y_229276 = (int64_t) 8 * n_203572;
    int64_t bytes_229277 = smax64((int64_t) 0, binop_y_229276);
    struct memblock_device ext_mem_229305;
    
    ext_mem_229305.references = NULL;
    
    struct memblock_device ext_mem_229304;
    
    ext_mem_229304.references = NULL;
    
    int32_t local_memory_capacity_232647;
    
    local_memory_capacity_232647 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229277 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229277,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232647)) &&
        intra_suff_and_fits_206979) {
        struct memblock_device mem_229286;
        
        mem_229286.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229286, bytes_229285,
                                  "mem_229286")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229289;
        
        mem_229289.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229289, bytes_229288,
                                  "mem_229289")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237283 = bytes_229277;
        unsigned int shared_sizze_237285 = bytes_229277;
        CUdeviceptr kernel_arg_237287 = mem_229269.mem;
        CUdeviceptr kernel_arg_237288 = mem_229286.mem;
        CUdeviceptr kernel_arg_237289 = mem_229289.mem;
        unsigned int shared_offset_237284 = 0;
        unsigned int shared_offset_237286 = 0 + (shared_sizze_237283 + (8 -
                                                                        shared_sizze_237283 %
                                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) && 1 != 0) &&
              n_203572 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = partition_sizze_203667;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237280[] = {&ctx->global_failure,
                                          &shared_offset_237284,
                                          &shared_offset_237286, &n_203572,
                                          &partition_sizze_203667, &i_203760,
                                          &kernel_arg_237287,
                                          &kernel_arg_237288,
                                          &kernel_arg_237289};
            int64_t time_start_237281 = 0, time_end_237282 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_intragroup_206983",
                        (long) partition_sizze_203667, (long) 1, (long) 1,
                        (long) n_203572, (long) 1, (long) 1, (int) (0 +
                                                                    (shared_sizze_237283 +
                                                                     (8 -
                                                                      shared_sizze_237283 %
                                                                      8) % 8) +
                                                                    (shared_sizze_237285 +
                                                                     (8 -
                                                                      shared_sizze_237285 %
                                                                      8) % 8)));
                time_start_237281 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_206983_runs,
                                          &ctx->mainzisegmap_intragroup_206983_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_206983,
                                                  grid[0], grid[1], grid[2],
                                                  n_203572, 1, 1, 0 +
                                                  (shared_sizze_237283 + (8 -
                                                                          shared_sizze_237283 %
                                                                          8) %
                                                   8) + (shared_sizze_237285 +
                                                         (8 -
                                                          shared_sizze_237285 %
                                                          8) % 8), NULL,
                                                  kernel_args_237280, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237282 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_206983", time_end_237282 -
                        time_start_237281);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229305, &mem_229286,
                                "mem_229286") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229304, &mem_229289,
                                "mem_229289") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229289, "mem_229289") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229286, "mem_229286") != 0)
            return 1;
    } else {
        struct memblock_device mem_229294;
        
        mem_229294.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229294, bytes_229285,
                                  "mem_229294")) {
            err = 1;
            goto cleanup;
        }
        if (slt64((int64_t) 0, partition_sizze_203667 * n_203572)) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegScan");
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c",
                        "SegScan: number of elements processed sequentially per thread is m:",
                        (long long) 11, '\n');
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c",
                        "SegScan: memory constraints is: ", (long long) 11,
                        '\n');
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c",
                        "SegScan: register constraints is: ", (long long) 15,
                        '\n');
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c", "SegScan: sumT' is: ",
                        (long long) 2, '\n');
            
            int64_t numThreads_232513 = sdiv_up64(partition_sizze_203667 *
                                                  n_203572,
                                                  segscan_group_sizze_207091 *
                                                  (int64_t) 11) *
                    segscan_group_sizze_207091;
            int64_t numGroups_232514 = sdiv_up64(partition_sizze_203667 *
                                                 n_203572,
                                                 segscan_group_sizze_207091 *
                                                 (int64_t) 11);
            struct memblock_device mainziid_counter_mem_232515 =
                                   ctx->mainziid_counter_mem_232515;
            struct memblock_device status_flags_mem_232517;
            
            status_flags_mem_232517.references = NULL;
            if (memblock_alloc_device(ctx, &status_flags_mem_232517,
                                      numGroups_232514,
                                      "status_flags_mem_232517")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device aggregates_mem_232519;
            
            aggregates_mem_232519.references = NULL;
            if (memblock_alloc_device(ctx, &aggregates_mem_232519, (int64_t) 8 *
                                      numGroups_232514,
                                      "aggregates_mem_232519")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device incprefixes_mem_232521;
            
            incprefixes_mem_232521.references = NULL;
            if (memblock_alloc_device(ctx, &incprefixes_mem_232521,
                                      (int64_t) 8 * numGroups_232514,
                                      "incprefixes_mem_232521")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_232517,
                                             numGroups_232514, (int8_t) 0) !=
                0) {
                if (memblock_unref_device(ctx, &incprefixes_mem_232521,
                                          "incprefixes_mem_232521") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_232519,
                                          "aggregates_mem_232519") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_232517,
                                          "status_flags_mem_232517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            unsigned int shared_sizze_237294 = smax64(smax64((int64_t) 288,
                                                             (int64_t) 8 *
                                                             segscan_group_sizze_207091),
                                                      (int64_t) 11 *
                                                      segscan_group_sizze_207091 *
                                                      (int64_t) 8);
            CUdeviceptr kernel_arg_237296 = mem_229269.mem;
            CUdeviceptr kernel_arg_237297 = mem_229294.mem;
            CUdeviceptr kernel_arg_237298 = mainziid_counter_mem_232515.mem;
            CUdeviceptr kernel_arg_237299 = status_flags_mem_232517.mem;
            CUdeviceptr kernel_arg_237300 = aggregates_mem_232519.mem;
            CUdeviceptr kernel_arg_237301 = incprefixes_mem_232521.mem;
            unsigned int shared_offset_237295 = 0;
            
            if ((((((1 && sdiv_up64(partition_sizze_203667 * n_203572,
                                    segscan_group_sizze_207091 *
                                    (int64_t) 11) != 0) && 1 != 0) && 1 != 0) &&
                  segscan_group_sizze_207091 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = sdiv_up64(partition_sizze_203667 * n_203572,
                                          segscan_group_sizze_207091 *
                                          (int64_t) 11);
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237291[] = {&ctx->global_failure,
                                              &shared_offset_237295, &n_203572,
                                              &partition_sizze_203667,
                                              &kernel_arg_237296,
                                              &kernel_arg_237297,
                                              &kernel_arg_237298,
                                              &kernel_arg_237299,
                                              &kernel_arg_237300,
                                              &kernel_arg_237301};
                int64_t time_start_237292 = 0, time_end_237293 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segscan_207097",
                            (long) sdiv_up64(partition_sizze_203667 * n_203572,
                                             segscan_group_sizze_207091 *
                                             (int64_t) 11), (long) 1, (long) 1,
                            (long) segscan_group_sizze_207091, (long) 1,
                            (long) 1, (int) (0 + (shared_sizze_237294 + (8 -
                                                                         shared_sizze_237294 %
                                                                         8) %
                                                  8)));
                    time_start_237292 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegscan_207097_runs,
                                              &ctx->mainzisegscan_207097_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_207097,
                                                      grid[0], grid[1], grid[2],
                                                      segscan_group_sizze_207091,
                                                      1, 1, 0 +
                                                      (shared_sizze_237294 +
                                                       (8 -
                                                        shared_sizze_237294 %
                                                        8) % 8), NULL,
                                                      kernel_args_237291,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237293 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segscan_207097", time_end_237293 -
                            time_start_237292);
                }
            }
            if (memblock_unref_device(ctx, &incprefixes_mem_232521,
                                      "incprefixes_mem_232521") != 0)
                return 1;
            if (memblock_unref_device(ctx, &aggregates_mem_232519,
                                      "aggregates_mem_232519") != 0)
                return 1;
            if (memblock_unref_device(ctx, &status_flags_mem_232517,
                                      "status_flags_mem_232517") != 0)
                return 1;
        }
        
        struct memblock_device mem_229298;
        
        mem_229298.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229298, bytes_229285,
                                  "mem_229298")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i64(ctx, mem_229298,
                                          partition_sizze_203667 * n_203572,
                                          (int64_t) -1) != 0) {
            if (memblock_unref_device(ctx, &mem_229298, "mem_229298") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                return 1;
            if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t segmap_usable_groups_207131 = sdiv_up64(nest_sizze_207090,
                                                        segmap_group_sizze_207130);
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237305 = mem_229269.mem;
        CUdeviceptr kernel_arg_237306 = mem_229294.mem;
        CUdeviceptr kernel_arg_237307 = mem_229298.mem;
        
        if ((((((1 && segmap_usable_groups_207131 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_207130 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_207131;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237302[] = {&ctx->global_failure, &n_203572,
                                          &partition_sizze_203667,
                                          &kernel_arg_237305,
                                          &kernel_arg_237306,
                                          &kernel_arg_237307};
            int64_t time_start_237303 = 0, time_end_237304 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_207135",
                        (long) segmap_usable_groups_207131, (long) 1, (long) 1,
                        (long) segmap_group_sizze_207130, (long) 1, (long) 1,
                        (int) 0);
                time_start_237303 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_207135_runs,
                                          &ctx->mainzisegmap_207135_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_207135,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_207130, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237302, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237304 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_207135", time_end_237304 -
                        time_start_237303);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        struct memblock_device mem_229302;
        
        mem_229302.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229302, bytes_229288,
                                  "mem_229302")) {
            err = 1;
            goto cleanup;
        }
        
        int64_t group_sizze_232641;
        
        group_sizze_232641 = *ctx->tuning_params.mainzigroup_sizze_232641;
        
        int64_t num_groups_232642 = sdiv_up64(partition_sizze_203667,
                                              group_sizze_232641);
        CUdeviceptr kernel_arg_237311 = mem_229294.mem;
        CUdeviceptr kernel_arg_237312 = mem_229302.mem;
        
        if ((((((1 && num_groups_232642 != 0) && 1 != 0) && 1 != 0) &&
              group_sizze_232641 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = num_groups_232642;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237308[] = {&n_203572, &partition_sizze_203667,
                                          &i_203760, &kernel_arg_237311,
                                          &kernel_arg_237312};
            int64_t time_start_237309 = 0, time_end_237310 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.copy_232638", (long) num_groups_232642, (long) 1,
                        (long) 1, (long) group_sizze_232641, (long) 1, (long) 1,
                        (int) 0);
                time_start_237309 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzicopy_232638_runs,
                                          &ctx->mainzicopy_232638_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_232638,
                                                  grid[0], grid[1], grid[2],
                                                  group_sizze_232641, 1, 1, 0,
                                                  NULL, kernel_args_237308,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237310 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.copy_232638", time_end_237310 -
                        time_start_237309);
            }
        }
        if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229305, &mem_229298,
                                "mem_229298") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229304, &mem_229302,
                                "mem_229302") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229302, "mem_229302") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229298, "mem_229298") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229294, "mem_229294") != 0)
            return 1;
    }
    
    bool bounds_invalid_upwards_203788 = slt64(defunc_0_f_res_203721,
                                               (int64_t) 0);
    bool valid_203789 = !bounds_invalid_upwards_203788;
    bool range_valid_c_203790;
    
    if (!valid_203789) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) defunc_0_f_res_203721,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:119:20-125:36\n   #4  /prelude/soacs.fut:59:3-10\n   #5  /prelude/array.fut:195:3-17\n   #6  utils.fut:6:3-16\n   #7  stl.fut:117:12-126:20\n   #8  stl.fut:116:5-127:11\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207252 = n_p_203574 * defunc_0_f_res_203721;
    int64_t nest_sizze_207253 = partition_sizze_203667 * y_207252;
    int64_t segmap_group_sizze_207254;
    
    segmap_group_sizze_207254 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207172;
    
    int64_t segmap_usable_groups_207255 = sdiv_up64(nest_sizze_207253,
                                                    segmap_group_sizze_207254);
    struct memblock_device mem_229308;
    
    mem_229308.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229308, bytes_229241, "mem_229308")) {
        err = 1;
        goto cleanup;
    }
    {
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda, &ctx->copy_dev_to_dev_runs,
                                      &ctx->copy_dev_to_dev_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuMemcpy(mem_229308.mem + (int64_t) 0,
                                        mem_229269.mem + (int64_t) 0, m_203571 *
                                        n_203572 * (int64_t) 8));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
    }
    
    int64_t binop_x_229310 = n_p_203574 * partition_sizze_203667;
    int64_t binop_x_229311 = defunc_0_f_res_203721 * binop_x_229310;
    int64_t binop_y_229312 = (int64_t) 8 * binop_x_229311;
    int64_t bytes_229313 = smax64((int64_t) 0, binop_y_229312);
    struct memblock_device mem_229314;
    
    mem_229314.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229314, bytes_229313, "mem_229314")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    
    CUdeviceptr kernel_arg_237316 = mem_229308.mem;
    CUdeviceptr kernel_arg_237317 = mem_229314.mem;
    
    if ((((((1 && segmap_usable_groups_207255 != 0) && 1 != 0) && 1 != 0) &&
          segmap_group_sizze_207254 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[1] = perm[0];
            perm[0] = 1;
        }
        if (1 >= 1 << 16) {
            perm[2] = perm[0];
            perm[0] = 2;
        }
        
        size_t grid[3];
        
        grid[perm[0]] = segmap_usable_groups_207255;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_237313[] = {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203572,
                                      &n_p_203574, &partition_sizze_203667,
                                      &defunc_0_f_res_203721, &i_203760,
                                      &kernel_arg_237316, &kernel_arg_237317};
        int64_t time_start_237314 = 0, time_end_237315 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                    "main.segmap_207260", (long) segmap_usable_groups_207255,
                    (long) 1, (long) 1, (long) segmap_group_sizze_207254,
                    (long) 1, (long) 1, (int) 0);
            time_start_237314 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->mainzisegmap_207260_runs,
                                      &ctx->mainzisegmap_207260_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_207260, grid[0],
                                              grid[1], grid[2],
                                              segmap_group_sizze_207254, 1, 1,
                                              0, NULL, kernel_args_237313,
                                              NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_237315 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "main.segmap_207260", time_end_237315 - time_start_237314);
        }
    }
    ctx->failure_is_an_option = 1;
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
        return 1;
    
    int64_t i_203808 = sub64(defunc_0_f_res_203721, (int64_t) 1);
    bool x_203809 = sle64((int64_t) 0, i_203808);
    bool y_203810 = slt64(i_203808, defunc_0_f_res_203721);
    bool bounds_check_203811 = x_203809 && y_203810;
    bool index_certs_203812;
    
    if (!bounds_check_203811) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203808,
                               "] out of bounds for array of shape [",
                               (long long) defunc_0_f_res_203721, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  stl.fut:133:51-67\n   #3  stl.fut:132:12-135:21\n   #4  stl.fut:131:5-136:16\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207325 = smin64(n_p_203574, y_207252);
    int64_t intra_avail_par_207326 = smin64(y_207252, y_207325);
    int64_t computed_group_sizze_207277 = smax64(n_p_203574, y_207252);
    bool fits_207333 = sle64(computed_group_sizze_207277,
                             max_group_sizze_206977);
    bool suff_intra_par_207331;
    
    suff_intra_par_207331 = *ctx->tuning_params.mainzisuff_intra_par_1 <=
        intra_avail_par_207326;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_1",
                (long) intra_avail_par_207326,
                suff_intra_par_207331 ? "true" : "false");
    
    bool intra_suff_and_fits_207334 = suff_intra_par_207331 && fits_207333;
    bool fits_207604 = sle64(defunc_0_f_res_203721, max_group_sizze_206977);
    bool suff_intra_par_207606;
    
    suff_intra_par_207606 = *ctx->tuning_params.mainzisuff_intra_par_2 <=
        defunc_0_f_res_203721;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_2",
                (long) defunc_0_f_res_203721,
                suff_intra_par_207606 ? "true" : "false");
    
    bool intra_suff_and_fits_207607 = fits_207604 && suff_intra_par_207606;
    int64_t segscan_group_sizze_207642;
    
    segscan_group_sizze_207642 =
        *ctx->tuning_params.mainzisegscan_group_sizze_207509;
    
    int64_t num_groups_207643;
    int32_t max_num_groups_232660;
    
    max_num_groups_232660 = *ctx->tuning_params.mainzisegscan_num_groups_207511;
    num_groups_207643 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229311,
                                                             segscan_group_sizze_207642),
                                                   sext_i32_i64(max_num_groups_232660))));
    
    int64_t segmap_group_sizze_207689;
    
    segmap_group_sizze_207689 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207440;
    
    int64_t binop_y_229332 = (int64_t) 8 * binop_x_229310;
    int64_t bytes_229333 = smax64((int64_t) 0, binop_y_229332);
    int64_t binop_y_229318 = (int64_t) 8 * y_207252;
    int64_t bytes_229319 = smax64((int64_t) 0, binop_y_229318);
    int64_t binop_y_229337 = (int64_t) 8 * defunc_0_f_res_203721;
    int64_t bytes_229338 = smax64((int64_t) 0, binop_y_229337);
    struct memblock_device ext_mem_229373;
    
    ext_mem_229373.references = NULL;
    
    struct memblock_device ext_mem_229372;
    
    ext_mem_229372.references = NULL;
    
    int32_t local_memory_capacity_232852;
    
    local_memory_capacity_232852 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229319 + srem64((int64_t) 8 - srem64(bytes_229319,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229319 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229319,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232852)) &&
        intra_suff_and_fits_207334) {
        struct memblock_device mem_229330;
        
        mem_229330.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229330, bytes_229313,
                                  "mem_229330")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229334;
        
        mem_229334.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229334, bytes_229333,
                                  "mem_229334")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237321 = bytes_229319;
        unsigned int shared_sizze_237323 = bytes_229319;
        CUdeviceptr kernel_arg_237325 = mem_229314.mem;
        CUdeviceptr kernel_arg_237326 = mem_229330.mem;
        CUdeviceptr kernel_arg_237327 = mem_229334.mem;
        unsigned int shared_offset_237322 = 0;
        unsigned int shared_offset_237324 = 0 + (shared_sizze_237321 + (8 -
                                                                        shared_sizze_237321 %
                                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_207277 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = partition_sizze_203667;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237318[] = {&ctx->global_failure,
                                          &shared_offset_237322,
                                          &shared_offset_237324, &n_p_203574,
                                          &partition_sizze_203667,
                                          &defunc_0_f_res_203721, &i_203808,
                                          &computed_group_sizze_207277,
                                          &kernel_arg_237325,
                                          &kernel_arg_237326,
                                          &kernel_arg_237327};
            int64_t time_start_237319 = 0, time_end_237320 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_intragroup_207338",
                        (long) partition_sizze_203667, (long) 1, (long) 1,
                        (long) computed_group_sizze_207277, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237321 + (8 -
                                                           shared_sizze_237321 %
                                                           8) % 8) +
                               (shared_sizze_237323 + (8 - shared_sizze_237323 %
                                                       8) % 8)));
                time_start_237319 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_207338_runs,
                                          &ctx->mainzisegmap_intragroup_207338_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_207338,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_207277,
                                                  1, 1, 0 +
                                                  (shared_sizze_237321 + (8 -
                                                                          shared_sizze_237321 %
                                                                          8) %
                                                   8) + (shared_sizze_237323 +
                                                         (8 -
                                                          shared_sizze_237323 %
                                                          8) % 8), NULL,
                                                  kernel_args_237318, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237320 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207338", time_end_237320 -
                        time_start_237319);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229373, &mem_229330,
                                "mem_229330") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229372, &mem_229334,
                                "mem_229334") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229334, "mem_229334") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229330, "mem_229330") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229371;
        
        ext_mem_229371.references = NULL;
        
        struct memblock_device ext_mem_229370;
        
        ext_mem_229370.references = NULL;
        
        int32_t local_memory_capacity_232851;
        
        local_memory_capacity_232851 = ctx->cuda.max_shared_memory;
        if (sle64(bytes_229338 + srem64((int64_t) 8 - srem64(bytes_229338,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229338 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229338,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232851)) &&
            intra_suff_and_fits_207607) {
            struct memblock_device mem_229348;
            
            mem_229348.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229348, bytes_229313,
                                      "mem_229348")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229352;
            
            mem_229352.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229352, bytes_229333,
                                      "mem_229352")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            unsigned int shared_sizze_237331 = bytes_229338;
            unsigned int shared_sizze_237333 = bytes_229338;
            CUdeviceptr kernel_arg_237335 = mem_229314.mem;
            CUdeviceptr kernel_arg_237336 = mem_229348.mem;
            CUdeviceptr kernel_arg_237337 = mem_229352.mem;
            unsigned int shared_offset_237332 = 0;
            unsigned int shared_offset_237334 = 0 + (shared_sizze_237331 + (8 -
                                                                            shared_sizze_237331 %
                                                                            8) %
                                                     8);
            
            if ((((((1 && binop_x_229310 != 0) && 1 != 0) && 1 != 0) &&
                  defunc_0_f_res_203721 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = binop_x_229310;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237328[] = {&ctx->global_failure,
                                              &shared_offset_237332,
                                              &shared_offset_237334,
                                              &n_p_203574,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721, &i_203808,
                                              &kernel_arg_237335,
                                              &kernel_arg_237336,
                                              &kernel_arg_237337};
                int64_t time_start_237329 = 0, time_end_237330 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_intragroup_207614",
                            (long) binop_x_229310, (long) 1, (long) 1,
                            (long) defunc_0_f_res_203721, (long) 1, (long) 1,
                            (int) (0 + (shared_sizze_237331 + (8 -
                                                               shared_sizze_237331 %
                                                               8) % 8) +
                                   (shared_sizze_237333 + (8 -
                                                           shared_sizze_237333 %
                                                           8) % 8)));
                    time_start_237329 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_intragroup_207614_runs,
                                              &ctx->mainzisegmap_intragroup_207614_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_207614,
                                                      grid[0], grid[1], grid[2],
                                                      defunc_0_f_res_203721, 1,
                                                      1, 0 +
                                                      (shared_sizze_237331 +
                                                       (8 -
                                                        shared_sizze_237331 %
                                                        8) % 8) +
                                                      (shared_sizze_237333 +
                                                       (8 -
                                                        shared_sizze_237333 %
                                                        8) % 8), NULL,
                                                      kernel_args_237328,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237330 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_207614", time_end_237330 -
                            time_start_237329);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229371, &mem_229348,
                                    "mem_229348") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229370, &mem_229352,
                                    "mem_229352") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229352, "mem_229352") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229348, "mem_229348") != 0)
                return 1;
        } else {
            struct memblock_device mem_229358;
            
            mem_229358.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229358, bytes_229313,
                                      "mem_229358")) {
                err = 1;
                goto cleanup;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 * n_p_203574 *
                      defunc_0_f_res_203721)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: number of elements processed sequentially per thread is m:",
                            (long long) 11, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: memory constraints is: ", (long long) 11,
                            '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: register constraints is: ",
                            (long long) 15, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "SegScan: sumT' is: ",
                            (long long) 2, '\n');
                
                int64_t numThreads_232720 = sdiv_up64(partition_sizze_203667 *
                                                      n_p_203574 *
                                                      defunc_0_f_res_203721,
                                                      segscan_group_sizze_207642 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_207642;
                int64_t numGroups_232721 = sdiv_up64(partition_sizze_203667 *
                                                     n_p_203574 *
                                                     defunc_0_f_res_203721,
                                                     segscan_group_sizze_207642 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_232722 =
                                       ctx->mainziid_counter_mem_232722;
                struct memblock_device status_flags_mem_232724;
                
                status_flags_mem_232724.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_232724,
                                          numGroups_232721,
                                          "status_flags_mem_232724")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_232726;
                
                aggregates_mem_232726.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_232726,
                                          (int64_t) 8 * numGroups_232721,
                                          "aggregates_mem_232726")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_232728;
                
                incprefixes_mem_232728.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_232728,
                                          (int64_t) 8 * numGroups_232721,
                                          "incprefixes_mem_232728")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_232724,
                                                 numGroups_232721,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_232728,
                                              "incprefixes_mem_232728") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_232726,
                                              "aggregates_mem_232726") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_232724,
                                              "status_flags_mem_232724") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229358, "mem_229358") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229370,
                                              "ext_mem_229370") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229371,
                                              "ext_mem_229371") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_237342 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_207642),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_207642 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_237344 = mem_229314.mem;
                CUdeviceptr kernel_arg_237345 = mem_229358.mem;
                CUdeviceptr kernel_arg_237346 = mainziid_counter_mem_232722.mem;
                CUdeviceptr kernel_arg_237347 = status_flags_mem_232724.mem;
                CUdeviceptr kernel_arg_237348 = aggregates_mem_232726.mem;
                CUdeviceptr kernel_arg_237349 = incprefixes_mem_232728.mem;
                unsigned int shared_offset_237343 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203667 * n_p_203574 *
                                        defunc_0_f_res_203721,
                                        segscan_group_sizze_207642 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_207642 != 0) && 1 != 0) && 1 !=
                    0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = sdiv_up64(partition_sizze_203667 *
                                              n_p_203574 *
                                              defunc_0_f_res_203721,
                                              segscan_group_sizze_207642 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_237339[] = {&ctx->global_failure,
                                                  &shared_offset_237343,
                                                  &n_p_203574,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &kernel_arg_237344,
                                                  &kernel_arg_237345,
                                                  &kernel_arg_237346,
                                                  &kernel_arg_237347,
                                                  &kernel_arg_237348,
                                                  &kernel_arg_237349};
                    int64_t time_start_237340 = 0, time_end_237341 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segscan_207649",
                                (long) sdiv_up64(partition_sizze_203667 *
                                                 n_p_203574 *
                                                 defunc_0_f_res_203721,
                                                 segscan_group_sizze_207642 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_207642,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_237342 +
                                                            (8 -
                                                             shared_sizze_237342 %
                                                             8) % 8)));
                        time_start_237340 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_207649_runs,
                                                  &ctx->mainzisegscan_207649_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_207649,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_207642,
                                                          1, 1, 0 +
                                                          (shared_sizze_237342 +
                                                           (8 -
                                                            shared_sizze_237342 %
                                                            8) % 8), NULL,
                                                          kernel_args_237339,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_237341 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_207649", time_end_237341 -
                                time_start_237340);
                    }
                }
                if (memblock_unref_device(ctx, &incprefixes_mem_232728,
                                          "incprefixes_mem_232728") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_232726,
                                          "aggregates_mem_232726") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_232724,
                                          "status_flags_mem_232724") != 0)
                    return 1;
            }
            
            struct memblock_device mem_229363;
            
            mem_229363.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229363, bytes_229313,
                                      "mem_229363")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i64(ctx, mem_229363,
                                              partition_sizze_203667 *
                                              n_p_203574 *
                                              defunc_0_f_res_203721,
                                              (int64_t) -1) != 0) {
                if (memblock_unref_device(ctx, &mem_229363, "mem_229363") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229358, "mem_229358") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229370,
                                          "ext_mem_229370") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229371,
                                          "ext_mem_229371") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229372,
                                          "ext_mem_229372") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229373,
                                          "ext_mem_229373") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segmap_usable_groups_207690 = sdiv_up64(nest_sizze_207253,
                                                            segmap_group_sizze_207689);
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237353 = mem_229314.mem;
            CUdeviceptr kernel_arg_237354 = mem_229358.mem;
            CUdeviceptr kernel_arg_237355 = mem_229363.mem;
            
            if ((((((1 && segmap_usable_groups_207690 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_207689 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_207690;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237350[] = {&ctx->global_failure, &n_p_203574,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &kernel_arg_237353,
                                              &kernel_arg_237354,
                                              &kernel_arg_237355};
                int64_t time_start_237351 = 0, time_end_237352 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_207695",
                            (long) segmap_usable_groups_207690, (long) 1,
                            (long) 1, (long) segmap_group_sizze_207689,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237351 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_207695_runs,
                                              &ctx->mainzisegmap_207695_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_207695,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_207689,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237350,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237352 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_207695", time_end_237352 -
                            time_start_237351);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device mem_229368;
            
            mem_229368.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229368, bytes_229333,
                                      "mem_229368")) {
                err = 1;
                goto cleanup;
            }
            
            int64_t group_sizze_232842;
            
            group_sizze_232842 = *ctx->tuning_params.mainzigroup_sizze_232842;
            
            int64_t num_groups_232843 = sdiv_up64(partition_sizze_203667 *
                                                  n_p_203574,
                                                  group_sizze_232842);
            CUdeviceptr kernel_arg_237359 = mem_229358.mem;
            CUdeviceptr kernel_arg_237360 = mem_229368.mem;
            
            if ((((((1 && num_groups_232843 != 0) && 1 != 0) && 1 != 0) &&
                  group_sizze_232842 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = num_groups_232843;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237356[] = {&n_p_203574,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721, &i_203808,
                                              &kernel_arg_237359,
                                              &kernel_arg_237360};
                int64_t time_start_237357 = 0, time_end_237358 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.copy_232839", (long) num_groups_232843,
                            (long) 1, (long) 1, (long) group_sizze_232842,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237357 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzicopy_232839_runs,
                                              &ctx->mainzicopy_232839_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_232839,
                                                      grid[0], grid[1], grid[2],
                                                      group_sizze_232842, 1, 1,
                                                      0, NULL,
                                                      kernel_args_237356,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237358 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.copy_232839", time_end_237358 -
                            time_start_237357);
                }
            }
            if (memblock_unref_device(ctx, &mem_229358, "mem_229358") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229371, &mem_229363,
                                    "mem_229363") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229370, &mem_229368,
                                    "mem_229368") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229368, "mem_229368") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229363, "mem_229363") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229358, "mem_229358") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229373, &ext_mem_229371,
                                "ext_mem_229371") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229372, &ext_mem_229370,
                                "ext_mem_229370") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229370, "ext_mem_229370") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229371, "ext_mem_229371") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
        return 1;
    
    int64_t min_res_203839 = smin64(q_s_203575, defunc_0_f_res_203721);
    bool bounds_invalid_upwards_203840 = slt64(s_n_m_203726, (int64_t) 0);
    bool valid_203841 = !bounds_invalid_upwards_203840;
    bool range_valid_c_203842;
    
    if (!valid_203841) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) s_n_m_203726, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:517:15-50\n   #5  stl.fut:142:20-80\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:141:12-143:40\n   #9  /prelude/soacs.fut:67:19-23\n   #10 /prelude/soacs.fut:67:3-37\n   #11 stl.fut:140:5-144:36\n   #12 stl.fut:415:61-429:75\n   #13 stl.fut:455:3-469:34\n   #14 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203844 = slt64((int64_t) 1, min_res_203839);
    double i64_res_203845 = sitofp_i64_f64(q_s_203575);
    int64_t one_intra_par_min_207850 = n_p_203574 * s_n_m_203726;
    int64_t y_207853 = smin64(n_p_203574, one_intra_par_min_207850);
    int64_t intra_avail_par_207854 = smin64(y_207252, y_207853);
    int64_t y_207855 = smax64(n_p_203574, one_intra_par_min_207850);
    int64_t computed_group_sizze_207709 = smax64(y_207252, y_207855);
    bool fits_207862 = sle64(computed_group_sizze_207709,
                             max_group_sizze_206977);
    bool suff_intra_par_207860;
    
    suff_intra_par_207860 = *ctx->tuning_params.mainzisuff_intra_par_3 <=
        intra_avail_par_207854;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_3",
                (long) intra_avail_par_207854,
                suff_intra_par_207860 ? "true" : "false");
    
    bool intra_suff_and_fits_207863 = suff_intra_par_207860 && fits_207862;
    int64_t intra_avail_par_208756 = smin64(defunc_0_f_res_203721,
                                            s_n_m_203726);
    int64_t computed_group_sizze_208757 = smax64(defunc_0_f_res_203721,
                                                 s_n_m_203726);
    bool fits_208761 = sle64(computed_group_sizze_208757,
                             max_group_sizze_206977);
    bool suff_intra_par_208763;
    
    suff_intra_par_208763 = *ctx->tuning_params.mainzisuff_intra_par_4 <=
        intra_avail_par_208756;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_4",
                (long) intra_avail_par_208756,
                suff_intra_par_208763 ? "true" : "false");
    
    bool intra_suff_and_fits_208764 = fits_208761 && suff_intra_par_208763;
    int64_t segmap_group_sizze_208902;
    
    segmap_group_sizze_208902 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208565;
    
    int64_t segmap_group_sizze_208914;
    
    segmap_group_sizze_208914 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208534;
    
    int64_t nest_sizze_208938 = partition_sizze_203667 *
            one_intra_par_min_207850;
    int64_t segmap_group_sizze_208939;
    
    segmap_group_sizze_208939 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208295;
    
    int64_t binop_x_229403 = s_n_m_203726 * binop_x_229310;
    int64_t binop_y_229404 = (int64_t) 8 * binop_x_229403;
    int64_t bytes_229405 = smax64((int64_t) 0, binop_y_229404);
    int64_t binop_y_229381 = (int64_t) 8 * n_p_203574;
    int64_t bytes_229382 = smax64((int64_t) 0, binop_y_229381);
    int64_t binop_y_229395 = (int64_t) 8 * one_intra_par_min_207850;
    int64_t bytes_229396 = smax64((int64_t) 0, binop_y_229395);
    int64_t binop_y_229418 = (int64_t) 8 * s_n_m_203726;
    int64_t bytes_229419 = smax64((int64_t) 0, binop_y_229418);
    struct memblock_device ext_mem_229471;
    
    ext_mem_229471.references = NULL;
    
    struct memblock_device ext_mem_229470;
    
    ext_mem_229470.references = NULL;
    
    int32_t local_memory_capacity_232954;
    
    local_memory_capacity_232954 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229396 + srem64((int64_t) 8 - srem64(bytes_229396,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229396 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229396,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229382 + srem64((int64_t) 8 - srem64(bytes_229382,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229382 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229382,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229382 + srem64((int64_t) 8 - srem64(bytes_229382,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229382 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229382,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229319 + srem64((int64_t) 8 - srem64(bytes_229319,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232954)) &&
        intra_suff_and_fits_207863) {
        struct memblock_device mem_229406;
        
        mem_229406.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229406, bytes_229405,
                                  "mem_229406")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229411;
        
        mem_229411.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229411, bytes_229405,
                                  "mem_229411")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237364 = bytes_229319;
        unsigned int shared_sizze_237366 = bytes_229382;
        unsigned int shared_sizze_237368 = bytes_229382;
        unsigned int shared_sizze_237370 = bytes_229382;
        unsigned int shared_sizze_237372 = bytes_229382;
        unsigned int shared_sizze_237374 = bytes_229396;
        unsigned int shared_sizze_237376 = bytes_229396;
        CUdeviceptr kernel_arg_237378 = ext_mem_229372.mem;
        CUdeviceptr kernel_arg_237379 = ext_mem_229373.mem;
        CUdeviceptr kernel_arg_237380 = mem_229406.mem;
        CUdeviceptr kernel_arg_237381 = mem_229411.mem;
        unsigned int shared_offset_237365 = 0;
        unsigned int shared_offset_237367 = 0 + (shared_sizze_237364 + (8 -
                                                                        shared_sizze_237364 %
                                                                        8) % 8);
        unsigned int shared_offset_237369 = 0 + (shared_sizze_237364 + (8 -
                                                                        shared_sizze_237364 %
                                                                        8) %
                                                 8) + (shared_sizze_237366 +
                                                       (8 -
                                                        shared_sizze_237366 %
                                                        8) % 8);
        unsigned int shared_offset_237371 = 0 + (shared_sizze_237364 + (8 -
                                                                        shared_sizze_237364 %
                                                                        8) %
                                                 8) + (shared_sizze_237366 +
                                                       (8 -
                                                        shared_sizze_237366 %
                                                        8) % 8) +
                     (shared_sizze_237368 + (8 - shared_sizze_237368 % 8) % 8);
        unsigned int shared_offset_237373 = 0 + (shared_sizze_237364 + (8 -
                                                                        shared_sizze_237364 %
                                                                        8) %
                                                 8) + (shared_sizze_237366 +
                                                       (8 -
                                                        shared_sizze_237366 %
                                                        8) % 8) +
                     (shared_sizze_237368 + (8 - shared_sizze_237368 % 8) % 8) +
                     (shared_sizze_237370 + (8 - shared_sizze_237370 % 8) % 8);
        unsigned int shared_offset_237375 = 0 + (shared_sizze_237364 + (8 -
                                                                        shared_sizze_237364 %
                                                                        8) %
                                                 8) + (shared_sizze_237366 +
                                                       (8 -
                                                        shared_sizze_237366 %
                                                        8) % 8) +
                     (shared_sizze_237368 + (8 - shared_sizze_237368 % 8) % 8) +
                     (shared_sizze_237370 + (8 - shared_sizze_237370 % 8) % 8) +
                     (shared_sizze_237372 + (8 - shared_sizze_237372 % 8) % 8);
        unsigned int shared_offset_237377 = 0 + (shared_sizze_237364 + (8 -
                                                                        shared_sizze_237364 %
                                                                        8) %
                                                 8) + (shared_sizze_237366 +
                                                       (8 -
                                                        shared_sizze_237366 %
                                                        8) % 8) +
                     (shared_sizze_237368 + (8 - shared_sizze_237368 % 8) % 8) +
                     (shared_sizze_237370 + (8 - shared_sizze_237370 % 8) % 8) +
                     (shared_sizze_237372 + (8 - shared_sizze_237372 % 8) % 8) +
                     (shared_sizze_237374 + (8 - shared_sizze_237374 % 8) % 8);
        
        if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_207709 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = partition_sizze_203667;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237361[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237365,
                                          &shared_offset_237367,
                                          &shared_offset_237369,
                                          &shared_offset_237371,
                                          &shared_offset_237373,
                                          &shared_offset_237375,
                                          &shared_offset_237377, &n_p_203574,
                                          &q_s_203575, &jump_s_203581,
                                          &partition_sizze_203667,
                                          &defunc_0_f_res_203721,
                                          &pad_css_len_203722, &s_n_m_203726,
                                          &i_203808, &x_203809, &min_res_203839,
                                          &loop_cond_203844, &i64_res_203845,
                                          &computed_group_sizze_207709,
                                          &kernel_arg_237378,
                                          &kernel_arg_237379,
                                          &kernel_arg_237380,
                                          &kernel_arg_237381};
            int64_t time_start_237362 = 0, time_end_237363 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_intragroup_207867",
                        (long) partition_sizze_203667, (long) 1, (long) 1,
                        (long) computed_group_sizze_207709, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237364 + (8 -
                                                           shared_sizze_237364 %
                                                           8) % 8) +
                               (shared_sizze_237366 + (8 - shared_sizze_237366 %
                                                       8) % 8) +
                               (shared_sizze_237368 + (8 - shared_sizze_237368 %
                                                       8) % 8) +
                               (shared_sizze_237370 + (8 - shared_sizze_237370 %
                                                       8) % 8) +
                               (shared_sizze_237372 + (8 - shared_sizze_237372 %
                                                       8) % 8) +
                               (shared_sizze_237374 + (8 - shared_sizze_237374 %
                                                       8) % 8) +
                               (shared_sizze_237376 + (8 - shared_sizze_237376 %
                                                       8) % 8)));
                time_start_237362 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_207867_runs,
                                          &ctx->mainzisegmap_intragroup_207867_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_207867,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_207709,
                                                  1, 1, 0 +
                                                  (shared_sizze_237364 + (8 -
                                                                          shared_sizze_237364 %
                                                                          8) %
                                                   8) + (shared_sizze_237366 +
                                                         (8 -
                                                          shared_sizze_237366 %
                                                          8) % 8) +
                                                  (shared_sizze_237368 + (8 -
                                                                          shared_sizze_237368 %
                                                                          8) %
                                                   8) + (shared_sizze_237370 +
                                                         (8 -
                                                          shared_sizze_237370 %
                                                          8) % 8) +
                                                  (shared_sizze_237372 + (8 -
                                                                          shared_sizze_237372 %
                                                                          8) %
                                                   8) + (shared_sizze_237374 +
                                                         (8 -
                                                          shared_sizze_237374 %
                                                          8) % 8) +
                                                  (shared_sizze_237376 + (8 -
                                                                          shared_sizze_237376 %
                                                                          8) %
                                                   8), NULL, kernel_args_237361,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237363 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207867", time_end_237363 -
                        time_start_237362);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229471, &mem_229406,
                                "mem_229406") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229470, &mem_229411,
                                "mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229411, "mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229406, "mem_229406") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229469;
        
        ext_mem_229469.references = NULL;
        
        struct memblock_device ext_mem_229468;
        
        ext_mem_229468.references = NULL;
        
        int32_t local_memory_capacity_232953;
        
        local_memory_capacity_232953 = ctx->cuda.max_shared_memory;
        if (sle64(bytes_229419 + srem64((int64_t) 8 - srem64(bytes_229419,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229419 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229419,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)) +
                  (bytes_229338 + srem64((int64_t) 8 - srem64(bytes_229338,
                                                              (int64_t) 8),
                                         (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232953)) &&
            intra_suff_and_fits_208764) {
            struct memblock_device mem_229428;
            
            mem_229428.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229428, bytes_229405,
                                      "mem_229428")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229433;
            
            mem_229433.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229433, bytes_229405,
                                      "mem_229433")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            unsigned int shared_sizze_237385 = bytes_229338;
            unsigned int shared_sizze_237387 = bytes_229419;
            unsigned int shared_sizze_237389 = bytes_229419;
            CUdeviceptr kernel_arg_237391 = ext_mem_229372.mem;
            CUdeviceptr kernel_arg_237392 = ext_mem_229373.mem;
            CUdeviceptr kernel_arg_237393 = mem_229428.mem;
            CUdeviceptr kernel_arg_237394 = mem_229433.mem;
            unsigned int shared_offset_237386 = 0;
            unsigned int shared_offset_237388 = 0 + (shared_sizze_237385 + (8 -
                                                                            shared_sizze_237385 %
                                                                            8) %
                                                     8);
            unsigned int shared_offset_237390 = 0 + (shared_sizze_237385 + (8 -
                                                                            shared_sizze_237385 %
                                                                            8) %
                                                     8) + (shared_sizze_237387 +
                                                           (8 -
                                                            shared_sizze_237387 %
                                                            8) % 8);
            
            if ((((((1 && binop_x_229310 != 0) && 1 != 0) && 1 != 0) &&
                  computed_group_sizze_208757 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = binop_x_229310;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237382[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &shared_offset_237386,
                                              &shared_offset_237388,
                                              &shared_offset_237390,
                                              &n_p_203574, &q_s_203575,
                                              &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726, &i_203808,
                                              &x_203809, &min_res_203839,
                                              &loop_cond_203844,
                                              &i64_res_203845,
                                              &computed_group_sizze_208757,
                                              &kernel_arg_237391,
                                              &kernel_arg_237392,
                                              &kernel_arg_237393,
                                              &kernel_arg_237394};
                int64_t time_start_237383 = 0, time_end_237384 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_intragroup_208771",
                            (long) binop_x_229310, (long) 1, (long) 1,
                            (long) computed_group_sizze_208757, (long) 1,
                            (long) 1, (int) (0 + (shared_sizze_237385 + (8 -
                                                                         shared_sizze_237385 %
                                                                         8) %
                                                  8) + (shared_sizze_237387 +
                                                        (8 -
                                                         shared_sizze_237387 %
                                                         8) % 8) +
                                             (shared_sizze_237389 + (8 -
                                                                     shared_sizze_237389 %
                                                                     8) % 8)));
                    time_start_237383 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_intragroup_208771_runs,
                                              &ctx->mainzisegmap_intragroup_208771_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_208771,
                                                      grid[0], grid[1], grid[2],
                                                      computed_group_sizze_208757,
                                                      1, 1, 0 +
                                                      (shared_sizze_237385 +
                                                       (8 -
                                                        shared_sizze_237385 %
                                                        8) % 8) +
                                                      (shared_sizze_237387 +
                                                       (8 -
                                                        shared_sizze_237387 %
                                                        8) % 8) +
                                                      (shared_sizze_237389 +
                                                       (8 -
                                                        shared_sizze_237389 %
                                                        8) % 8), NULL,
                                                      kernel_args_237382,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237384 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_208771", time_end_237384 -
                            time_start_237383);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229469, &mem_229428,
                                    "mem_229428") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229468, &mem_229433,
                                    "mem_229433") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229433, "mem_229433") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229428, "mem_229428") != 0)
                return 1;
        } else {
            int64_t segmap_usable_groups_208903 = sdiv_up64(nest_sizze_207253,
                                                            segmap_group_sizze_208902);
            struct memblock_device mem_229439;
            
            mem_229439.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229439, bytes_229313,
                                      "mem_229439")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237398 = ext_mem_229373.mem;
            CUdeviceptr kernel_arg_237399 = mem_229439.mem;
            
            if ((((((1 && segmap_usable_groups_208903 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_208902 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_208903;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237395[] = {&ctx->global_failure, &n_p_203574,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &kernel_arg_237398,
                                              &kernel_arg_237399};
                int64_t time_start_237396 = 0, time_end_237397 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_208908",
                            (long) segmap_usable_groups_208903, (long) 1,
                            (long) 1, (long) segmap_group_sizze_208902,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237396 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_208908_runs,
                                              &ctx->mainzisegmap_208908_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_208908,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_208902,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237395,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237397 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_208908", time_end_237397 -
                            time_start_237396);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208915 = sdiv_up64(binop_x_229310,
                                                            segmap_group_sizze_208914);
            struct memblock_device mem_229444;
            
            mem_229444.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229444, bytes_229333,
                                      "mem_229444")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229448;
            
            mem_229448.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229448, bytes_229333,
                                      "mem_229448")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229452;
            
            mem_229452.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229452, bytes_229333,
                                      "mem_229452")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229456;
            
            mem_229456.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229456, bytes_229333,
                                      "mem_229456")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237403 = ext_mem_229372.mem;
            CUdeviceptr kernel_arg_237404 = mem_229444.mem;
            CUdeviceptr kernel_arg_237405 = mem_229448.mem;
            CUdeviceptr kernel_arg_237406 = mem_229452.mem;
            CUdeviceptr kernel_arg_237407 = mem_229456.mem;
            
            if ((((((1 && segmap_usable_groups_208915 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_208914 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_208915;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237400[] = {&ctx->global_failure, &n_p_203574,
                                              &q_s_203575,
                                              &partition_sizze_203667,
                                              &min_res_203839, &i64_res_203845,
                                              &kernel_arg_237403,
                                              &kernel_arg_237404,
                                              &kernel_arg_237405,
                                              &kernel_arg_237406,
                                              &kernel_arg_237407};
                int64_t time_start_237401 = 0, time_end_237402 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_208922",
                            (long) segmap_usable_groups_208915, (long) 1,
                            (long) 1, (long) segmap_group_sizze_208914,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237401 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_208922_runs,
                                              &ctx->mainzisegmap_208922_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_208922,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_208914,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237400,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237402 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_208922", time_end_237402 -
                            time_start_237401);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208940 = sdiv_up64(nest_sizze_208938,
                                                            segmap_group_sizze_208939);
            struct memblock_device mem_229462;
            
            mem_229462.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229462, bytes_229405,
                                      "mem_229462")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229467;
            
            mem_229467.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229467, bytes_229405,
                                      "mem_229467")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237411 = mem_229439.mem;
            CUdeviceptr kernel_arg_237412 = mem_229444.mem;
            CUdeviceptr kernel_arg_237413 = mem_229448.mem;
            CUdeviceptr kernel_arg_237414 = mem_229452.mem;
            CUdeviceptr kernel_arg_237415 = mem_229456.mem;
            CUdeviceptr kernel_arg_237416 = mem_229462.mem;
            CUdeviceptr kernel_arg_237417 = mem_229467.mem;
            
            if ((((((1 && segmap_usable_groups_208940 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_208939 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_208940;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237408[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &n_p_203574, &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726, &i_203808,
                                              &x_203809, &min_res_203839,
                                              &loop_cond_203844,
                                              &kernel_arg_237411,
                                              &kernel_arg_237412,
                                              &kernel_arg_237413,
                                              &kernel_arg_237414,
                                              &kernel_arg_237415,
                                              &kernel_arg_237416,
                                              &kernel_arg_237417};
                int64_t time_start_237409 = 0, time_end_237410 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_208946",
                            (long) segmap_usable_groups_208940, (long) 1,
                            (long) 1, (long) segmap_group_sizze_208939,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237409 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_208946_runs,
                                              &ctx->mainzisegmap_208946_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_208946,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_208939,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237408,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237410 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_208946", time_end_237410 -
                            time_start_237409);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_229439, "mem_229439") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229448, "mem_229448") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229452, "mem_229452") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229456, "mem_229456") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229469, &mem_229467,
                                    "mem_229467") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229468, &mem_229462,
                                    "mem_229462") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229467, "mem_229467") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229462, "mem_229462") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229456, "mem_229456") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229452, "mem_229452") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229448, "mem_229448") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229439, "mem_229439") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229471, &ext_mem_229469,
                                "ext_mem_229469") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229470, &ext_mem_229468,
                                "ext_mem_229468") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229468, "ext_mem_229468") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229469, "ext_mem_229469") != 0)
            return 1;
    }
    
    int64_t min_res_203971 = smin64(n_203572, q_l_203577);
    bool bounds_invalid_upwards_203972 = slt64(l_n_m_203733, (int64_t) 0);
    bool valid_203973 = !bounds_invalid_upwards_203972;
    bool range_valid_c_203974;
    
    if (!valid_203973) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) l_n_m_203733, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:503:15-61\n   #5  stl.fut:150:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:148:5-151:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203976 = slt64((int64_t) 1, min_res_203971);
    double i64_res_203977 = sitofp_i64_f64(q_l_203577);
    int64_t intra_avail_par_209161 = smin64(n_203572, l_n_m_203733);
    int64_t computed_group_sizze_209063 = smax64(n_203572, l_n_m_203733);
    bool fits_209167 = sle64(computed_group_sizze_209063,
                             max_group_sizze_206977);
    bool suff_intra_par_209165;
    
    suff_intra_par_209165 = *ctx->tuning_params.mainzisuff_intra_par_5 <=
        intra_avail_par_209161;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_5",
                (long) intra_avail_par_209161,
                suff_intra_par_209165 ? "true" : "false");
    
    bool intra_suff_and_fits_209168 = suff_intra_par_209165 && fits_209167;
    int64_t segmap_group_sizze_209551;
    
    segmap_group_sizze_209551 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209527;
    
    int64_t segmap_group_sizze_209561;
    
    segmap_group_sizze_209561 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209501;
    
    int64_t nest_sizze_209582 = partition_sizze_203667 * l_n_m_203733;
    int64_t segmap_group_sizze_209583;
    
    segmap_group_sizze_209583 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209297;
    
    int64_t binop_y_229485 = (int64_t) 8 * nest_sizze_209582;
    int64_t bytes_229486 = smax64((int64_t) 0, binop_y_229485);
    int64_t binop_y_229478 = (int64_t) 8 * l_n_m_203733;
    int64_t bytes_229479 = smax64((int64_t) 0, binop_y_229478);
    struct memblock_device ext_mem_229520;
    
    ext_mem_229520.references = NULL;
    
    struct memblock_device ext_mem_229519;
    
    ext_mem_229519.references = NULL;
    
    int32_t local_memory_capacity_233014;
    
    local_memory_capacity_233014 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229479 + srem64((int64_t) 8 - srem64(bytes_229479,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229479 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229479,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_233014)) &&
        intra_suff_and_fits_209168) {
        struct memblock_device mem_229487;
        
        mem_229487.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229487, bytes_229486,
                                  "mem_229487")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229491;
        
        mem_229491.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229491, bytes_229486,
                                  "mem_229491")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237421 = bytes_229277;
        unsigned int shared_sizze_237423 = bytes_229479;
        unsigned int shared_sizze_237425 = bytes_229479;
        CUdeviceptr kernel_arg_237427 = ext_mem_229304.mem;
        CUdeviceptr kernel_arg_237428 = ext_mem_229305.mem;
        CUdeviceptr kernel_arg_237429 = mem_229487.mem;
        CUdeviceptr kernel_arg_237430 = mem_229491.mem;
        unsigned int shared_offset_237422 = 0;
        unsigned int shared_offset_237424 = 0 + (shared_sizze_237421 + (8 -
                                                                        shared_sizze_237421 %
                                                                        8) % 8);
        unsigned int shared_offset_237426 = 0 + (shared_sizze_237421 + (8 -
                                                                        shared_sizze_237421 %
                                                                        8) %
                                                 8) + (shared_sizze_237423 +
                                                       (8 -
                                                        shared_sizze_237423 %
                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_209063 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = partition_sizze_203667;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237418[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237422,
                                          &shared_offset_237424,
                                          &shared_offset_237426, &n_203572,
                                          &q_l_203577, &jump_l_203583,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760, &x_203761,
                                          &min_res_203971, &loop_cond_203976,
                                          &i64_res_203977,
                                          &computed_group_sizze_209063,
                                          &kernel_arg_237427,
                                          &kernel_arg_237428,
                                          &kernel_arg_237429,
                                          &kernel_arg_237430};
            int64_t time_start_237419 = 0, time_end_237420 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_intragroup_209172",
                        (long) partition_sizze_203667, (long) 1, (long) 1,
                        (long) computed_group_sizze_209063, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237421 + (8 -
                                                           shared_sizze_237421 %
                                                           8) % 8) +
                               (shared_sizze_237423 + (8 - shared_sizze_237423 %
                                                       8) % 8) +
                               (shared_sizze_237425 + (8 - shared_sizze_237425 %
                                                       8) % 8)));
                time_start_237419 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_209172_runs,
                                          &ctx->mainzisegmap_intragroup_209172_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_209172,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_209063,
                                                  1, 1, 0 +
                                                  (shared_sizze_237421 + (8 -
                                                                          shared_sizze_237421 %
                                                                          8) %
                                                   8) + (shared_sizze_237423 +
                                                         (8 -
                                                          shared_sizze_237423 %
                                                          8) % 8) +
                                                  (shared_sizze_237425 + (8 -
                                                                          shared_sizze_237425 %
                                                                          8) %
                                                   8), NULL, kernel_args_237418,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237420 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209172", time_end_237420 -
                        time_start_237419);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229520, &mem_229487,
                                "mem_229487") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229519, &mem_229491,
                                "mem_229491") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229491, "mem_229491") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229487, "mem_229487") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_209552 = sdiv_up64(nest_sizze_207090,
                                                        segmap_group_sizze_209551);
        struct memblock_device mem_229496;
        
        mem_229496.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229496, bytes_229285,
                                  "mem_229496")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237434 = ext_mem_229305.mem;
        CUdeviceptr kernel_arg_237435 = mem_229496.mem;
        
        if ((((((1 && segmap_usable_groups_209552 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_209551 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_209552;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237431[] = {&ctx->global_failure, &n_203572,
                                          &partition_sizze_203667,
                                          &kernel_arg_237434,
                                          &kernel_arg_237435};
            int64_t time_start_237432 = 0, time_end_237433 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_209556",
                        (long) segmap_usable_groups_209552, (long) 1, (long) 1,
                        (long) segmap_group_sizze_209551, (long) 1, (long) 1,
                        (int) 0);
                time_start_237432 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_209556_runs,
                                          &ctx->mainzisegmap_209556_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_209556,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_209551, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237431, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237433 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_209556", time_end_237433 -
                        time_start_237432);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209562 = sdiv_up64(partition_sizze_203667,
                                                        segmap_group_sizze_209561);
        struct memblock_device mem_229500;
        
        mem_229500.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229500, bytes_229288,
                                  "mem_229500")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229503;
        
        mem_229503.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229503, bytes_229288,
                                  "mem_229503")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229506;
        
        mem_229506.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229506, bytes_229288,
                                  "mem_229506")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229509;
        
        mem_229509.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229509, bytes_229288,
                                  "mem_229509")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237439 = ext_mem_229304.mem;
        CUdeviceptr kernel_arg_237440 = mem_229500.mem;
        CUdeviceptr kernel_arg_237441 = mem_229503.mem;
        CUdeviceptr kernel_arg_237442 = mem_229506.mem;
        CUdeviceptr kernel_arg_237443 = mem_229509.mem;
        
        if ((((((1 && segmap_usable_groups_209562 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_209561 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_209562;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237436[] = {&ctx->global_failure, &q_l_203577,
                                          &partition_sizze_203667,
                                          &min_res_203971, &i64_res_203977,
                                          &kernel_arg_237439,
                                          &kernel_arg_237440,
                                          &kernel_arg_237441,
                                          &kernel_arg_237442,
                                          &kernel_arg_237443};
            int64_t time_start_237437 = 0, time_end_237438 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_209568",
                        (long) segmap_usable_groups_209562, (long) 1, (long) 1,
                        (long) segmap_group_sizze_209561, (long) 1, (long) 1,
                        (int) 0);
                time_start_237437 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_209568_runs,
                                          &ctx->mainzisegmap_209568_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_209568,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_209561, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237436, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237438 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_209568", time_end_237438 -
                        time_start_237437);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209584 = sdiv_up64(nest_sizze_209582,
                                                        segmap_group_sizze_209583);
        struct memblock_device mem_229514;
        
        mem_229514.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229514, bytes_229486,
                                  "mem_229514")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229518;
        
        mem_229518.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229518, bytes_229486,
                                  "mem_229518")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237447 = ext_mem_229305.mem;
        CUdeviceptr kernel_arg_237448 = mem_229496.mem;
        CUdeviceptr kernel_arg_237449 = mem_229500.mem;
        CUdeviceptr kernel_arg_237450 = mem_229503.mem;
        CUdeviceptr kernel_arg_237451 = mem_229506.mem;
        CUdeviceptr kernel_arg_237452 = mem_229509.mem;
        CUdeviceptr kernel_arg_237453 = mem_229514.mem;
        CUdeviceptr kernel_arg_237454 = mem_229518.mem;
        
        if ((((((1 && segmap_usable_groups_209584 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_209583 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_209584;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237444[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args, &n_203572,
                                          &jump_l_203583,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760, &x_203761,
                                          &min_res_203971, &loop_cond_203976,
                                          &kernel_arg_237447,
                                          &kernel_arg_237448,
                                          &kernel_arg_237449,
                                          &kernel_arg_237450,
                                          &kernel_arg_237451,
                                          &kernel_arg_237452,
                                          &kernel_arg_237453,
                                          &kernel_arg_237454};
            int64_t time_start_237445 = 0, time_end_237446 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_209589",
                        (long) segmap_usable_groups_209584, (long) 1, (long) 1,
                        (long) segmap_group_sizze_209583, (long) 1, (long) 1,
                        (int) 0);
                time_start_237445 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_209589_runs,
                                          &ctx->mainzisegmap_209589_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_209589,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_209583, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237444, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237446 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_209589", time_end_237446 -
                        time_start_237445);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229496, "mem_229496") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229500, "mem_229500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229503, "mem_229503") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229506, "mem_229506") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229509, "mem_229509") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229520, &mem_229518,
                                "mem_229518") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229519, &mem_229514,
                                "mem_229514") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229518, "mem_229518") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229514, "mem_229514") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229509, "mem_229509") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229506, "mem_229506") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229503, "mem_229503") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229500, "mem_229500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229496, "mem_229496") != 0)
            return 1;
    }
    
    int64_t min_res_204083 = smin64(n_203572, q_t_203576);
    bool bounds_invalid_upwards_204084 = slt64(t_n_m_203740, (int64_t) 0);
    bool valid_204085 = !bounds_invalid_upwards_204084;
    bool range_valid_c_204086;
    
    if (!valid_204085) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) t_n_m_203740, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:443:3-470:10\n   #4  loess.fut:503:15-61\n   #5  stl.fut:157:13-60\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:155:5-158:26\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_204088 = slt64((int64_t) 1, min_res_204083);
    double i64_res_204089 = sitofp_i64_f64(q_t_203576);
    int64_t intra_avail_par_209787 = smin64(n_203572, t_n_m_203740);
    int64_t computed_group_sizze_209689 = smax64(n_203572, t_n_m_203740);
    bool fits_209793 = sle64(computed_group_sizze_209689,
                             max_group_sizze_206977);
    bool suff_intra_par_209791;
    
    suff_intra_par_209791 = *ctx->tuning_params.mainzisuff_intra_par_6 <=
        intra_avail_par_209787;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_6",
                (long) intra_avail_par_209787,
                suff_intra_par_209791 ? "true" : "false");
    
    bool intra_suff_and_fits_209794 = suff_intra_par_209791 && fits_209793;
    int64_t segmap_group_sizze_210177;
    
    segmap_group_sizze_210177 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210153;
    
    int64_t segmap_group_sizze_210187;
    
    segmap_group_sizze_210187 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210127;
    
    int64_t nest_sizze_210208 = partition_sizze_203667 * t_n_m_203740;
    int64_t segmap_group_sizze_210209;
    
    segmap_group_sizze_210209 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209923;
    
    int64_t binop_y_229534 = (int64_t) 8 * nest_sizze_210208;
    int64_t bytes_229535 = smax64((int64_t) 0, binop_y_229534);
    int64_t binop_y_229527 = (int64_t) 8 * t_n_m_203740;
    int64_t bytes_229528 = smax64((int64_t) 0, binop_y_229527);
    struct memblock_device ext_mem_229569;
    
    ext_mem_229569.references = NULL;
    
    struct memblock_device ext_mem_229568;
    
    ext_mem_229568.references = NULL;
    
    int32_t local_memory_capacity_233074;
    
    local_memory_capacity_233074 = ctx->cuda.max_shared_memory;
    if (sle64(bytes_229528 + srem64((int64_t) 8 - srem64(bytes_229528,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229528 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229528,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_233074)) &&
        intra_suff_and_fits_209794) {
        struct memblock_device mem_229536;
        
        mem_229536.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229536, bytes_229535,
                                  "mem_229536")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229540;
        
        mem_229540.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229540, bytes_229535,
                                  "mem_229540")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        unsigned int shared_sizze_237458 = bytes_229277;
        unsigned int shared_sizze_237460 = bytes_229528;
        unsigned int shared_sizze_237462 = bytes_229528;
        CUdeviceptr kernel_arg_237464 = ext_mem_229304.mem;
        CUdeviceptr kernel_arg_237465 = ext_mem_229305.mem;
        CUdeviceptr kernel_arg_237466 = mem_229536.mem;
        CUdeviceptr kernel_arg_237467 = mem_229540.mem;
        unsigned int shared_offset_237459 = 0;
        unsigned int shared_offset_237461 = 0 + (shared_sizze_237458 + (8 -
                                                                        shared_sizze_237458 %
                                                                        8) % 8);
        unsigned int shared_offset_237463 = 0 + (shared_sizze_237458 + (8 -
                                                                        shared_sizze_237458 %
                                                                        8) %
                                                 8) + (shared_sizze_237460 +
                                                       (8 -
                                                        shared_sizze_237460 %
                                                        8) % 8);
        
        if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) && 1 != 0) &&
              computed_group_sizze_209689 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = partition_sizze_203667;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237455[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args,
                                          &shared_offset_237459,
                                          &shared_offset_237461,
                                          &shared_offset_237463, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760, &x_203761,
                                          &min_res_204083, &loop_cond_204088,
                                          &i64_res_204089,
                                          &computed_group_sizze_209689,
                                          &kernel_arg_237464,
                                          &kernel_arg_237465,
                                          &kernel_arg_237466,
                                          &kernel_arg_237467};
            int64_t time_start_237456 = 0, time_end_237457 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_intragroup_209798",
                        (long) partition_sizze_203667, (long) 1, (long) 1,
                        (long) computed_group_sizze_209689, (long) 1, (long) 1,
                        (int) (0 + (shared_sizze_237458 + (8 -
                                                           shared_sizze_237458 %
                                                           8) % 8) +
                               (shared_sizze_237460 + (8 - shared_sizze_237460 %
                                                       8) % 8) +
                               (shared_sizze_237462 + (8 - shared_sizze_237462 %
                                                       8) % 8)));
                time_start_237456 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_intragroup_209798_runs,
                                          &ctx->mainzisegmap_intragroup_209798_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_209798,
                                                  grid[0], grid[1], grid[2],
                                                  computed_group_sizze_209689,
                                                  1, 1, 0 +
                                                  (shared_sizze_237458 + (8 -
                                                                          shared_sizze_237458 %
                                                                          8) %
                                                   8) + (shared_sizze_237460 +
                                                         (8 -
                                                          shared_sizze_237460 %
                                                          8) % 8) +
                                                  (shared_sizze_237462 + (8 -
                                                                          shared_sizze_237462 %
                                                                          8) %
                                                   8), NULL, kernel_args_237455,
                                                  NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237457 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209798", time_end_237457 -
                        time_start_237456);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229569, &mem_229536,
                                "mem_229536") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229568, &mem_229540,
                                "mem_229540") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229540, "mem_229540") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229536, "mem_229536") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_210178 = sdiv_up64(nest_sizze_207090,
                                                        segmap_group_sizze_210177);
        struct memblock_device mem_229545;
        
        mem_229545.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229545, bytes_229285,
                                  "mem_229545")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237471 = ext_mem_229305.mem;
        CUdeviceptr kernel_arg_237472 = mem_229545.mem;
        
        if ((((((1 && segmap_usable_groups_210178 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_210177 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_210178;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237468[] = {&ctx->global_failure, &n_203572,
                                          &partition_sizze_203667,
                                          &kernel_arg_237471,
                                          &kernel_arg_237472};
            int64_t time_start_237469 = 0, time_end_237470 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_210182",
                        (long) segmap_usable_groups_210178, (long) 1, (long) 1,
                        (long) segmap_group_sizze_210177, (long) 1, (long) 1,
                        (int) 0);
                time_start_237469 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_210182_runs,
                                          &ctx->mainzisegmap_210182_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210182,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_210177, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237468, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237470 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_210182", time_end_237470 -
                        time_start_237469);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210188 = sdiv_up64(partition_sizze_203667,
                                                        segmap_group_sizze_210187);
        struct memblock_device mem_229549;
        
        mem_229549.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229549, bytes_229288,
                                  "mem_229549")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229552;
        
        mem_229552.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229552, bytes_229288,
                                  "mem_229552")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229555;
        
        mem_229555.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229555, bytes_229288,
                                  "mem_229555")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229558;
        
        mem_229558.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229558, bytes_229288,
                                  "mem_229558")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237476 = ext_mem_229304.mem;
        CUdeviceptr kernel_arg_237477 = mem_229549.mem;
        CUdeviceptr kernel_arg_237478 = mem_229552.mem;
        CUdeviceptr kernel_arg_237479 = mem_229555.mem;
        CUdeviceptr kernel_arg_237480 = mem_229558.mem;
        
        if ((((((1 && segmap_usable_groups_210188 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_210187 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_210188;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237473[] = {&ctx->global_failure, &q_t_203576,
                                          &partition_sizze_203667,
                                          &min_res_204083, &i64_res_204089,
                                          &kernel_arg_237476,
                                          &kernel_arg_237477,
                                          &kernel_arg_237478,
                                          &kernel_arg_237479,
                                          &kernel_arg_237480};
            int64_t time_start_237474 = 0, time_end_237475 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_210194",
                        (long) segmap_usable_groups_210188, (long) 1, (long) 1,
                        (long) segmap_group_sizze_210187, (long) 1, (long) 1,
                        (int) 0);
                time_start_237474 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_210194_runs,
                                          &ctx->mainzisegmap_210194_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210194,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_210187, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237473, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237475 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_210194", time_end_237475 -
                        time_start_237474);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210210 = sdiv_up64(nest_sizze_210208,
                                                        segmap_group_sizze_210209);
        struct memblock_device mem_229563;
        
        mem_229563.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229563, bytes_229535,
                                  "mem_229563")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229567;
        
        mem_229567.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229567, bytes_229535,
                                  "mem_229567")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        
        CUdeviceptr kernel_arg_237484 = ext_mem_229305.mem;
        CUdeviceptr kernel_arg_237485 = mem_229545.mem;
        CUdeviceptr kernel_arg_237486 = mem_229549.mem;
        CUdeviceptr kernel_arg_237487 = mem_229552.mem;
        CUdeviceptr kernel_arg_237488 = mem_229555.mem;
        CUdeviceptr kernel_arg_237489 = mem_229558.mem;
        CUdeviceptr kernel_arg_237490 = mem_229563.mem;
        CUdeviceptr kernel_arg_237491 = mem_229567.mem;
        
        if ((((((1 && segmap_usable_groups_210210 != 0) && 1 != 0) && 1 != 0) &&
              segmap_group_sizze_210209 != 0) && 1 != 0) && 1 != 0) {
            int perm[3] = {0, 1, 2};
            
            if (1 >= 1 << 16) {
                perm[1] = perm[0];
                perm[0] = 1;
            }
            if (1 >= 1 << 16) {
                perm[2] = perm[0];
                perm[0] = 2;
            }
            
            size_t grid[3];
            
            grid[perm[0]] = segmap_usable_groups_210210;
            grid[perm[1]] = 1;
            grid[perm[2]] = 1;
            
            void *kernel_args_237481[] = {&ctx->global_failure,
                                          &ctx->failure_is_an_option,
                                          &ctx->global_failure_args, &n_203572,
                                          &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760, &x_203761,
                                          &min_res_204083, &loop_cond_204088,
                                          &kernel_arg_237484,
                                          &kernel_arg_237485,
                                          &kernel_arg_237486,
                                          &kernel_arg_237487,
                                          &kernel_arg_237488,
                                          &kernel_arg_237489,
                                          &kernel_arg_237490,
                                          &kernel_arg_237491};
            int64_t time_start_237482 = 0, time_end_237483 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                        "main.segmap_210215",
                        (long) segmap_usable_groups_210210, (long) 1, (long) 1,
                        (long) segmap_group_sizze_210209, (long) 1, (long) 1,
                        (int) 0);
                time_start_237482 = get_wall_time();
            }
            
            cudaEvent_t *pevents = NULL;
            
            if (ctx->profiling && !ctx->profiling_paused) {
                pevents = cuda_get_events(&ctx->cuda,
                                          &ctx->mainzisegmap_210215_runs,
                                          &ctx->mainzisegmap_210215_total_runtime);
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
            }
            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210215,
                                                  grid[0], grid[1], grid[2],
                                                  segmap_group_sizze_210209, 1,
                                                  1, 0, NULL,
                                                  kernel_args_237481, NULL));
            if (pevents != NULL)
                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
            if (ctx->debugging) {
                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                time_end_237483 = get_wall_time();
                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                        "main.segmap_210215", time_end_237483 -
                        time_start_237482);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229545, "mem_229545") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229549, "mem_229549") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229552, "mem_229552") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229555, "mem_229555") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229558, "mem_229558") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229569, &mem_229567,
                                "mem_229567") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229568, &mem_229563,
                                "mem_229563") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229567, "mem_229567") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229563, "mem_229563") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229558, "mem_229558") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229555, "mem_229555") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229552, "mem_229552") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229549, "mem_229549") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229545, "mem_229545") != 0)
            return 1;
    }
    
    struct memblock_device mem_229573;
    
    mem_229573.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229573, bytes_229285, "mem_229573")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229573, partition_sizze_203667 *
                                      n_203572, 0.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229577;
    
    mem_229577.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229577, bytes_229285, "mem_229577")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229577, partition_sizze_203667 *
                                      n_203572, 1.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204197 = slt64((int64_t) 1, jump_l_203583);
    bool cond_204198 = slt64((int64_t) 1, jump_t_203582);
    int64_t y_204199 = sub64(n_outer_203585, (int64_t) 1);
    int64_t css_results_l_204200;
    
    if (cond_203725) {
        css_results_l_204200 = s_n_m_203726;
    } else {
        css_results_l_204200 = pad_css_len_203722;
    }
    
    bool zzero_204201 = n_p_203574 == (int64_t) 0;
    bool nonzzero_204202 = !zzero_204201;
    bool loop_not_taken_204203 = !assert_cond_203716;
    bool protect_assert_disj_204204 = nonzzero_204202 || loop_not_taken_204203;
    bool loop_not_taken_204205 = !assert_cond_203718;
    bool protect_assert_disj_204206 = protect_assert_disj_204204 ||
         loop_not_taken_204205;
    bool nonzzero_cert_204207;
    
    if (!protect_assert_disj_204206) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "division by zero",
                               "-> #0  stl.fut:226:51-57\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  stl.fut:226:28-74\n   #5  stl.fut:225:21-227:39\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_204208 = add64(n_203572, n_p_203574);
    bool empty_slice_204209 = n_203572 == (int64_t) 0;
    int64_t i_p_m_t_s_204210 = add64(n_p_203574, i_203760);
    bool zzero_leq_i_p_m_t_s_204211 = sle64((int64_t) 0, i_p_m_t_s_204210);
    bool i_p_m_t_s_leq_w_204212 = slt64(i_p_m_t_s_204210, C_len_203724);
    bool zzero_lte_i_204213 = sle64((int64_t) 0, n_p_203574);
    bool i_lte_j_204214 = sle64(n_p_203574, j_204208);
    bool y_204215 = i_p_m_t_s_leq_w_204212 && zzero_lte_i_204213;
    bool y_204216 = zzero_leq_i_p_m_t_s_204211 && y_204215;
    bool y_204217 = i_lte_j_204214 && y_204216;
    bool forwards_ok_204218 = zzero_lte_i_204213 && y_204217;
    bool ok_or_empty_204219 = empty_slice_204209 || forwards_ok_204218;
    bool protect_assert_disj_204220 = loop_not_taken_204203 ||
         ok_or_empty_204219;
    bool protect_assert_disj_204221 = loop_not_taken_204205 ||
         protect_assert_disj_204220;
    bool index_certs_204222;
    
    if (!protect_assert_disj_204221) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) n_p_203574, ":",
                               (long long) j_204208,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203724, "].",
                               "-> #0  stl.fut:262:35-50\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  stl.fut:260:13-265:26\n   #4  stl.fut:415:61-429:75\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_m_i_204223 = sub64(stl_res_203755, stl_res_203754);
    int64_t lifted_single_ma_l_arg_204224 = add64((int64_t) 1, j_204208);
    int64_t m_204225 = sub64(n_p_203574, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_204226 = sle64((int64_t) 0, m_204225);
    bool i_p_m_t_s_leq_w_204227 = slt64(m_204225, C_len_203724);
    bool y_204228 = zzero_leq_i_p_m_t_s_204226 && i_p_m_t_s_leq_w_204227;
    bool y_204229 = zzero_lte_i_204213 && y_204228;
    bool ok_or_empty_204230 = zzero_204201 || y_204229;
    bool protect_assert_disj_204231 = loop_not_taken_204203 ||
         ok_or_empty_204230;
    bool protect_assert_disj_204232 = loop_not_taken_204205 ||
         protect_assert_disj_204231;
    bool index_certs_204233;
    
    if (!protect_assert_disj_204232) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203574,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203724, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  stl.fut:38:3-36\n   #3  stl.fut:231:23-47\n   #4  stl.fut:415:61-429:75\n   #5  stl.fut:455:3-469:34\n   #6  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t dyn_lifted_single_ma_l_arg_204234 = add64((int64_t) 2, n_203572);
    bool i_p_m_t_s_leq_w_204235 = slt64(m_204225,
                                        lifted_single_ma_l_arg_204224);
    bool y_204236 = zzero_leq_i_p_m_t_s_204226 && i_p_m_t_s_leq_w_204235;
    bool y_204237 = zzero_lte_i_204213 && y_204236;
    bool ok_or_empty_204238 = zzero_204201 || y_204237;
    bool protect_assert_disj_204239 = loop_not_taken_204203 ||
         ok_or_empty_204238;
    bool protect_assert_disj_204240 = loop_not_taken_204205 ||
         protect_assert_disj_204239;
    bool index_certs_204241;
    
    if (!protect_assert_disj_204240) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203574,
                               "] out of bounds for array of shape [",
                               (long long) lifted_single_ma_l_arg_204224, "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-64\n   #4  stl.fut:231:23-47\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool i_p_m_t_s_leq_w_204242 = slt64((int64_t) 2,
                                        dyn_lifted_single_ma_l_arg_204234);
    bool protect_assert_disj_204243 = loop_not_taken_204203 ||
         i_p_m_t_s_leq_w_204242;
    bool protect_assert_disj_204244 = loop_not_taken_204205 ||
         protect_assert_disj_204243;
    bool index_certs_204245;
    
    if (!protect_assert_disj_204244) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) (int64_t) 3,
                               "] out of bounds for array of shape [",
                               (long long) dyn_lifted_single_ma_l_arg_204234,
                               "].",
                               "-> #0  stl.fut:24:37-43\n   #1  stl.fut:24:20-48\n   #2  /prelude/functional.fut:9:42-44\n   #3  stl.fut:38:3-84\n   #4  stl.fut:231:23-47\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204246 = slt64(jump_l_203583, jump_threshold_203586);
    bool cond_f_res_204247 = slt64(q_threshold_203587, q_l_203577);
    bool x_204248 = !cond_204246;
    bool y_204249 = cond_f_res_204247 && x_204248;
    bool cond_204250 = cond_204246 || y_204249;
    bool cond_204251 = slt64(jump_t_203582, jump_threshold_203586);
    bool cond_f_res_204252 = slt64(q_threshold_203587, q_t_203576);
    bool x_204253 = !cond_204251;
    bool y_204254 = cond_f_res_204252 && x_204253;
    bool cond_204255 = cond_204251 || y_204254;
    bool cond_204256 = slt64(jump_s_203581, jump_threshold_203586);
    bool cond_f_res_204257 = slt64(q_threshold_203587, q_s_203575);
    bool x_204258 = !cond_204256;
    bool y_204259 = cond_f_res_204257 && x_204258;
    bool cond_204260 = cond_204256 || y_204259;
    bool bounds_invalid_upwards_204261 = slt64(C_len_203724, (int64_t) 0);
    bool valid_204262 = !bounds_invalid_upwards_204261;
    bool protect_assert_disj_204263 = loop_not_taken_204203 || valid_204262;
    bool protect_assert_disj_204264 = loop_not_taken_204205 ||
         protect_assert_disj_204263;
    bool range_valid_c_204265;
    
    if (!protect_assert_disj_204264) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) C_len_203724, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:226:28-74\n   #4  stl.fut:225:21-227:39\n   #5  stl.fut:415:61-429:75\n   #6  stl.fut:455:3-469:34\n   #7  stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204267 = slt64(lifted_single_ma_l_arg_204224,
                                               (int64_t) 0);
    bool valid_204268 = !bounds_invalid_upwards_204267;
    bool protect_assert_disj_204269 = loop_not_taken_204203 || valid_204268;
    bool protect_assert_disj_204270 = loop_not_taken_204205 ||
         protect_assert_disj_204269;
    bool range_valid_c_204271;
    
    if (!protect_assert_disj_204270) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) lifted_single_ma_l_arg_204224,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  stl.fut:38:3-36\n   #8  stl.fut:231:23-47\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204273 =
         slt64(dyn_lifted_single_ma_l_arg_204234, (int64_t) 0);
    bool valid_204274 = !bounds_invalid_upwards_204273;
    bool protect_assert_disj_204275 = loop_not_taken_204203 || valid_204274;
    bool protect_assert_disj_204276 = loop_not_taken_204205 ||
         protect_assert_disj_204275;
    bool range_valid_c_204277;
    
    if (!protect_assert_disj_204276) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) dyn_lifted_single_ma_l_arg_204234,
                               " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  stl.fut:27:13-33:19\n   #4  /prelude/soacs.fut:67:19-23\n   #5  /prelude/soacs.fut:67:3-37\n   #6  stl.fut:26:5-34:23\n   #7  /prelude/functional.fut:9:42-44\n   #8  stl.fut:38:3-64\n   #9  stl.fut:231:23-47\n   #10 stl.fut:415:61-429:75\n   #11 stl.fut:455:3-469:34\n   #12 stl.fut:439:1-469:34\n");
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_210352;
    
    segmap_group_sizze_210352 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210326;
    
    int64_t segmap_usable_groups_210353 = sdiv_up_safe64(nest_sizze_207090,
                                                         segmap_group_sizze_210352);
    int64_t segmap_group_sizze_210495;
    
    segmap_group_sizze_210495 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210389;
    
    int64_t segmap_usable_groups_210496 = sdiv_up_safe64(nest_sizze_207253,
                                                         segmap_group_sizze_210495);
    int64_t nest_sizze_218646 = partition_sizze_203667 * C_len_203724;
    int64_t segmap_group_sizze_218647;
    
    segmap_group_sizze_218647 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218601;
    
    int64_t segmap_usable_groups_218648 = sdiv_up_safe64(nest_sizze_218646,
                                                         segmap_group_sizze_218647);
    bool suff_outer_par_218668;
    
    suff_outer_par_218668 = *ctx->tuning_params.mainzisuff_outer_par_19 <=
        partition_sizze_203667;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_19",
                (long) partition_sizze_203667,
                suff_outer_par_218668 ? "true" : "false");
    
    int64_t segmap_group_sizze_218684;
    
    segmap_group_sizze_218684 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218672;
    
    int64_t segred_group_sizze_218715;
    
    segred_group_sizze_218715 =
        *ctx->tuning_params.mainzisegred_group_sizze_218698;
    
    int64_t num_groups_218716;
    int32_t max_num_groups_233087;
    
    max_num_groups_233087 = *ctx->tuning_params.mainzisegred_num_groups_218700;
    num_groups_218716 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229310,
                                                             segred_group_sizze_218715),
                                                   sext_i32_i64(max_num_groups_233087))));
    
    int64_t nest_sizze_218766 = partition_sizze_203667 *
            lifted_single_ma_l_arg_204224;
    int64_t segscan_group_sizze_218767;
    
    segscan_group_sizze_218767 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218731;
    
    int64_t num_groups_218768;
    int32_t max_num_groups_233088;
    
    max_num_groups_233088 = *ctx->tuning_params.mainzisegscan_num_groups_218733;
    num_groups_218768 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218766,
                                                             segscan_group_sizze_218767),
                                                   sext_i32_i64(max_num_groups_233088))));
    
    bool suff_outer_par_218799;
    
    suff_outer_par_218799 = *ctx->tuning_params.mainzisuff_outer_par_20 <=
        partition_sizze_203667;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_20",
                (long) partition_sizze_203667,
                suff_outer_par_218799 ? "true" : "false");
    
    int64_t segmap_group_sizze_218815;
    
    segmap_group_sizze_218815 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218803;
    
    int64_t segred_group_sizze_218846;
    
    segred_group_sizze_218846 =
        *ctx->tuning_params.mainzisegred_group_sizze_218829;
    
    int64_t num_groups_218847;
    int32_t max_num_groups_233089;
    
    max_num_groups_233089 = *ctx->tuning_params.mainzisegred_num_groups_218831;
    num_groups_218847 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229310,
                                                             segred_group_sizze_218846),
                                                   sext_i32_i64(max_num_groups_233089))));
    
    int64_t nest_sizze_218897 = partition_sizze_203667 *
            dyn_lifted_single_ma_l_arg_204234;
    int64_t segscan_group_sizze_218898;
    
    segscan_group_sizze_218898 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218862;
    
    int64_t num_groups_218899;
    int32_t max_num_groups_233090;
    
    max_num_groups_233090 = *ctx->tuning_params.mainzisegscan_num_groups_218864;
    num_groups_218899 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218897,
                                                             segscan_group_sizze_218898),
                                                   sext_i32_i64(max_num_groups_233090))));
    
    bool suff_outer_par_218930;
    
    suff_outer_par_218930 = *ctx->tuning_params.mainzisuff_outer_par_21 <=
        partition_sizze_203667;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_21",
                (long) partition_sizze_203667,
                suff_outer_par_218930 ? "true" : "false");
    
    int64_t segmap_group_sizze_218946;
    
    segmap_group_sizze_218946 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218934;
    
    int64_t nest_sizze_218976 = (int64_t) 3 * partition_sizze_203667;
    int64_t segred_group_sizze_218977;
    
    segred_group_sizze_218977 =
        *ctx->tuning_params.mainzisegred_group_sizze_218960;
    
    int64_t num_groups_218978;
    int32_t max_num_groups_233091;
    
    max_num_groups_233091 = *ctx->tuning_params.mainzisegred_num_groups_218962;
    num_groups_218978 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218976,
                                                             segred_group_sizze_218977),
                                                   sext_i32_i64(max_num_groups_233091))));
    
    int64_t segscan_group_sizze_219029;
    
    segscan_group_sizze_219029 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218993;
    
    int64_t num_groups_219030;
    int32_t max_num_groups_233092;
    
    max_num_groups_233092 = *ctx->tuning_params.mainzisegscan_num_groups_218995;
    num_groups_219030 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207090,
                                                             segscan_group_sizze_219029),
                                                   sext_i32_i64(max_num_groups_233092))));
    
    int64_t segmap_group_sizze_222529;
    
    segmap_group_sizze_222529 =
        *ctx->tuning_params.mainzisegmap_group_sizze_222503;
    
    int64_t segmap_usable_groups_222530 = sdiv_up_safe64(nest_sizze_207090,
                                                         segmap_group_sizze_222529);
    int64_t segmap_usable_groups_218685 = sdiv_up_safe64(partition_sizze_203667,
                                                         segmap_group_sizze_218684);
    int64_t segmap_usable_groups_218816 = sdiv_up_safe64(partition_sizze_203667,
                                                         segmap_group_sizze_218815);
    int64_t segmap_usable_groups_218947 = sdiv_up_safe64(partition_sizze_203667,
                                                         segmap_group_sizze_218946);
    struct memblock_device mem_229628;
    
    mem_229628.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229628, bytes_229285, "mem_229628")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229634;
    
    mem_229634.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229634, bytes_229313, "mem_229634")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229639;
    
    mem_229639.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229639, bytes_229313, "mem_229639")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_x_230598 = pad_css_len_203722 * binop_x_229310;
    int64_t binop_y_230599 = (int64_t) 8 * binop_x_230598;
    int64_t bytes_230600 = smax64((int64_t) 0, binop_y_230599);
    int64_t binop_y_230606 = (int64_t) 8 * nest_sizze_218646;
    int64_t bytes_230607 = smax64((int64_t) 0, binop_y_230606);
    struct memblock_device mem_230608;
    
    mem_230608.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230608, bytes_230607, "mem_230608")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230623 = (int64_t) 8 * nest_sizze_218766;
    int64_t bytes_230624 = smax64((int64_t) 0, binop_y_230623);
    struct memblock_device mem_230625;
    
    mem_230625.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230625, bytes_230624, "mem_230625")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230640 = (int64_t) 8 * nest_sizze_218897;
    int64_t bytes_230641 = smax64((int64_t) 0, binop_y_230640);
    struct memblock_device mem_230642;
    
    mem_230642.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230642, bytes_230641, "mem_230642")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_230659;
    
    mem_230659.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230659, bytes_229285, "mem_230659")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t ext_231023;
    
    if (cond_204197) {
        ext_231023 = n_203572;
    } else {
        ext_231023 = l_n_m_203733;
    }
    
    int64_t ext_231620;
    
    if (cond_204198) {
        ext_231620 = n_203572;
    } else {
        ext_231620 = t_n_m_203740;
    }
    
    int64_t ext_231983;
    int64_t ext_231981;
    int64_t ext_231977;
    int64_t ext_231976;
    int64_t ext_231975;
    int64_t ext_231974;
    int64_t ext_231973;
    int64_t ext_231972;
    int64_t ext_231971;
    struct memblock_device ext_mem_231970;
    
    ext_mem_231970.references = NULL;
    
    struct memblock_device ext_mem_231969;
    
    ext_mem_231969.references = NULL;
    
    struct memblock_device ext_mem_231968;
    
    ext_mem_231968.references = NULL;
    
    struct memblock_device mem_param_229585;
    
    mem_param_229585.references = NULL;
    
    int64_t ctx_param_ext_229587;
    int64_t ctx_param_ext_229589;
    struct memblock_device mem_param_229593;
    
    mem_param_229593.references = NULL;
    
    int64_t ctx_param_ext_229594;
    int64_t ctx_param_ext_229595;
    int64_t ctx_param_ext_229596;
    int64_t ctx_param_ext_229597;
    int64_t ctx_param_ext_229598;
    int64_t ctx_param_ext_229599;
    int64_t ctx_param_ext_229600;
    struct memblock_device mem_param_229601;
    
    mem_param_229601.references = NULL;
    ctx_param_ext_229587 = n_203572;
    ctx_param_ext_229589 = n_203572;
    ctx_param_ext_229594 = partition_sizze_203667;
    ctx_param_ext_229595 = n_203572;
    ctx_param_ext_229596 = (int64_t) 0;
    ctx_param_ext_229597 = n_203572;
    ctx_param_ext_229598 = partition_sizze_203667;
    ctx_param_ext_229599 = (int64_t) 1;
    ctx_param_ext_229600 = n_203572;
    if (memblock_set_device(ctx, &mem_param_229585, &mem_229573,
                            "mem_229573") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229593, &mem_229573,
                            "mem_229573") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229601, &mem_229577,
                            "mem_229577") != 0)
        return 1;
    for (int64_t i_outer_204282 = 0; i_outer_204282 < n_outer_203585;
         i_outer_204282++) {
        int64_t ext_231632;
        int64_t ext_231630;
        struct memblock_device ext_mem_231626;
        
        ext_mem_231626.references = NULL;
        
        struct memblock_device ext_mem_231625;
        
        ext_mem_231625.references = NULL;
        
        struct memblock_device mem_param_229615;
        
        mem_param_229615.references = NULL;
        
        int64_t ctx_param_ext_229617;
        int64_t ctx_param_ext_229619;
        struct memblock_device mem_param_229623;
        
        mem_param_229623.references = NULL;
        ctx_param_ext_229617 = ctx_param_ext_229587;
        ctx_param_ext_229619 = ctx_param_ext_229589;
        if (memblock_set_device(ctx, &mem_param_229615, &mem_param_229585,
                                "mem_param_229585") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229623, &mem_param_229593,
                                "mem_param_229593") != 0)
            return 1;
        for (int64_t _i_inner_204288 = 0; _i_inner_204288 < n_inner_203584;
             _i_inner_204288++) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237495 = mem_229269.mem;
            CUdeviceptr kernel_arg_237496 = mem_param_229623.mem;
            CUdeviceptr kernel_arg_237497 = mem_229628.mem;
            
            if ((((((1 && segmap_usable_groups_210353 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_210352 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_210353;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237492[] = {&ctx->global_failure, &n_203572,
                                              &partition_sizze_203667,
                                              &ctx_param_ext_229619,
                                              &kernel_arg_237495,
                                              &kernel_arg_237496,
                                              &kernel_arg_237497};
                int64_t time_start_237493 = 0, time_end_237494 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_210357",
                            (long) segmap_usable_groups_210353, (long) 1,
                            (long) 1, (long) segmap_group_sizze_210352,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237493 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_210357_runs,
                                              &ctx->mainzisegmap_210357_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210357,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_210352,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237492,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237494 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_210357", time_end_237494 -
                            time_start_237493);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_237501 = ext_mem_229373.mem;
            CUdeviceptr kernel_arg_237502 = mem_param_229601.mem;
            CUdeviceptr kernel_arg_237503 = mem_229628.mem;
            CUdeviceptr kernel_arg_237504 = mem_229634.mem;
            CUdeviceptr kernel_arg_237505 = mem_229639.mem;
            
            if ((((((1 && segmap_usable_groups_210496 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_210495 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_210496;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_237498[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &n_203572, &n_p_203574,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721, &i_203760,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &kernel_arg_237501,
                                              &kernel_arg_237502,
                                              &kernel_arg_237503,
                                              &kernel_arg_237504,
                                              &kernel_arg_237505};
                int64_t time_start_237499 = 0, time_end_237500 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_210502",
                            (long) segmap_usable_groups_210496, (long) 1,
                            (long) 1, (long) segmap_group_sizze_210495,
                            (long) 1, (long) 1, (int) 0);
                    time_start_237499 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_210502_runs,
                                              &ctx->mainzisegmap_210502_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210502,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_210495,
                                                      1, 1, 0, NULL,
                                                      kernel_args_237498,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_237500 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_210502", time_end_237500 -
                            time_start_237499);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device ext_mem_230595;
            
            ext_mem_230595.references = NULL;
            
            struct memblock_device ext_mem_230594;
            
            ext_mem_230594.references = NULL;
            if (cond_204260) {
                bool match_lit_204330 = (int64_t) 0 == d_s_203578;
                struct memblock_device ext_mem_230528;
                
                ext_mem_230528.references = NULL;
                
                struct memblock_device ext_mem_230527;
                
                ext_mem_230527.references = NULL;
                if (match_lit_204330) {
                    struct memblock_device mem_229644;
                    
                    mem_229644.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_229644, bytes_229405,
                                              "mem_229644")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_229644,
                                                      partition_sizze_203667 *
                                                      n_p_203574 * s_n_m_203726,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_229644,
                                                  "mem_229644") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230527,
                                                  "ext_mem_230527") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230528,
                                                  "ext_mem_230528") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_210527;
                    
                    suff_outer_par_210527 =
                        *ctx->tuning_params.mainzisuff_outer_par_7 <=
                        partition_sizze_203667;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_7",
                                (long) partition_sizze_203667,
                                suff_outer_par_210527 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_210627;
                    
                    segmap_group_sizze_210627 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210531;
                    
                    int64_t num_groups_210628;
                    int32_t max_num_groups_233136;
                    
                    max_num_groups_233136 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210533;
                    num_groups_210628 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203667,
                                                                             segmap_group_sizze_210627),
                                                                   sext_i32_i64(max_num_groups_233136))));
                    
                    int64_t segmap_group_sizze_211751;
                    
                    segmap_group_sizze_211751 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210726;
                    
                    int64_t num_groups_211752;
                    int32_t max_num_groups_233137;
                    
                    max_num_groups_233137 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210728;
                    num_groups_211752 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(binop_x_229310,
                                                                             segmap_group_sizze_211751),
                                                                   sext_i32_i64(max_num_groups_233137))));
                    
                    bool suff_outer_par_211756;
                    
                    suff_outer_par_211756 =
                        *ctx->tuning_params.mainzisuff_outer_par_8 <=
                        binop_x_229310;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_8", (long) binop_x_229310,
                                suff_outer_par_211756 ? "true" : "false");
                    
                    int64_t one_intra_par_min_211757 = q_s_203575 *
                            s_n_m_203726;
                    int64_t intra_avail_par_211759 = smin64(s_n_m_203726,
                                                            one_intra_par_min_211757);
                    int64_t computed_group_sizze_211760 = smax64(s_n_m_203726,
                                                                 one_intra_par_min_211757);
                    bool fits_211764 = sle64(computed_group_sizze_211760,
                                             max_group_sizze_206977);
                    bool suff_intra_par_211766;
                    
                    suff_intra_par_211766 =
                        *ctx->tuning_params.mainzisuff_intra_par_9 <=
                        intra_avail_par_211759;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_intra_par_9",
                                (long) intra_avail_par_211759,
                                suff_intra_par_211766 ? "true" : "false");
                    
                    bool intra_suff_and_fits_211767 = fits_211764 &&
                         suff_intra_par_211766;
                    int64_t segmap_group_sizze_211969;
                    
                    segmap_group_sizze_211969 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211061;
                    
                    bool suff_outer_par_211974;
                    
                    suff_outer_par_211974 =
                        *ctx->tuning_params.mainzisuff_outer_par_10 <=
                        nest_sizze_208938;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_10",
                                (long) nest_sizze_208938,
                                suff_outer_par_211974 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_212062;
                    
                    segmap_group_sizze_212062 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211322;
                    
                    int64_t nest_sizze_212084 = q_s_203575 * nest_sizze_208938;
                    int64_t segred_group_sizze_212085;
                    
                    segred_group_sizze_212085 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211266;
                    
                    int64_t num_groups_212086;
                    int32_t max_num_groups_233138;
                    
                    max_num_groups_233138 =
                        *ctx->tuning_params.mainzisegred_num_groups_211268;
                    num_groups_212086 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_212084,
                                                                             segred_group_sizze_212085),
                                                                   sext_i32_i64(max_num_groups_233138))));
                    
                    int64_t segmap_group_sizze_212134;
                    
                    segmap_group_sizze_212134 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211236;
                    
                    int64_t segred_group_sizze_212159;
                    
                    segred_group_sizze_212159 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211164;
                    
                    int64_t num_groups_212160;
                    int32_t max_num_groups_233139;
                    
                    max_num_groups_233139 =
                        *ctx->tuning_params.mainzisegred_num_groups_211166;
                    num_groups_212160 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_212084,
                                                                             segred_group_sizze_212159),
                                                                   sext_i32_i64(max_num_groups_233139))));
                    
                    int64_t bytes_229647 = (int64_t) 8 * nest_sizze_208938;
                    int64_t bytes_229654 = (int64_t) 8 * nest_sizze_207253;
                    int64_t binop_x_229717 = partition_sizze_203667 *
                            s_n_m_203726;
                    int64_t binop_x_229718 = n_p_203574 * binop_x_229717;
                    int64_t bytes_229719 = (int64_t) 8 * binop_x_229718;
                    int64_t binop_x_229725 = partition_sizze_203667 *
                            defunc_0_f_res_203721;
                    int64_t binop_x_229726 = n_p_203574 * binop_x_229725;
                    int64_t bytes_229727 = (int64_t) 8 * binop_x_229726;
                    int64_t bytes_229762 = smax64((int64_t) 0, s_n_m_203726);
                    int64_t bytes_229798 = smax64((int64_t) 0, binop_x_229403);
                    int64_t num_threads_232221 = segmap_group_sizze_210627 *
                            num_groups_210628;
                    int64_t total_sizze_232222 = bytes_229396 *
                            num_threads_232221;
                    int64_t num_threads_232223 = segmap_group_sizze_211751 *
                            num_groups_211752;
                    int64_t total_sizze_232224 = bytes_229419 *
                            num_threads_232223;
                    struct memblock_device ext_mem_229838;
                    
                    ext_mem_229838.references = NULL;
                    
                    int32_t local_memory_capacity_233425;
                    
                    local_memory_capacity_233425 = ctx->cuda.max_shared_memory;
                    if (sle64((int64_t) 0,
                              sext_i32_i64(local_memory_capacity_233425)) &&
                        suff_outer_par_210527) {
                        struct memblock_device mem_229648;
                        
                        mem_229648.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229648,
                                                  bytes_229647, "mem_229648")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229648,
                                                                  (int64_t) 0,
                                                                  ext_mem_229470,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  s_n_m_203726,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229651;
                        
                        mem_229651.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229651,
                                                  binop_y_229332,
                                                  "mem_229651")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229651,
                                                                  (int64_t) 0,
                                                                  ext_mem_229372,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229655;
                        
                        mem_229655.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229655,
                                                  bytes_229654, "mem_229655")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229655,
                                                                  (int64_t) 0,
                                                                  mem_229639,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  defunc_0_f_res_203721,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229659;
                        
                        mem_229659.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229659,
                                                  bytes_229647, "mem_229659")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229659,
                                                                  (int64_t) 0,
                                                                  ext_mem_229471,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  s_n_m_203726,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229663;
                        
                        mem_229663.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229663,
                                                  bytes_229654, "mem_229663")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229663,
                                                                  (int64_t) 0,
                                                                  mem_229634,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  defunc_0_f_res_203721,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229663,
                                                      "mem_229663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229667;
                        
                        mem_229667.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229667,
                                                  bytes_229654, "mem_229667")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229667,
                                                                  (int64_t) 0,
                                                                  ext_mem_229373,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203574 *
                                                                  defunc_0_f_res_203721,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229667,
                                                      "mem_229667") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229663,
                                                      "mem_229663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229716;
                        
                        mem_229716.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229716,
                                                  bytes_229647, "mem_229716")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232097;
                        
                        color_232097.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232097,
                                                  total_sizze_232222,
                                                  "color_232097")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_237509 = mem_229648.mem;
                        CUdeviceptr kernel_arg_237510 = mem_229651.mem;
                        CUdeviceptr kernel_arg_237511 = mem_229655.mem;
                        CUdeviceptr kernel_arg_237512 = mem_229659.mem;
                        CUdeviceptr kernel_arg_237513 = mem_229663.mem;
                        CUdeviceptr kernel_arg_237514 = mem_229667.mem;
                        CUdeviceptr kernel_arg_237515 = mem_229716.mem;
                        CUdeviceptr kernel_arg_237516 = color_232097.mem;
                        
                        if ((((((1 && num_groups_210628 != 0) && 1 != 0) && 1 !=
                               0) && segmap_group_sizze_210627 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = num_groups_210628;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_237506[] = {&ctx->global_failure,
                                                          &n_p_203574,
                                                          &q_s_203575,
                                                          &jump_s_203581,
                                                          &partition_sizze_203667,
                                                          &defunc_0_f_res_203721,
                                                          &pad_css_len_203722,
                                                          &s_n_m_203726,
                                                          &num_groups_210628,
                                                          &num_threads_232221,
                                                          &kernel_arg_237509,
                                                          &kernel_arg_237510,
                                                          &kernel_arg_237511,
                                                          &kernel_arg_237512,
                                                          &kernel_arg_237513,
                                                          &kernel_arg_237514,
                                                          &kernel_arg_237515,
                                                          &kernel_arg_237516};
                            int64_t time_start_237507 = 0, time_end_237508 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_210632",
                                        (long) num_groups_210628, (long) 1,
                                        (long) 1,
                                        (long) segmap_group_sizze_210627,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_237507 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_210632_runs,
                                                          &ctx->mainzisegmap_210632_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_210632,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_210627,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_237506,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_237508 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_210632", time_end_237508 -
                                        time_start_237507);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_229648,
                                                  "mem_229648") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229651,
                                                  "mem_229651") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229655,
                                                  "mem_229655") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229659,
                                                  "mem_229659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229663,
                                                  "mem_229663") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229667,
                                                  "mem_229667") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232097,
                                                  "color_232097") != 0)
                            return 1;
                        
                        struct memblock_device mem_229836;
                        
                        mem_229836.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229836,
                                                  bytes_229405, "mem_229836")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229836,
                                                                  (int64_t) 0,
                                                                  mem_229716,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203667,
                                                                  n_p_203574 *
                                                                  s_n_m_203726) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229836,
                                                      "mem_229836") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232097,
                                                      "color_232097") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229716,
                                                      "mem_229716") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229667,
                                                      "mem_229667") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229663,
                                                      "mem_229663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229659,
                                                      "mem_229659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229655,
                                                      "mem_229655") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229651,
                                                      "mem_229651") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229838,
                                                      "ext_mem_229838") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229644,
                                                      "mem_229644") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230527,
                                                      "ext_mem_230527") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230528,
                                                      "ext_mem_230528") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_229716,
                                                  "mem_229716") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_229838,
                                                &mem_229836, "mem_229836") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229836,
                                                  "mem_229836") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232097,
                                                  "color_232097") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229716,
                                                  "mem_229716") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229667,
                                                  "mem_229667") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229663,
                                                  "mem_229663") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229659,
                                                  "mem_229659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229655,
                                                  "mem_229655") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229651,
                                                  "mem_229651") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229648,
                                                  "mem_229648") != 0)
                            return 1;
                    } else {
                        struct memblock_device ext_mem_229831;
                        
                        ext_mem_229831.references = NULL;
                        
                        int32_t local_memory_capacity_233424;
                        
                        local_memory_capacity_233424 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233424)) &&
                            suff_outer_par_211756) {
                            struct memblock_device mem_229720;
                            
                            mem_229720.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229720,
                                                      bytes_229719,
                                                      "mem_229720")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229720,
                                                                      (int64_t) 0,
                                                                      ext_mem_229471,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229724;
                            
                            mem_229724.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229724,
                                                      bytes_229719,
                                                      "mem_229724")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229724,
                                                                      (int64_t) 0,
                                                                      ext_mem_229470,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229728;
                            
                            mem_229728.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229728,
                                                      bytes_229727,
                                                      "mem_229728")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229728,
                                                                      (int64_t) 0,
                                                                      ext_mem_229373,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229732;
                            
                            mem_229732.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229732,
                                                      bytes_229727,
                                                      "mem_229732")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229732,
                                                                      (int64_t) 0,
                                                                      mem_229639,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229732,
                                                          "mem_229732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229736;
                            
                            mem_229736.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229736,
                                                      bytes_229727,
                                                      "mem_229736")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229736,
                                                                      (int64_t) 0,
                                                                      mem_229634,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229736,
                                                          "mem_229736") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229732,
                                                          "mem_229732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229756;
                            
                            mem_229756.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229756,
                                                      bytes_229719,
                                                      "mem_229756")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232098;
                            
                            color_232098.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232098,
                                                      total_sizze_232224,
                                                      "color_232098")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_237520 = ext_mem_229372.mem;
                            CUdeviceptr kernel_arg_237521 = mem_229720.mem;
                            CUdeviceptr kernel_arg_237522 = mem_229724.mem;
                            CUdeviceptr kernel_arg_237523 = mem_229728.mem;
                            CUdeviceptr kernel_arg_237524 = mem_229732.mem;
                            CUdeviceptr kernel_arg_237525 = mem_229736.mem;
                            CUdeviceptr kernel_arg_237526 = mem_229756.mem;
                            CUdeviceptr kernel_arg_237527 = color_232098.mem;
                            
                            if ((((((1 && num_groups_211752 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_211751 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_211752;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_237517[] =
                                     {&ctx->global_failure, &n_p_203574,
                                      &q_s_203575, &jump_s_203581,
                                      &partition_sizze_203667,
                                      &defunc_0_f_res_203721,
                                      &pad_css_len_203722, &s_n_m_203726,
                                      &num_groups_211752, &num_threads_232223,
                                      &kernel_arg_237520, &kernel_arg_237521,
                                      &kernel_arg_237522, &kernel_arg_237523,
                                      &kernel_arg_237524, &kernel_arg_237525,
                                      &kernel_arg_237526, &kernel_arg_237527};
                                int64_t time_start_237518 = 0, time_end_237519 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_211772",
                                            (long) num_groups_211752, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_211751,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_237518 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_211772_runs,
                                                              &ctx->mainzisegmap_211772_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_211772,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_211751,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_237517,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_237519 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_211772",
                                            time_end_237519 -
                                            time_start_237518);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229720,
                                                      "mem_229720") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229724,
                                                      "mem_229724") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229728,
                                                      "mem_229728") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229732,
                                                      "mem_229732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229736,
                                                      "mem_229736") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232098,
                                                      "color_232098") != 0)
                                return 1;
                            
                            struct memblock_device mem_229829;
                            
                            mem_229829.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229829,
                                                      bytes_229405,
                                                      "mem_229829")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229829,
                                                                      (int64_t) 0,
                                                                      mem_229756,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667 *
                                                                      n_p_203574,
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229829,
                                                          "mem_229829") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232098,
                                                          "color_232098") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229756,
                                                          "mem_229756") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229736,
                                                          "mem_229736") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229732,
                                                          "mem_229732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229728,
                                                          "mem_229728") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229724,
                                                          "mem_229724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229720,
                                                          "mem_229720") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229831,
                                                          "ext_mem_229831") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229838,
                                                          "ext_mem_229838") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229644,
                                                          "mem_229644") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229756,
                                                      "mem_229756") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_229831,
                                                    &mem_229829,
                                                    "mem_229829") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229829,
                                                      "mem_229829") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232098,
                                                      "color_232098") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229756,
                                                      "mem_229756") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229736,
                                                      "mem_229736") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229732,
                                                      "mem_229732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229728,
                                                      "mem_229728") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229724,
                                                      "mem_229724") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229720,
                                                      "mem_229720") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_229824;
                            
                            ext_mem_229824.references = NULL;
                            
                            int32_t local_memory_capacity_233423;
                            
                            local_memory_capacity_233423 =
                                ctx->cuda.max_shared_memory;
                            if (sle64(bytes_229419 + srem64((int64_t) 8 -
                                                            srem64(bytes_229419,
                                                                   (int64_t) 8),
                                                            (int64_t) 8) +
                                      (bytes_229419 + srem64((int64_t) 8 -
                                                             srem64(bytes_229419,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229419 + srem64((int64_t) 8 -
                                                             srem64(bytes_229419,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229762 + srem64((int64_t) 8 -
                                                             srem64(bytes_229762,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      ((int64_t) 8 * (s_n_m_203726 *
                                                      q_s_203575) +
                                       srem64((int64_t) 8 - srem64((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575),
                                                                   (int64_t) 8),
                                              (int64_t) 8)) + ((int64_t) 8 *
                                                               (s_n_m_203726 *
                                                                q_s_203575) +
                                                               srem64((int64_t) 8 -
                                                                      srem64((int64_t) 8 *
                                                                             (s_n_m_203726 *
                                                                              q_s_203575),
                                                                             (int64_t) 8),
                                                                      (int64_t) 8)),
                                      sext_i32_i64(local_memory_capacity_233423)) &&
                                intra_suff_and_fits_211767) {
                                struct memblock_device mem_229783;
                                
                                mem_229783.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229783,
                                                          bytes_229405,
                                                          "mem_229783")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                unsigned int shared_sizze_237531 = (int64_t) 8 *
                                             (s_n_m_203726 * q_s_203575);
                                unsigned int shared_sizze_237533 = (int64_t) 8 *
                                             (s_n_m_203726 * q_s_203575);
                                unsigned int shared_sizze_237535 = bytes_229762;
                                unsigned int shared_sizze_237537 = bytes_229419;
                                unsigned int shared_sizze_237539 = bytes_229419;
                                unsigned int shared_sizze_237541 = bytes_229419;
                                CUdeviceptr kernel_arg_237543 =
                                            ext_mem_229372.mem;
                                CUdeviceptr kernel_arg_237544 =
                                            ext_mem_229373.mem;
                                CUdeviceptr kernel_arg_237545 =
                                            ext_mem_229470.mem;
                                CUdeviceptr kernel_arg_237546 =
                                            ext_mem_229471.mem;
                                CUdeviceptr kernel_arg_237547 = mem_229634.mem;
                                CUdeviceptr kernel_arg_237548 = mem_229639.mem;
                                CUdeviceptr kernel_arg_237549 = mem_229783.mem;
                                unsigned int shared_offset_237532 = 0;
                                unsigned int shared_offset_237534 = 0 +
                                             (shared_sizze_237531 + (8 -
                                                                     shared_sizze_237531 %
                                                                     8) % 8);
                                unsigned int shared_offset_237536 = 0 +
                                             (shared_sizze_237531 + (8 -
                                                                     shared_sizze_237531 %
                                                                     8) % 8) +
                                             (shared_sizze_237533 + (8 -
                                                                     shared_sizze_237533 %
                                                                     8) % 8);
                                unsigned int shared_offset_237538 = 0 +
                                             (shared_sizze_237531 + (8 -
                                                                     shared_sizze_237531 %
                                                                     8) % 8) +
                                             (shared_sizze_237533 + (8 -
                                                                     shared_sizze_237533 %
                                                                     8) % 8) +
                                             (shared_sizze_237535 + (8 -
                                                                     shared_sizze_237535 %
                                                                     8) % 8);
                                unsigned int shared_offset_237540 = 0 +
                                             (shared_sizze_237531 + (8 -
                                                                     shared_sizze_237531 %
                                                                     8) % 8) +
                                             (shared_sizze_237533 + (8 -
                                                                     shared_sizze_237533 %
                                                                     8) % 8) +
                                             (shared_sizze_237535 + (8 -
                                                                     shared_sizze_237535 %
                                                                     8) % 8) +
                                             (shared_sizze_237537 + (8 -
                                                                     shared_sizze_237537 %
                                                                     8) % 8);
                                unsigned int shared_offset_237542 = 0 +
                                             (shared_sizze_237531 + (8 -
                                                                     shared_sizze_237531 %
                                                                     8) % 8) +
                                             (shared_sizze_237533 + (8 -
                                                                     shared_sizze_237533 %
                                                                     8) % 8) +
                                             (shared_sizze_237535 + (8 -
                                                                     shared_sizze_237535 %
                                                                     8) % 8) +
                                             (shared_sizze_237537 + (8 -
                                                                     shared_sizze_237537 %
                                                                     8) % 8) +
                                             (shared_sizze_237539 + (8 -
                                                                     shared_sizze_237539 %
                                                                     8) % 8);
                                
                                if ((((((1 && binop_x_229310 != 0) && 1 != 0) &&
                                       1 != 0) && computed_group_sizze_211760 !=
                                      0) && 1 != 0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = binop_x_229310;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_237528[] =
                                         {&ctx->global_failure,
                                          &shared_offset_237532,
                                          &shared_offset_237534,
                                          &shared_offset_237536,
                                          &shared_offset_237538,
                                          &shared_offset_237540,
                                          &shared_offset_237542, &n_p_203574,
                                          &q_s_203575, &jump_s_203581,
                                          &partition_sizze_203667,
                                          &defunc_0_f_res_203721,
                                          &pad_css_len_203722, &s_n_m_203726,
                                          &computed_group_sizze_211760,
                                          &kernel_arg_237543,
                                          &kernel_arg_237544,
                                          &kernel_arg_237545,
                                          &kernel_arg_237546,
                                          &kernel_arg_237547,
                                          &kernel_arg_237548,
                                          &kernel_arg_237549};
                                    int64_t time_start_237529 = 0,
                                            time_end_237530 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_intragroup_211858",
                                                (long) binop_x_229310, (long) 1,
                                                (long) 1,
                                                (long) computed_group_sizze_211760,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_237531 +
                                                                            (8 -
                                                                             shared_sizze_237531 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_237533 +
                                                                            (8 -
                                                                             shared_sizze_237533 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_237535 +
                                                                            (8 -
                                                                             shared_sizze_237535 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_237537 +
                                                                            (8 -
                                                                             shared_sizze_237537 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_237539 +
                                                                            (8 -
                                                                             shared_sizze_237539 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_237541 +
                                                                            (8 -
                                                                             shared_sizze_237541 %
                                                                             8) %
                                                                            8)));
                                        time_start_237529 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_intragroup_211858_runs,
                                                                  &ctx->mainzisegmap_intragroup_211858_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_211858,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          computed_group_sizze_211760,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_237531 +
                                                                           (8 -
                                                                            shared_sizze_237531 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_237533 +
                                                                           (8 -
                                                                            shared_sizze_237533 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_237535 +
                                                                           (8 -
                                                                            shared_sizze_237535 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_237537 +
                                                                           (8 -
                                                                            shared_sizze_237537 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_237539 +
                                                                           (8 -
                                                                            shared_sizze_237539 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_237541 +
                                                                           (8 -
                                                                            shared_sizze_237541 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_237528,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_237530 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_intragroup_211858",
                                                time_end_237530 -
                                                time_start_237529);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_229824,
                                                        &mem_229783,
                                                        "mem_229783") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229783,
                                                          "mem_229783") != 0)
                                    return 1;
                            } else {
                                int64_t segmap_usable_groups_211970 =
                                        sdiv_up64(nest_sizze_208938,
                                                  segmap_group_sizze_211969);
                                struct memblock_device ext_mem_229823;
                                
                                ext_mem_229823.references = NULL;
                                
                                int32_t local_memory_capacity_233422;
                                
                                local_memory_capacity_233422 =
                                    ctx->cuda.max_shared_memory;
                                if (sle64((int64_t) 0,
                                          sext_i32_i64(local_memory_capacity_233422)) &&
                                    suff_outer_par_211974) {
                                    struct memblock_device mem_229789;
                                    
                                    mem_229789.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229789,
                                                              bytes_229405,
                                                              "mem_229789")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    CUdeviceptr kernel_arg_237553 =
                                                ext_mem_229372.mem;
                                    CUdeviceptr kernel_arg_237554 =
                                                ext_mem_229373.mem;
                                    CUdeviceptr kernel_arg_237555 =
                                                ext_mem_229470.mem;
                                    CUdeviceptr kernel_arg_237556 =
                                                ext_mem_229471.mem;
                                    CUdeviceptr kernel_arg_237557 =
                                                mem_229634.mem;
                                    CUdeviceptr kernel_arg_237558 =
                                                mem_229639.mem;
                                    CUdeviceptr kernel_arg_237559 =
                                                mem_229789.mem;
                                    
                                    if ((((((1 && segmap_usable_groups_211970 !=
                                             0) && 1 != 0) && 1 != 0) &&
                                          segmap_group_sizze_211969 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] =
                                            segmap_usable_groups_211970;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237550[] =
                                             {&ctx->global_failure, &n_p_203574,
                                              &q_s_203575, &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726, &kernel_arg_237553,
                                              &kernel_arg_237554,
                                              &kernel_arg_237555,
                                              &kernel_arg_237556,
                                              &kernel_arg_237557,
                                              &kernel_arg_237558,
                                              &kernel_arg_237559};
                                        int64_t time_start_237551 = 0,
                                                time_end_237552 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segmap_211980",
                                                    (long) segmap_usable_groups_211970,
                                                    (long) 1, (long) 1,
                                                    (long) segmap_group_sizze_211969,
                                                    (long) 1, (long) 1,
                                                    (int) 0);
                                            time_start_237551 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_211980_runs,
                                                                &ctx->mainzisegmap_211980_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_211980,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segmap_group_sizze_211969,
                                                                              1,
                                                                              1,
                                                                              0,
                                                                              NULL,
                                                                              kernel_args_237550,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237552 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_211980",
                                                    time_end_237552 -
                                                    time_start_237551);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229823,
                                                            &mem_229789,
                                                            "mem_229789") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229789,
                                                              "mem_229789") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_212063 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_212062);
                                    struct memblock_device mem_229795;
                                    
                                    mem_229795.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229795,
                                                              bytes_229405,
                                                              "mem_229795")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229799;
                                    
                                    mem_229799.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229799,
                                                              bytes_229798,
                                                              "mem_229799")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    CUdeviceptr kernel_arg_237563 =
                                                mem_229795.mem;
                                    CUdeviceptr kernel_arg_237564 =
                                                mem_229799.mem;
                                    
                                    if ((((((1 && segmap_usable_groups_212063 !=
                                             0) && 1 != 0) && 1 != 0) &&
                                          segmap_group_sizze_212062 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] =
                                            segmap_usable_groups_212063;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237560[] =
                                             {&ctx->global_failure, &n_p_203574,
                                              &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726, &kernel_arg_237563,
                                              &kernel_arg_237564};
                                        int64_t time_start_237561 = 0,
                                                time_end_237562 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segmap_212069",
                                                    (long) segmap_usable_groups_212063,
                                                    (long) 1, (long) 1,
                                                    (long) segmap_group_sizze_212062,
                                                    (long) 1, (long) 1,
                                                    (int) 0);
                                            time_start_237561 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_212069_runs,
                                                                &ctx->mainzisegmap_212069_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_212069,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segmap_group_sizze_212062,
                                                                              1,
                                                                              1,
                                                                              0,
                                                                              NULL,
                                                                              kernel_args_237560,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237562 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_212069",
                                                    time_end_237562 -
                                                    time_start_237561);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229799,
                                                              "mem_229799") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229805;
                                    
                                    mem_229805.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229805,
                                                              bytes_229405,
                                                              "mem_229805")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203575 * (int64_t) 2,
                                              segred_group_sizze_212085)) {
                                        int64_t segment_sizze_nonzzero_233258 =
                                                smax64((int64_t) 1, q_s_203575);
                                        int64_t num_threads_233259 =
                                                num_groups_212086 *
                                                segred_group_sizze_212085;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-small");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_212085,
                                                                        segment_sizze_nonzzero_233258),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                       n_p_203574 *
                                                                                       s_n_m_203726,
                                                                                       squot64(segred_group_sizze_212085,
                                                                                               segment_sizze_nonzzero_233258))),
                                                    '\n');
                                        
                                        unsigned int shared_sizze_237568 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_212085;
                                        CUdeviceptr kernel_arg_237570 =
                                                    ext_mem_229372.mem;
                                        CUdeviceptr kernel_arg_237571 =
                                                    ext_mem_229373.mem;
                                        CUdeviceptr kernel_arg_237572 =
                                                    ext_mem_229470.mem;
                                        CUdeviceptr kernel_arg_237573 =
                                                    ext_mem_229471.mem;
                                        CUdeviceptr kernel_arg_237574 =
                                                    mem_229639.mem;
                                        CUdeviceptr kernel_arg_237575 =
                                                    mem_229795.mem;
                                        CUdeviceptr kernel_arg_237576 =
                                                    mem_229805.mem;
                                        unsigned int shared_offset_237569 = 0;
                                        
                                        if ((((((1 && num_groups_212086 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_212085 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] = num_groups_212086;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237565[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237569,
                                                  &n_p_203574, &q_s_203575,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &s_n_m_203726,
                                                  &num_groups_212086,
                                                  &segment_sizze_nonzzero_233258,
                                                  &kernel_arg_237570,
                                                  &kernel_arg_237571,
                                                  &kernel_arg_237572,
                                                  &kernel_arg_237573,
                                                  &kernel_arg_237574,
                                                  &kernel_arg_237575,
                                                  &kernel_arg_237576};
                                            int64_t time_start_237566 = 0,
                                                    time_end_237567 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segred_small_212093",
                                                        (long) num_groups_212086,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_212085,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237568 +
                                                                (8 -
                                                                 shared_sizze_237568 %
                                                                 8) % 8)));
                                                time_start_237566 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_small_212093_runs,
                                                                    &ctx->mainzisegred_small_212093_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_212093,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_212085,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237568 +
                                                                                   (8 -
                                                                                    shared_sizze_237568 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237565,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237567 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212093",
                                                        time_end_237567 -
                                                        time_start_237566);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233289 =
                                                sdiv_up64(num_groups_212086,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726));
                                        int64_t elements_per_thread_233290 =
                                                sdiv_up64(q_s_203575,
                                                          segred_group_sizze_212085 *
                                                          groups_per_segment_233289);
                                        int64_t virt_num_groups_233291 =
                                                groups_per_segment_233289 *
                                                (partition_sizze_203667 *
                                                 n_p_203574 * s_n_m_203726);
                                        int64_t num_threads_233292 =
                                                num_groups_212086 *
                                                segred_group_sizze_212085;
                                        int64_t threads_per_segment_233293 =
                                                groups_per_segment_233289 *
                                                segred_group_sizze_212085;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-large");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233291,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_212086,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_212085,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233290,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233289,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233294;
                                        
                                        segred_tmp_mem_233294.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233294,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233291,
                                                                  "segred_tmp_mem_233294")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233296 =
                                        ctx->mainzicounter_mem_233296;
                                        unsigned int shared_sizze_237581 = 1;
                                        unsigned int shared_sizze_237583 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_212085;
                                        CUdeviceptr kernel_arg_237585 =
                                                    ext_mem_229372.mem;
                                        CUdeviceptr kernel_arg_237586 =
                                                    ext_mem_229373.mem;
                                        CUdeviceptr kernel_arg_237587 =
                                                    ext_mem_229470.mem;
                                        CUdeviceptr kernel_arg_237588 =
                                                    ext_mem_229471.mem;
                                        CUdeviceptr kernel_arg_237589 =
                                                    mem_229639.mem;
                                        CUdeviceptr kernel_arg_237590 =
                                                    mem_229795.mem;
                                        CUdeviceptr kernel_arg_237591 =
                                                    mem_229805.mem;
                                        CUdeviceptr kernel_arg_237592 =
                                                    segred_tmp_mem_233294.mem;
                                        CUdeviceptr kernel_arg_237593 =
                                                    mainzicounter_mem_233296.mem;
                                        unsigned int shared_offset_237582 = 0;
                                        unsigned int shared_offset_237584 = 0 +
                                                     (shared_sizze_237581 + (8 -
                                                                             shared_sizze_237581 %
                                                                             8) %
                                                      8);
                                        
                                        if ((((((1 && num_groups_212086 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_212085 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] = num_groups_212086;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237578[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237582,
                                                  &shared_offset_237584,
                                                  &n_p_203574, &q_s_203575,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &s_n_m_203726,
                                                  &num_groups_212086,
                                                  &groups_per_segment_233289,
                                                  &elements_per_thread_233290,
                                                  &virt_num_groups_233291,
                                                  &threads_per_segment_233293,
                                                  &kernel_arg_237585,
                                                  &kernel_arg_237586,
                                                  &kernel_arg_237587,
                                                  &kernel_arg_237588,
                                                  &kernel_arg_237589,
                                                  &kernel_arg_237590,
                                                  &kernel_arg_237591,
                                                  &kernel_arg_237592,
                                                  &kernel_arg_237593};
                                            int64_t time_start_237579 = 0,
                                                    time_end_237580 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segred_large_212093",
                                                        (long) num_groups_212086,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_212085,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237581 +
                                                                (8 -
                                                                 shared_sizze_237581 %
                                                                 8) % 8) +
                                                               (shared_sizze_237583 +
                                                                (8 -
                                                                 shared_sizze_237583 %
                                                                 8) % 8)));
                                                time_start_237579 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_large_212093_runs,
                                                                    &ctx->mainzisegred_large_212093_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_212093,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_212085,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237581 +
                                                                                   (8 -
                                                                                    shared_sizze_237581 %
                                                                                    8) %
                                                                                   8) +
                                                                                  (shared_sizze_237583 +
                                                                                   (8 -
                                                                                    shared_sizze_237583 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237578,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237580 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212093",
                                                        time_end_237580 -
                                                        time_start_237579);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233294,
                                                                  "segred_tmp_mem_233294") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229795,
                                                              "mem_229795") !=
                                        0)
                                        return 1;
                                    
                                    int64_t segmap_usable_groups_212135 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_212134);
                                    struct memblock_device mem_229811;
                                    
                                    mem_229811.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229811,
                                                              bytes_229405,
                                                              "mem_229811")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229816;
                                    
                                    mem_229816.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229816,
                                                              bytes_229405,
                                                              "mem_229816")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    CUdeviceptr kernel_arg_237597 =
                                                mem_229805.mem;
                                    CUdeviceptr kernel_arg_237598 =
                                                mem_229811.mem;
                                    CUdeviceptr kernel_arg_237599 =
                                                mem_229816.mem;
                                    
                                    if ((((((1 && segmap_usable_groups_212135 !=
                                             0) && 1 != 0) && 1 != 0) &&
                                          segmap_group_sizze_212134 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] =
                                            segmap_usable_groups_212135;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237594[] =
                                             {&ctx->global_failure, &n_p_203574,
                                              &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726, &kernel_arg_237597,
                                              &kernel_arg_237598,
                                              &kernel_arg_237599};
                                        int64_t time_start_237595 = 0,
                                                time_end_237596 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segmap_212141",
                                                    (long) segmap_usable_groups_212135,
                                                    (long) 1, (long) 1,
                                                    (long) segmap_group_sizze_212134,
                                                    (long) 1, (long) 1,
                                                    (int) 0);
                                            time_start_237595 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_212141_runs,
                                                                &ctx->mainzisegmap_212141_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_212141,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segmap_group_sizze_212134,
                                                                              1,
                                                                              1,
                                                                              0,
                                                                              NULL,
                                                                              kernel_args_237594,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237596 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_212141",
                                                    time_end_237596 -
                                                    time_start_237595);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229805,
                                                              "mem_229805") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229822;
                                    
                                    mem_229822.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229822,
                                                              bytes_229405,
                                                              "mem_229822")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203575 * (int64_t) 2,
                                              segred_group_sizze_212159)) {
                                        int64_t segment_sizze_nonzzero_233346 =
                                                smax64((int64_t) 1, q_s_203575);
                                        int64_t num_threads_233347 =
                                                num_groups_212160 *
                                                segred_group_sizze_212159;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-small");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_212159,
                                                                        segment_sizze_nonzzero_233346),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                       n_p_203574 *
                                                                                       s_n_m_203726,
                                                                                       squot64(segred_group_sizze_212159,
                                                                                               segment_sizze_nonzzero_233346))),
                                                    '\n');
                                        
                                        unsigned int shared_sizze_237603 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_212159;
                                        CUdeviceptr kernel_arg_237605 =
                                                    ext_mem_229372.mem;
                                        CUdeviceptr kernel_arg_237606 =
                                                    ext_mem_229373.mem;
                                        CUdeviceptr kernel_arg_237607 =
                                                    ext_mem_229470.mem;
                                        CUdeviceptr kernel_arg_237608 =
                                                    ext_mem_229471.mem;
                                        CUdeviceptr kernel_arg_237609 =
                                                    mem_229634.mem;
                                        CUdeviceptr kernel_arg_237610 =
                                                    mem_229639.mem;
                                        CUdeviceptr kernel_arg_237611 =
                                                    mem_229811.mem;
                                        CUdeviceptr kernel_arg_237612 =
                                                    mem_229816.mem;
                                        CUdeviceptr kernel_arg_237613 =
                                                    mem_229822.mem;
                                        unsigned int shared_offset_237604 = 0;
                                        
                                        if ((((((1 && num_groups_212160 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_212159 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] = num_groups_212160;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237600[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237604,
                                                  &n_p_203574, &q_s_203575,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &s_n_m_203726,
                                                  &num_groups_212160,
                                                  &segment_sizze_nonzzero_233346,
                                                  &kernel_arg_237605,
                                                  &kernel_arg_237606,
                                                  &kernel_arg_237607,
                                                  &kernel_arg_237608,
                                                  &kernel_arg_237609,
                                                  &kernel_arg_237610,
                                                  &kernel_arg_237611,
                                                  &kernel_arg_237612,
                                                  &kernel_arg_237613};
                                            int64_t time_start_237601 = 0,
                                                    time_end_237602 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segred_small_212167",
                                                        (long) num_groups_212160,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_212159,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237603 +
                                                                (8 -
                                                                 shared_sizze_237603 %
                                                                 8) % 8)));
                                                time_start_237601 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_small_212167_runs,
                                                                    &ctx->mainzisegred_small_212167_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_212167,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_212159,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237603 +
                                                                                   (8 -
                                                                                    shared_sizze_237603 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237600,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237602 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212167",
                                                        time_end_237602 -
                                                        time_start_237601);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233377 =
                                                sdiv_up64(num_groups_212160,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726));
                                        int64_t elements_per_thread_233378 =
                                                sdiv_up64(q_s_203575,
                                                          segred_group_sizze_212159 *
                                                          groups_per_segment_233377);
                                        int64_t virt_num_groups_233379 =
                                                groups_per_segment_233377 *
                                                (partition_sizze_203667 *
                                                 n_p_203574 * s_n_m_203726);
                                        int64_t num_threads_233380 =
                                                num_groups_212160 *
                                                segred_group_sizze_212159;
                                        int64_t threads_per_segment_233381 =
                                                groups_per_segment_233377 *
                                                segred_group_sizze_212159;
                                        
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegRed-large");
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_segments",
                                                    (long long) (partition_sizze_203667 *
                                                                 n_p_203574 *
                                                                 s_n_m_203726),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203575,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233379,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_212160,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_212159,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233378,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233377,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233382;
                                        
                                        segred_tmp_mem_233382.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233382,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233379,
                                                                  "segred_tmp_mem_233382")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233384 =
                                        ctx->mainzicounter_mem_233384;
                                        unsigned int shared_sizze_237618 = 1;
                                        unsigned int shared_sizze_237620 =
                                                     (int64_t) 8 *
                                                     segred_group_sizze_212159;
                                        CUdeviceptr kernel_arg_237622 =
                                                    ext_mem_229372.mem;
                                        CUdeviceptr kernel_arg_237623 =
                                                    ext_mem_229373.mem;
                                        CUdeviceptr kernel_arg_237624 =
                                                    ext_mem_229470.mem;
                                        CUdeviceptr kernel_arg_237625 =
                                                    ext_mem_229471.mem;
                                        CUdeviceptr kernel_arg_237626 =
                                                    mem_229634.mem;
                                        CUdeviceptr kernel_arg_237627 =
                                                    mem_229639.mem;
                                        CUdeviceptr kernel_arg_237628 =
                                                    mem_229811.mem;
                                        CUdeviceptr kernel_arg_237629 =
                                                    mem_229816.mem;
                                        CUdeviceptr kernel_arg_237630 =
                                                    mem_229822.mem;
                                        CUdeviceptr kernel_arg_237631 =
                                                    segred_tmp_mem_233382.mem;
                                        CUdeviceptr kernel_arg_237632 =
                                                    mainzicounter_mem_233384.mem;
                                        unsigned int shared_offset_237619 = 0;
                                        unsigned int shared_offset_237621 = 0 +
                                                     (shared_sizze_237618 + (8 -
                                                                             shared_sizze_237618 %
                                                                             8) %
                                                      8);
                                        
                                        if ((((((1 && num_groups_212160 != 0) &&
                                                1 != 0) && 1 != 0) &&
                                              segred_group_sizze_212159 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] = num_groups_212160;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237615[] =
                                                 {&ctx->global_failure,
                                                  &shared_offset_237619,
                                                  &shared_offset_237621,
                                                  &n_p_203574, &q_s_203575,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &s_n_m_203726,
                                                  &num_groups_212160,
                                                  &groups_per_segment_233377,
                                                  &elements_per_thread_233378,
                                                  &virt_num_groups_233379,
                                                  &threads_per_segment_233381,
                                                  &kernel_arg_237622,
                                                  &kernel_arg_237623,
                                                  &kernel_arg_237624,
                                                  &kernel_arg_237625,
                                                  &kernel_arg_237626,
                                                  &kernel_arg_237627,
                                                  &kernel_arg_237628,
                                                  &kernel_arg_237629,
                                                  &kernel_arg_237630,
                                                  &kernel_arg_237631,
                                                  &kernel_arg_237632};
                                            int64_t time_start_237616 = 0,
                                                    time_end_237617 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segred_large_212167",
                                                        (long) num_groups_212160,
                                                        (long) 1, (long) 1,
                                                        (long) segred_group_sizze_212159,
                                                        (long) 1, (long) 1,
                                                        (int) (0 +
                                                               (shared_sizze_237618 +
                                                                (8 -
                                                                 shared_sizze_237618 %
                                                                 8) % 8) +
                                                               (shared_sizze_237620 +
                                                                (8 -
                                                                 shared_sizze_237620 %
                                                                 8) % 8)));
                                                time_start_237616 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegred_large_212167_runs,
                                                                    &ctx->mainzisegred_large_212167_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_212167,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segred_group_sizze_212159,
                                                                                  1,
                                                                                  1,
                                                                                  0 +
                                                                                  (shared_sizze_237618 +
                                                                                   (8 -
                                                                                    shared_sizze_237618 %
                                                                                    8) %
                                                                                   8) +
                                                                                  (shared_sizze_237620 +
                                                                                   (8 -
                                                                                    shared_sizze_237620 %
                                                                                    8) %
                                                                                   8),
                                                                                  NULL,
                                                                                  kernel_args_237615,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237617 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212167",
                                                        time_end_237617 -
                                                        time_start_237616);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233382,
                                                                  "segred_tmp_mem_233382") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229811,
                                                              "mem_229811") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229816,
                                                              "mem_229816") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229823,
                                                            &mem_229822,
                                                            "mem_229822") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229822,
                                                              "mem_229822") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229816,
                                                              "mem_229816") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229811,
                                                              "mem_229811") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229805,
                                                              "mem_229805") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229799,
                                                              "mem_229799") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229795,
                                                              "mem_229795") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_229824,
                                                        &ext_mem_229823,
                                                        "ext_mem_229823") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229823,
                                                          "ext_mem_229823") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_229831,
                                                    &ext_mem_229824,
                                                    "ext_mem_229824") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229824,
                                                      "ext_mem_229824") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_229838,
                                                &ext_mem_229831,
                                                "ext_mem_229831") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229831,
                                                  "ext_mem_229831") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230528,
                                            &ext_mem_229838,
                                            "ext_mem_229838") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230527, &mem_229644,
                                            "mem_229644") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229838,
                                              "ext_mem_229838") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229644, "mem_229644") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204426 = (int64_t) 1 == d_s_203578;
                    struct memblock_device ext_mem_230526;
                    
                    ext_mem_230526.references = NULL;
                    
                    struct memblock_device ext_mem_230525;
                    
                    ext_mem_230525.references = NULL;
                    if (match_lit_204426) {
                        bool suff_outer_par_212219;
                        
                        suff_outer_par_212219 =
                            *ctx->tuning_params.mainzisuff_outer_par_11 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_11",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_212219 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_212349;
                        
                        segmap_group_sizze_212349 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212223;
                        
                        int64_t num_groups_212350;
                        int32_t max_num_groups_233426;
                        
                        max_num_groups_233426 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212225;
                        num_groups_212350 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_212349),
                                                                       sext_i32_i64(max_num_groups_233426))));
                        
                        int64_t segmap_group_sizze_213786;
                        
                        segmap_group_sizze_213786 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212479;
                        
                        int64_t num_groups_213787;
                        int32_t max_num_groups_233427;
                        
                        max_num_groups_233427 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212481;
                        num_groups_213787 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229310,
                                                                                 segmap_group_sizze_213786),
                                                                       sext_i32_i64(max_num_groups_233427))));
                        
                        bool suff_outer_par_213791;
                        
                        suff_outer_par_213791 =
                            *ctx->tuning_params.mainzisuff_outer_par_12 <=
                            binop_x_229310;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_12",
                                    (long) binop_x_229310,
                                    suff_outer_par_213791 ? "true" : "false");
                        
                        int64_t one_intra_par_min_213792 = q_s_203575 *
                                s_n_m_203726;
                        int64_t intra_avail_par_213794 = smin64(s_n_m_203726,
                                                                one_intra_par_min_213792);
                        int64_t computed_group_sizze_213795 =
                                smax64(s_n_m_203726, one_intra_par_min_213792);
                        bool fits_213799 = sle64(computed_group_sizze_213795,
                                                 max_group_sizze_206977);
                        bool suff_intra_par_213801;
                        
                        suff_intra_par_213801 =
                            *ctx->tuning_params.mainzisuff_intra_par_13 <=
                            intra_avail_par_213794;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_13",
                                    (long) intra_avail_par_213794,
                                    suff_intra_par_213801 ? "true" : "false");
                        
                        bool intra_suff_and_fits_213802 = fits_213799 &&
                             suff_intra_par_213801;
                        int64_t segmap_group_sizze_214071;
                        
                        segmap_group_sizze_214071 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212912;
                        
                        bool suff_outer_par_214076;
                        
                        suff_outer_par_214076 =
                            *ctx->tuning_params.mainzisuff_outer_par_14 <=
                            nest_sizze_208938;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_14",
                                    (long) nest_sizze_208938,
                                    suff_outer_par_214076 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214194;
                        
                        segmap_group_sizze_214194 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213247;
                        
                        int64_t nest_sizze_214216 = q_s_203575 *
                                nest_sizze_208938;
                        int64_t segred_group_sizze_214217;
                        
                        segred_group_sizze_214217 =
                            *ctx->tuning_params.mainzisegred_group_sizze_213183;
                        
                        int64_t num_groups_214218;
                        int32_t max_num_groups_233428;
                        
                        max_num_groups_233428 =
                            *ctx->tuning_params.mainzisegred_num_groups_213185;
                        num_groups_214218 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214216,
                                                                                 segred_group_sizze_214217),
                                                                       sext_i32_i64(max_num_groups_233428))));
                        
                        int64_t segmap_group_sizze_214276;
                        
                        segmap_group_sizze_214276 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213144;
                        
                        int64_t segred_group_sizze_214312;
                        
                        segred_group_sizze_214312 =
                            *ctx->tuning_params.mainzisegred_group_sizze_213050;
                        
                        int64_t num_groups_214313;
                        int32_t max_num_groups_233429;
                        
                        max_num_groups_233429 =
                            *ctx->tuning_params.mainzisegred_num_groups_213052;
                        num_groups_214313 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214216,
                                                                                 segred_group_sizze_214312),
                                                                       sext_i32_i64(max_num_groups_233429))));
                        
                        int64_t bytes_229841 = (int64_t) 8 * nest_sizze_208938;
                        int64_t bytes_229848 = (int64_t) 8 * nest_sizze_207253;
                        int64_t binop_x_229959 = partition_sizze_203667 *
                                s_n_m_203726;
                        int64_t binop_x_229960 = n_p_203574 * binop_x_229959;
                        int64_t bytes_229961 = (int64_t) 8 * binop_x_229960;
                        int64_t binop_x_229967 = partition_sizze_203667 *
                                defunc_0_f_res_203721;
                        int64_t binop_x_229968 = n_p_203574 * binop_x_229967;
                        int64_t bytes_229969 = (int64_t) 8 * binop_x_229968;
                        int64_t bytes_230023 = smax64((int64_t) 0,
                                                      s_n_m_203726);
                        int64_t bytes_230084 = smax64((int64_t) 0,
                                                      binop_x_229403);
                        int64_t num_threads_232231 = segmap_group_sizze_212349 *
                                num_groups_212350;
                        int64_t total_sizze_232232 = bytes_229396 *
                                num_threads_232231;
                        int64_t total_sizze_232233 = bytes_229396 *
                                num_threads_232231;
                        int64_t num_threads_232234 = segmap_group_sizze_213786 *
                                num_groups_213787;
                        int64_t total_sizze_232235 = bytes_229419 *
                                num_threads_232234;
                        int64_t total_sizze_232236 = bytes_229419 *
                                num_threads_232234;
                        struct memblock_device ext_mem_230165;
                        
                        ext_mem_230165.references = NULL;
                        
                        struct memblock_device ext_mem_230164;
                        
                        ext_mem_230164.references = NULL;
                        
                        int32_t local_memory_capacity_233800;
                        
                        local_memory_capacity_233800 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233800)) &&
                            suff_outer_par_212219) {
                            struct memblock_device mem_229842;
                            
                            mem_229842.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229842,
                                                      bytes_229841,
                                                      "mem_229842")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229842,
                                                                      (int64_t) 0,
                                                                      ext_mem_229470,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229845;
                            
                            mem_229845.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229845,
                                                      binop_y_229332,
                                                      "mem_229845")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229845,
                                                                      (int64_t) 0,
                                                                      ext_mem_229372,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229849;
                            
                            mem_229849.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229849,
                                                      bytes_229848,
                                                      "mem_229849")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229849,
                                                                      (int64_t) 0,
                                                                      mem_229639,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229853;
                            
                            mem_229853.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229853,
                                                      bytes_229841,
                                                      "mem_229853")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229853,
                                                                      (int64_t) 0,
                                                                      ext_mem_229471,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229857;
                            
                            mem_229857.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229857,
                                                      bytes_229848,
                                                      "mem_229857")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229857,
                                                                      (int64_t) 0,
                                                                      mem_229634,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229861;
                            
                            mem_229861.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229861,
                                                      bytes_229848,
                                                      "mem_229861")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229861,
                                                                      (int64_t) 0,
                                                                      ext_mem_229373,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229861,
                                                          "mem_229861") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229954;
                            
                            mem_229954.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229954,
                                                      bytes_229841,
                                                      "mem_229954")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229958;
                            
                            mem_229958.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229958,
                                                      bytes_229841,
                                                      "mem_229958")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232103;
                            
                            color_232103.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232103,
                                                      total_sizze_232232,
                                                      "color_232103")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232104;
                            
                            color_232104.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232104,
                                                      total_sizze_232233,
                                                      "color_232104")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_237636 = mem_229842.mem;
                            CUdeviceptr kernel_arg_237637 = mem_229845.mem;
                            CUdeviceptr kernel_arg_237638 = mem_229849.mem;
                            CUdeviceptr kernel_arg_237639 = mem_229853.mem;
                            CUdeviceptr kernel_arg_237640 = mem_229857.mem;
                            CUdeviceptr kernel_arg_237641 = mem_229861.mem;
                            CUdeviceptr kernel_arg_237642 = mem_229954.mem;
                            CUdeviceptr kernel_arg_237643 = mem_229958.mem;
                            CUdeviceptr kernel_arg_237644 = color_232103.mem;
                            CUdeviceptr kernel_arg_237645 = color_232104.mem;
                            
                            if ((((((1 && num_groups_212350 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_212349 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_212350;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_237633[] =
                                     {&ctx->global_failure, &n_p_203574,
                                      &q_s_203575, &jump_s_203581,
                                      &partition_sizze_203667,
                                      &defunc_0_f_res_203721,
                                      &pad_css_len_203722, &s_n_m_203726,
                                      &num_groups_212350, &num_threads_232231,
                                      &kernel_arg_237636, &kernel_arg_237637,
                                      &kernel_arg_237638, &kernel_arg_237639,
                                      &kernel_arg_237640, &kernel_arg_237641,
                                      &kernel_arg_237642, &kernel_arg_237643,
                                      &kernel_arg_237644, &kernel_arg_237645};
                                int64_t time_start_237634 = 0, time_end_237635 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_212355",
                                            (long) num_groups_212350, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_212349,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_237634 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_212355_runs,
                                                              &ctx->mainzisegmap_212355_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_212355,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_212349,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_237633,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_237635 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_212355",
                                            time_end_237635 -
                                            time_start_237634);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229842,
                                                      "mem_229842") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229845,
                                                      "mem_229845") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229849,
                                                      "mem_229849") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229853,
                                                      "mem_229853") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229857,
                                                      "mem_229857") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229861,
                                                      "mem_229861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232103,
                                                      "color_232103") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232104,
                                                      "color_232104") != 0)
                                return 1;
                            
                            struct memblock_device mem_230156;
                            
                            mem_230156.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230156,
                                                      bytes_229405,
                                                      "mem_230156")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230156,
                                                                      (int64_t) 0,
                                                                      mem_229954,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230156,
                                                          "mem_230156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232104,
                                                          "color_232104") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232103,
                                                          "color_232103") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229958,
                                                          "mem_229958") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229954,
                                                          "mem_229954") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229861,
                                                          "mem_229861") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229954,
                                                      "mem_229954") != 0)
                                return 1;
                            
                            struct memblock_device mem_230162;
                            
                            mem_230162.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230162,
                                                      bytes_229405,
                                                      "mem_230162")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230162,
                                                                      (int64_t) 0,
                                                                      mem_229958,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230162,
                                                          "mem_230162") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230156,
                                                          "mem_230156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232104,
                                                          "color_232104") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232103,
                                                          "color_232103") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229958,
                                                          "mem_229958") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229954,
                                                          "mem_229954") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229861,
                                                          "mem_229861") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229857,
                                                          "mem_229857") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229853,
                                                          "mem_229853") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229849,
                                                          "mem_229849") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229845,
                                                          "mem_229845") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229842,
                                                          "mem_229842") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230164,
                                                          "ext_mem_230164") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230165,
                                                          "ext_mem_230165") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229958,
                                                      "mem_229958") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230165,
                                                    &mem_230156,
                                                    "mem_230156") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230164,
                                                    &mem_230162,
                                                    "mem_230162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230162,
                                                      "mem_230162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230156,
                                                      "mem_230156") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232104,
                                                      "color_232104") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232103,
                                                      "color_232103") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229958,
                                                      "mem_229958") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229954,
                                                      "mem_229954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229861,
                                                      "mem_229861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229857,
                                                      "mem_229857") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229853,
                                                      "mem_229853") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229849,
                                                      "mem_229849") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229845,
                                                      "mem_229845") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229842,
                                                      "mem_229842") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230151;
                            
                            ext_mem_230151.references = NULL;
                            
                            struct memblock_device ext_mem_230150;
                            
                            ext_mem_230150.references = NULL;
                            
                            int32_t local_memory_capacity_233799;
                            
                            local_memory_capacity_233799 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_233799)) &&
                                suff_outer_par_213791) {
                                struct memblock_device mem_229962;
                                
                                mem_229962.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229962,
                                                          bytes_229961,
                                                          "mem_229962")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229962,
                                                                          (int64_t) 0,
                                                                          ext_mem_229471,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229966;
                                
                                mem_229966.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229966,
                                                          bytes_229961,
                                                          "mem_229966")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229966,
                                                                          (int64_t) 0,
                                                                          ext_mem_229470,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229970;
                                
                                mem_229970.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229970,
                                                          bytes_229969,
                                                          "mem_229970")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229970,
                                                                          (int64_t) 0,
                                                                          ext_mem_229373,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229974;
                                
                                mem_229974.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229974,
                                                          bytes_229969,
                                                          "mem_229974")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229974,
                                                                          (int64_t) 0,
                                                                          mem_229639,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229978;
                                
                                mem_229978.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229978,
                                                          bytes_229969,
                                                          "mem_229978")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229978,
                                                                          (int64_t) 0,
                                                                          mem_229634,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229978,
                                                              "mem_229978") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230013;
                                
                                mem_230013.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230013,
                                                          bytes_229961,
                                                          "mem_230013")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230017;
                                
                                mem_230017.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230017,
                                                          bytes_229961,
                                                          "mem_230017")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232105;
                                
                                color_232105.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232105,
                                                          total_sizze_232235,
                                                          "color_232105")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232106;
                                
                                color_232106.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232106,
                                                          total_sizze_232236,
                                                          "color_232106")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_237649 =
                                            ext_mem_229372.mem;
                                CUdeviceptr kernel_arg_237650 = mem_229962.mem;
                                CUdeviceptr kernel_arg_237651 = mem_229966.mem;
                                CUdeviceptr kernel_arg_237652 = mem_229970.mem;
                                CUdeviceptr kernel_arg_237653 = mem_229974.mem;
                                CUdeviceptr kernel_arg_237654 = mem_229978.mem;
                                CUdeviceptr kernel_arg_237655 = mem_230013.mem;
                                CUdeviceptr kernel_arg_237656 = mem_230017.mem;
                                CUdeviceptr kernel_arg_237657 =
                                            color_232105.mem;
                                CUdeviceptr kernel_arg_237658 =
                                            color_232106.mem;
                                
                                if ((((((1 && num_groups_213787 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segmap_group_sizze_213786 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_213787;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_237646[] =
                                         {&ctx->global_failure, &n_p_203574,
                                          &q_s_203575, &jump_s_203581,
                                          &partition_sizze_203667,
                                          &defunc_0_f_res_203721,
                                          &pad_css_len_203722, &s_n_m_203726,
                                          &num_groups_213787,
                                          &num_threads_232234,
                                          &kernel_arg_237649,
                                          &kernel_arg_237650,
                                          &kernel_arg_237651,
                                          &kernel_arg_237652,
                                          &kernel_arg_237653,
                                          &kernel_arg_237654,
                                          &kernel_arg_237655,
                                          &kernel_arg_237656,
                                          &kernel_arg_237657,
                                          &kernel_arg_237658};
                                    int64_t time_start_237647 = 0,
                                            time_end_237648 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_213809",
                                                (long) num_groups_213787,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_213786,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_237647 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_213809_runs,
                                                                  &ctx->mainzisegmap_213809_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_213809,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_213786,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_237646,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_237648 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_213809",
                                                time_end_237648 -
                                                time_start_237647);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_229962,
                                                          "mem_229962") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229966,
                                                          "mem_229966") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229970,
                                                          "mem_229970") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229974,
                                                          "mem_229974") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229978,
                                                          "mem_229978") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232105,
                                                          "color_232105") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232106,
                                                          "color_232106") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230142;
                                
                                mem_230142.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230142,
                                                          bytes_229405,
                                                          "mem_230142")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230142,
                                                                          (int64_t) 0,
                                                                          mem_230013,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230142,
                                                              "mem_230142") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232106,
                                                              "color_232106") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232105,
                                                              "color_232105") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230017,
                                                              "mem_230017") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230013,
                                                              "mem_230013") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229978,
                                                              "mem_229978") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230013,
                                                          "mem_230013") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230148;
                                
                                mem_230148.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230148,
                                                          bytes_229405,
                                                          "mem_230148")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230148,
                                                                          (int64_t) 0,
                                                                          mem_230017,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230148,
                                                              "mem_230148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230142,
                                                              "mem_230142") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232106,
                                                              "color_232106") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232105,
                                                              "color_232105") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230017,
                                                              "mem_230017") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230013,
                                                              "mem_230013") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229978,
                                                              "mem_229978") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229974,
                                                              "mem_229974") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229970,
                                                              "mem_229970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229966,
                                                              "mem_229966") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229962,
                                                              "mem_229962") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230150,
                                                              "ext_mem_230150") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230151,
                                                              "ext_mem_230151") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230164,
                                                              "ext_mem_230164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230165,
                                                              "ext_mem_230165") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230017,
                                                          "mem_230017") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230151,
                                                        &mem_230142,
                                                        "mem_230142") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230150,
                                                        &mem_230148,
                                                        "mem_230148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230148,
                                                          "mem_230148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230142,
                                                          "mem_230142") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232106,
                                                          "color_232106") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232105,
                                                          "color_232105") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230017,
                                                          "mem_230017") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230013,
                                                          "mem_230013") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229978,
                                                          "mem_229978") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229974,
                                                          "mem_229974") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229970,
                                                          "mem_229970") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229966,
                                                          "mem_229966") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229962,
                                                          "mem_229962") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230137;
                                
                                ext_mem_230137.references = NULL;
                                
                                struct memblock_device ext_mem_230136;
                                
                                ext_mem_230136.references = NULL;
                                
                                int32_t local_memory_capacity_233798;
                                
                                local_memory_capacity_233798 =
                                    ctx->cuda.max_shared_memory;
                                if (sle64(bytes_229419 + srem64((int64_t) 8 -
                                                                srem64(bytes_229419,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_230023 + srem64((int64_t) 8 -
                                                                 srem64(bytes_230023,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_233798)) &&
                                    intra_suff_and_fits_213802) {
                                    struct memblock_device mem_230059;
                                    
                                    mem_230059.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230059,
                                                              bytes_229405,
                                                              "mem_230059")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_230064;
                                    
                                    mem_230064.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230064,
                                                              bytes_229405,
                                                              "mem_230064")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    unsigned int shared_sizze_237662 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237664 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237666 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237668 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237670 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237672 =
                                                 bytes_230023;
                                    unsigned int shared_sizze_237674 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237676 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237678 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237680 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237682 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237684 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237686 =
                                                 bytes_229419;
                                    CUdeviceptr kernel_arg_237688 =
                                                ext_mem_229372.mem;
                                    CUdeviceptr kernel_arg_237689 =
                                                ext_mem_229373.mem;
                                    CUdeviceptr kernel_arg_237690 =
                                                ext_mem_229470.mem;
                                    CUdeviceptr kernel_arg_237691 =
                                                ext_mem_229471.mem;
                                    CUdeviceptr kernel_arg_237692 =
                                                mem_229634.mem;
                                    CUdeviceptr kernel_arg_237693 =
                                                mem_229639.mem;
                                    CUdeviceptr kernel_arg_237694 =
                                                mem_230059.mem;
                                    CUdeviceptr kernel_arg_237695 =
                                                mem_230064.mem;
                                    unsigned int shared_offset_237663 = 0;
                                    unsigned int shared_offset_237665 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237667 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8);
                                    unsigned int shared_offset_237669 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237671 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8);
                                    unsigned int shared_offset_237673 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237675 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8);
                                    unsigned int shared_offset_237677 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8) +
                                                 (shared_sizze_237674 + (8 -
                                                                         shared_sizze_237674 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237679 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8) +
                                                 (shared_sizze_237674 + (8 -
                                                                         shared_sizze_237674 %
                                                                         8) %
                                                  8) + (shared_sizze_237676 +
                                                        (8 -
                                                         shared_sizze_237676 %
                                                         8) % 8);
                                    unsigned int shared_offset_237681 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8) +
                                                 (shared_sizze_237674 + (8 -
                                                                         shared_sizze_237674 %
                                                                         8) %
                                                  8) + (shared_sizze_237676 +
                                                        (8 -
                                                         shared_sizze_237676 %
                                                         8) % 8) +
                                                 (shared_sizze_237678 + (8 -
                                                                         shared_sizze_237678 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237683 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8) +
                                                 (shared_sizze_237674 + (8 -
                                                                         shared_sizze_237674 %
                                                                         8) %
                                                  8) + (shared_sizze_237676 +
                                                        (8 -
                                                         shared_sizze_237676 %
                                                         8) % 8) +
                                                 (shared_sizze_237678 + (8 -
                                                                         shared_sizze_237678 %
                                                                         8) %
                                                  8) + (shared_sizze_237680 +
                                                        (8 -
                                                         shared_sizze_237680 %
                                                         8) % 8);
                                    unsigned int shared_offset_237685 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8) +
                                                 (shared_sizze_237674 + (8 -
                                                                         shared_sizze_237674 %
                                                                         8) %
                                                  8) + (shared_sizze_237676 +
                                                        (8 -
                                                         shared_sizze_237676 %
                                                         8) % 8) +
                                                 (shared_sizze_237678 + (8 -
                                                                         shared_sizze_237678 %
                                                                         8) %
                                                  8) + (shared_sizze_237680 +
                                                        (8 -
                                                         shared_sizze_237680 %
                                                         8) % 8) +
                                                 (shared_sizze_237682 + (8 -
                                                                         shared_sizze_237682 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237687 = 0 +
                                                 (shared_sizze_237662 + (8 -
                                                                         shared_sizze_237662 %
                                                                         8) %
                                                  8) + (shared_sizze_237664 +
                                                        (8 -
                                                         shared_sizze_237664 %
                                                         8) % 8) +
                                                 (shared_sizze_237666 + (8 -
                                                                         shared_sizze_237666 %
                                                                         8) %
                                                  8) + (shared_sizze_237668 +
                                                        (8 -
                                                         shared_sizze_237668 %
                                                         8) % 8) +
                                                 (shared_sizze_237670 + (8 -
                                                                         shared_sizze_237670 %
                                                                         8) %
                                                  8) + (shared_sizze_237672 +
                                                        (8 -
                                                         shared_sizze_237672 %
                                                         8) % 8) +
                                                 (shared_sizze_237674 + (8 -
                                                                         shared_sizze_237674 %
                                                                         8) %
                                                  8) + (shared_sizze_237676 +
                                                        (8 -
                                                         shared_sizze_237676 %
                                                         8) % 8) +
                                                 (shared_sizze_237678 + (8 -
                                                                         shared_sizze_237678 %
                                                                         8) %
                                                  8) + (shared_sizze_237680 +
                                                        (8 -
                                                         shared_sizze_237680 %
                                                         8) % 8) +
                                                 (shared_sizze_237682 + (8 -
                                                                         shared_sizze_237682 %
                                                                         8) %
                                                  8) + (shared_sizze_237684 +
                                                        (8 -
                                                         shared_sizze_237684 %
                                                         8) % 8);
                                    
                                    if ((((((1 && binop_x_229310 != 0) && 1 !=
                                            0) && 1 != 0) &&
                                          computed_group_sizze_213795 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = binop_x_229310;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237659[] =
                                             {&ctx->global_failure,
                                              &shared_offset_237663,
                                              &shared_offset_237665,
                                              &shared_offset_237667,
                                              &shared_offset_237669,
                                              &shared_offset_237671,
                                              &shared_offset_237673,
                                              &shared_offset_237675,
                                              &shared_offset_237677,
                                              &shared_offset_237679,
                                              &shared_offset_237681,
                                              &shared_offset_237683,
                                              &shared_offset_237685,
                                              &shared_offset_237687,
                                              &n_p_203574, &q_s_203575,
                                              &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726,
                                              &computed_group_sizze_213795,
                                              &kernel_arg_237688,
                                              &kernel_arg_237689,
                                              &kernel_arg_237690,
                                              &kernel_arg_237691,
                                              &kernel_arg_237692,
                                              &kernel_arg_237693,
                                              &kernel_arg_237694,
                                              &kernel_arg_237695};
                                        int64_t time_start_237660 = 0,
                                                time_end_237661 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segmap_intragroup_213926",
                                                    (long) binop_x_229310,
                                                    (long) 1, (long) 1,
                                                    (long) computed_group_sizze_213795,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_237662 +
                                                            (8 -
                                                             shared_sizze_237662 %
                                                             8) % 8) +
                                                           (shared_sizze_237664 +
                                                            (8 -
                                                             shared_sizze_237664 %
                                                             8) % 8) +
                                                           (shared_sizze_237666 +
                                                            (8 -
                                                             shared_sizze_237666 %
                                                             8) % 8) +
                                                           (shared_sizze_237668 +
                                                            (8 -
                                                             shared_sizze_237668 %
                                                             8) % 8) +
                                                           (shared_sizze_237670 +
                                                            (8 -
                                                             shared_sizze_237670 %
                                                             8) % 8) +
                                                           (shared_sizze_237672 +
                                                            (8 -
                                                             shared_sizze_237672 %
                                                             8) % 8) +
                                                           (shared_sizze_237674 +
                                                            (8 -
                                                             shared_sizze_237674 %
                                                             8) % 8) +
                                                           (shared_sizze_237676 +
                                                            (8 -
                                                             shared_sizze_237676 %
                                                             8) % 8) +
                                                           (shared_sizze_237678 +
                                                            (8 -
                                                             shared_sizze_237678 %
                                                             8) % 8) +
                                                           (shared_sizze_237680 +
                                                            (8 -
                                                             shared_sizze_237680 %
                                                             8) % 8) +
                                                           (shared_sizze_237682 +
                                                            (8 -
                                                             shared_sizze_237682 %
                                                             8) % 8) +
                                                           (shared_sizze_237684 +
                                                            (8 -
                                                             shared_sizze_237684 %
                                                             8) % 8) +
                                                           (shared_sizze_237686 +
                                                            (8 -
                                                             shared_sizze_237686 %
                                                             8) % 8)));
                                            time_start_237660 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_intragroup_213926_runs,
                                                                &ctx->mainzisegmap_intragroup_213926_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_213926,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              computed_group_sizze_213795,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_237662 +
                                                                               (8 -
                                                                                shared_sizze_237662 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237664 +
                                                                               (8 -
                                                                                shared_sizze_237664 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237666 +
                                                                               (8 -
                                                                                shared_sizze_237666 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237668 +
                                                                               (8 -
                                                                                shared_sizze_237668 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237670 +
                                                                               (8 -
                                                                                shared_sizze_237670 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237672 +
                                                                               (8 -
                                                                                shared_sizze_237672 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237674 +
                                                                               (8 -
                                                                                shared_sizze_237674 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237676 +
                                                                               (8 -
                                                                                shared_sizze_237676 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237678 +
                                                                               (8 -
                                                                                shared_sizze_237678 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237680 +
                                                                               (8 -
                                                                                shared_sizze_237680 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237682 +
                                                                               (8 -
                                                                                shared_sizze_237682 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237684 +
                                                                               (8 -
                                                                                shared_sizze_237684 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237686 +
                                                                               (8 -
                                                                                shared_sizze_237686 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_237659,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237661 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_213926",
                                                    time_end_237661 -
                                                    time_start_237660);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230137,
                                                            &mem_230059,
                                                            "mem_230059") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230136,
                                                            &mem_230064,
                                                            "mem_230064") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230064,
                                                              "mem_230064") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230059,
                                                              "mem_230059") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_214072 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_214071);
                                    struct memblock_device ext_mem_230135;
                                    
                                    ext_mem_230135.references = NULL;
                                    
                                    struct memblock_device ext_mem_230134;
                                    
                                    ext_mem_230134.references = NULL;
                                    
                                    int32_t local_memory_capacity_233797;
                                    
                                    local_memory_capacity_233797 =
                                        ctx->cuda.max_shared_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_233797)) &&
                                        suff_outer_par_214076) {
                                        struct memblock_device mem_230070;
                                        
                                        mem_230070.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230070,
                                                                  bytes_229405,
                                                                  "mem_230070")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230075;
                                        
                                        mem_230075.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230075,
                                                                  bytes_229405,
                                                                  "mem_230075")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237699 =
                                                    ext_mem_229372.mem;
                                        CUdeviceptr kernel_arg_237700 =
                                                    ext_mem_229373.mem;
                                        CUdeviceptr kernel_arg_237701 =
                                                    ext_mem_229470.mem;
                                        CUdeviceptr kernel_arg_237702 =
                                                    ext_mem_229471.mem;
                                        CUdeviceptr kernel_arg_237703 =
                                                    mem_229634.mem;
                                        CUdeviceptr kernel_arg_237704 =
                                                    mem_229639.mem;
                                        CUdeviceptr kernel_arg_237705 =
                                                    mem_230070.mem;
                                        CUdeviceptr kernel_arg_237706 =
                                                    mem_230075.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_214072 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_214071 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] =
                                                segmap_usable_groups_214072;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237696[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203574, &q_s_203575,
                                                  &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_237699,
                                                  &kernel_arg_237700,
                                                  &kernel_arg_237701,
                                                  &kernel_arg_237702,
                                                  &kernel_arg_237703,
                                                  &kernel_arg_237704,
                                                  &kernel_arg_237705,
                                                  &kernel_arg_237706};
                                            int64_t time_start_237697 = 0,
                                                    time_end_237698 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segmap_214084",
                                                        (long) segmap_usable_groups_214072,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_214071,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237697 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_214084_runs,
                                                                    &ctx->mainzisegmap_214084_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214084,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_214071,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237696,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237698 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_214084",
                                                        time_end_237698 -
                                                        time_start_237697);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230135,
                                                                &mem_230070,
                                                                "mem_230070") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230134,
                                                                &mem_230075,
                                                                "mem_230075") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230075,
                                                                  "mem_230075") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230070,
                                                                  "mem_230070") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_214195 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_214194);
                                        struct memblock_device mem_230081;
                                        
                                        mem_230081.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230081,
                                                                  bytes_229405,
                                                                  "mem_230081")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230085;
                                        
                                        mem_230085.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230085,
                                                                  bytes_230084,
                                                                  "mem_230085")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237710 =
                                                    mem_230081.mem;
                                        CUdeviceptr kernel_arg_237711 =
                                                    mem_230085.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_214195 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_214194 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] =
                                                segmap_usable_groups_214195;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237707[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203574, &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_237710,
                                                  &kernel_arg_237711};
                                            int64_t time_start_237708 = 0,
                                                    time_end_237709 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segmap_214201",
                                                        (long) segmap_usable_groups_214195,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_214194,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237708 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_214201_runs,
                                                                    &ctx->mainzisegmap_214201_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214201,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_214194,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237707,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237709 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_214201",
                                                        time_end_237709 -
                                                        time_start_237708);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230085,
                                                                  "mem_230085") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230091;
                                        
                                        mem_230091.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230091,
                                                                  bytes_229405,
                                                                  "mem_230091")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230096;
                                        
                                        mem_230096.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230096,
                                                                  bytes_229405,
                                                                  "mem_230096")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230101;
                                        
                                        mem_230101.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230101,
                                                                  bytes_229405,
                                                                  "mem_230101")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_214217)) {
                                            int64_t
                                            segment_sizze_nonzzero_233591 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_233592 =
                                                    num_groups_214218 *
                                                    segred_group_sizze_214217;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214217,
                                                                            segment_sizze_nonzzero_233591),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_214217,
                                                                                                   segment_sizze_nonzzero_233591))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237715 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214217;
                                            unsigned int shared_sizze_237717 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214217;
                                            unsigned int shared_sizze_237719 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214217;
                                            CUdeviceptr kernel_arg_237721 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237722 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237723 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237724 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237725 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237726 =
                                                        mem_230081.mem;
                                            CUdeviceptr kernel_arg_237727 =
                                                        mem_230091.mem;
                                            CUdeviceptr kernel_arg_237728 =
                                                        mem_230096.mem;
                                            CUdeviceptr kernel_arg_237729 =
                                                        mem_230101.mem;
                                            unsigned int shared_offset_237716 =
                                                         0;
                                            unsigned int shared_offset_237718 =
                                                         0 +
                                                         (shared_sizze_237715 +
                                                          (8 -
                                                           shared_sizze_237715 %
                                                           8) % 8);
                                            unsigned int shared_offset_237720 =
                                                         0 +
                                                         (shared_sizze_237715 +
                                                          (8 -
                                                           shared_sizze_237715 %
                                                           8) % 8) +
                                                         (shared_sizze_237717 +
                                                          (8 -
                                                           shared_sizze_237717 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214218 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214217 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_214218;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237712[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237716,
                                                      &shared_offset_237718,
                                                      &shared_offset_237720,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_214218,
                                                      &segment_sizze_nonzzero_233591,
                                                      &kernel_arg_237721,
                                                      &kernel_arg_237722,
                                                      &kernel_arg_237723,
                                                      &kernel_arg_237724,
                                                      &kernel_arg_237725,
                                                      &kernel_arg_237726,
                                                      &kernel_arg_237727,
                                                      &kernel_arg_237728,
                                                      &kernel_arg_237729};
                                                int64_t time_start_237713 = 0,
                                                        time_end_237714 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_small_214227",
                                                            (long) num_groups_214218,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214217,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237715 +
                                                                    (8 -
                                                                     shared_sizze_237715 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237717 +
                                                                    (8 -
                                                                     shared_sizze_237717 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237719 +
                                                                    (8 -
                                                                     shared_sizze_237719 %
                                                                     8) % 8)));
                                                    time_start_237713 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_214227_runs,
                                                                        &ctx->mainzisegred_small_214227_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_214227,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214217,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237715 +
                                                                                       (8 -
                                                                                        shared_sizze_237715 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237717 +
                                                                                       (8 -
                                                                                        shared_sizze_237717 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237719 +
                                                                                       (8 -
                                                                                        shared_sizze_237719 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237712,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237714 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214227",
                                                            time_end_237714 -
                                                            time_start_237713);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233634 =
                                                    sdiv_up64(num_groups_214218,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_233635 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_214217 *
                                                              groups_per_segment_233634);
                                            int64_t virt_num_groups_233636 =
                                                    groups_per_segment_233634 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_233637 =
                                                    num_groups_214218 *
                                                    segred_group_sizze_214217;
                                            int64_t threads_per_segment_233638 =
                                                    groups_per_segment_233634 *
                                                    segred_group_sizze_214217;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233636,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214218,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214217,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233635,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233634,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233639;
                                            
                                            segred_tmp_mem_233639.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233639,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233636,
                                                                      "segred_tmp_mem_233639")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233641;
                                            
                                            segred_tmp_mem_233641.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233641,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233636,
                                                                      "segred_tmp_mem_233641")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233643;
                                            
                                            segred_tmp_mem_233643.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233643,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233636,
                                                                      "segred_tmp_mem_233643")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233645 =
                                            ctx->mainzicounter_mem_233645;
                                            unsigned int shared_sizze_237734 =
                                                         1;
                                            unsigned int shared_sizze_237736 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214217;
                                            unsigned int shared_sizze_237738 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214217;
                                            unsigned int shared_sizze_237740 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214217;
                                            CUdeviceptr kernel_arg_237742 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237743 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237744 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237745 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237746 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237747 =
                                                        mem_230081.mem;
                                            CUdeviceptr kernel_arg_237748 =
                                                        mem_230091.mem;
                                            CUdeviceptr kernel_arg_237749 =
                                                        mem_230096.mem;
                                            CUdeviceptr kernel_arg_237750 =
                                                        mem_230101.mem;
                                            CUdeviceptr kernel_arg_237751 =
                                                        segred_tmp_mem_233639.mem;
                                            CUdeviceptr kernel_arg_237752 =
                                                        segred_tmp_mem_233641.mem;
                                            CUdeviceptr kernel_arg_237753 =
                                                        segred_tmp_mem_233643.mem;
                                            CUdeviceptr kernel_arg_237754 =
                                                        mainzicounter_mem_233645.mem;
                                            unsigned int shared_offset_237735 =
                                                         0;
                                            unsigned int shared_offset_237737 =
                                                         0 +
                                                         (shared_sizze_237734 +
                                                          (8 -
                                                           shared_sizze_237734 %
                                                           8) % 8);
                                            unsigned int shared_offset_237739 =
                                                         0 +
                                                         (shared_sizze_237734 +
                                                          (8 -
                                                           shared_sizze_237734 %
                                                           8) % 8) +
                                                         (shared_sizze_237736 +
                                                          (8 -
                                                           shared_sizze_237736 %
                                                           8) % 8);
                                            unsigned int shared_offset_237741 =
                                                         0 +
                                                         (shared_sizze_237734 +
                                                          (8 -
                                                           shared_sizze_237734 %
                                                           8) % 8) +
                                                         (shared_sizze_237736 +
                                                          (8 -
                                                           shared_sizze_237736 %
                                                           8) % 8) +
                                                         (shared_sizze_237738 +
                                                          (8 -
                                                           shared_sizze_237738 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214218 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214217 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_214218;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237731[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237735,
                                                      &shared_offset_237737,
                                                      &shared_offset_237739,
                                                      &shared_offset_237741,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_214218,
                                                      &groups_per_segment_233634,
                                                      &elements_per_thread_233635,
                                                      &virt_num_groups_233636,
                                                      &threads_per_segment_233638,
                                                      &kernel_arg_237742,
                                                      &kernel_arg_237743,
                                                      &kernel_arg_237744,
                                                      &kernel_arg_237745,
                                                      &kernel_arg_237746,
                                                      &kernel_arg_237747,
                                                      &kernel_arg_237748,
                                                      &kernel_arg_237749,
                                                      &kernel_arg_237750,
                                                      &kernel_arg_237751,
                                                      &kernel_arg_237752,
                                                      &kernel_arg_237753,
                                                      &kernel_arg_237754};
                                                int64_t time_start_237732 = 0,
                                                        time_end_237733 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_large_214227",
                                                            (long) num_groups_214218,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214217,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237734 +
                                                                    (8 -
                                                                     shared_sizze_237734 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237736 +
                                                                    (8 -
                                                                     shared_sizze_237736 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237738 +
                                                                    (8 -
                                                                     shared_sizze_237738 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237740 +
                                                                    (8 -
                                                                     shared_sizze_237740 %
                                                                     8) % 8)));
                                                    time_start_237732 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_214227_runs,
                                                                        &ctx->mainzisegred_large_214227_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_214227,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214217,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237734 +
                                                                                       (8 -
                                                                                        shared_sizze_237734 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237736 +
                                                                                       (8 -
                                                                                        shared_sizze_237736 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237738 +
                                                                                       (8 -
                                                                                        shared_sizze_237738 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237740 +
                                                                                       (8 -
                                                                                        shared_sizze_237740 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237731,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237733 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214227",
                                                            time_end_237733 -
                                                            time_start_237732);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233643,
                                                                      "segred_tmp_mem_233643") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233641,
                                                                      "segred_tmp_mem_233641") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233639,
                                                                      "segred_tmp_mem_233639") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230081,
                                                                  "mem_230081") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_214277 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_214276);
                                        struct memblock_device mem_230107;
                                        
                                        mem_230107.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230107,
                                                                  bytes_229405,
                                                                  "mem_230107")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230112;
                                        
                                        mem_230112.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230112,
                                                                  bytes_229405,
                                                                  "mem_230112")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230117;
                                        
                                        mem_230117.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230117,
                                                                  bytes_229405,
                                                                  "mem_230117")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230122;
                                        
                                        mem_230122.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230122,
                                                                  bytes_229405,
                                                                  "mem_230122")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237758 =
                                                    mem_230091.mem;
                                        CUdeviceptr kernel_arg_237759 =
                                                    mem_230096.mem;
                                        CUdeviceptr kernel_arg_237760 =
                                                    mem_230101.mem;
                                        CUdeviceptr kernel_arg_237761 =
                                                    mem_230107.mem;
                                        CUdeviceptr kernel_arg_237762 =
                                                    mem_230112.mem;
                                        CUdeviceptr kernel_arg_237763 =
                                                    mem_230117.mem;
                                        CUdeviceptr kernel_arg_237764 =
                                                    mem_230122.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_214277 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_214276 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] =
                                                segmap_usable_groups_214277;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237755[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203574, &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_237758,
                                                  &kernel_arg_237759,
                                                  &kernel_arg_237760,
                                                  &kernel_arg_237761,
                                                  &kernel_arg_237762,
                                                  &kernel_arg_237763,
                                                  &kernel_arg_237764};
                                            int64_t time_start_237756 = 0,
                                                    time_end_237757 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segmap_214285",
                                                        (long) segmap_usable_groups_214277,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_214276,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237756 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_214285_runs,
                                                                    &ctx->mainzisegmap_214285_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214285,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_214276,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237755,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237757 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_214285",
                                                        time_end_237757 -
                                                        time_start_237756);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230091,
                                                                  "mem_230091") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230096,
                                                                  "mem_230096") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230101,
                                                                  "mem_230101") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230128;
                                        
                                        mem_230128.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230128,
                                                                  bytes_229405,
                                                                  "mem_230128")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230133;
                                        
                                        mem_230133.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230133,
                                                                  bytes_229405,
                                                                  "mem_230133")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_214312)) {
                                            int64_t
                                            segment_sizze_nonzzero_233707 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_233708 =
                                                    num_groups_214313 *
                                                    segred_group_sizze_214312;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214312,
                                                                            segment_sizze_nonzzero_233707),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_214312,
                                                                                                   segment_sizze_nonzzero_233707))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237768 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214312;
                                            unsigned int shared_sizze_237770 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214312;
                                            CUdeviceptr kernel_arg_237772 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237773 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237774 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237775 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237776 =
                                                        mem_229634.mem;
                                            CUdeviceptr kernel_arg_237777 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237778 =
                                                        mem_230107.mem;
                                            CUdeviceptr kernel_arg_237779 =
                                                        mem_230112.mem;
                                            CUdeviceptr kernel_arg_237780 =
                                                        mem_230117.mem;
                                            CUdeviceptr kernel_arg_237781 =
                                                        mem_230122.mem;
                                            CUdeviceptr kernel_arg_237782 =
                                                        mem_230128.mem;
                                            CUdeviceptr kernel_arg_237783 =
                                                        mem_230133.mem;
                                            unsigned int shared_offset_237769 =
                                                         0;
                                            unsigned int shared_offset_237771 =
                                                         0 +
                                                         (shared_sizze_237768 +
                                                          (8 -
                                                           shared_sizze_237768 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214313 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214312 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_214313;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237765[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237769,
                                                      &shared_offset_237771,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_214313,
                                                      &segment_sizze_nonzzero_233707,
                                                      &kernel_arg_237772,
                                                      &kernel_arg_237773,
                                                      &kernel_arg_237774,
                                                      &kernel_arg_237775,
                                                      &kernel_arg_237776,
                                                      &kernel_arg_237777,
                                                      &kernel_arg_237778,
                                                      &kernel_arg_237779,
                                                      &kernel_arg_237780,
                                                      &kernel_arg_237781,
                                                      &kernel_arg_237782,
                                                      &kernel_arg_237783};
                                                int64_t time_start_237766 = 0,
                                                        time_end_237767 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_small_214321",
                                                            (long) num_groups_214313,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214312,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237768 +
                                                                    (8 -
                                                                     shared_sizze_237768 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237770 +
                                                                    (8 -
                                                                     shared_sizze_237770 %
                                                                     8) % 8)));
                                                    time_start_237766 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_214321_runs,
                                                                        &ctx->mainzisegred_small_214321_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_214321,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214312,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237768 +
                                                                                       (8 -
                                                                                        shared_sizze_237768 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237770 +
                                                                                       (8 -
                                                                                        shared_sizze_237770 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237765,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237767 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214321",
                                                            time_end_237767 -
                                                            time_start_237766);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233744 =
                                                    sdiv_up64(num_groups_214313,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_233745 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_214312 *
                                                              groups_per_segment_233744);
                                            int64_t virt_num_groups_233746 =
                                                    groups_per_segment_233744 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_233747 =
                                                    num_groups_214313 *
                                                    segred_group_sizze_214312;
                                            int64_t threads_per_segment_233748 =
                                                    groups_per_segment_233744 *
                                                    segred_group_sizze_214312;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233746,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214313,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214312,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233745,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233744,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233749;
                                            
                                            segred_tmp_mem_233749.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233749,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233746,
                                                                      "segred_tmp_mem_233749")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233751;
                                            
                                            segred_tmp_mem_233751.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233751,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233746,
                                                                      "segred_tmp_mem_233751")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233753 =
                                            ctx->mainzicounter_mem_233753;
                                            unsigned int shared_sizze_237788 =
                                                         1;
                                            unsigned int shared_sizze_237790 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214312;
                                            unsigned int shared_sizze_237792 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_214312;
                                            CUdeviceptr kernel_arg_237794 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237795 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237796 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237797 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237798 =
                                                        mem_229634.mem;
                                            CUdeviceptr kernel_arg_237799 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237800 =
                                                        mem_230107.mem;
                                            CUdeviceptr kernel_arg_237801 =
                                                        mem_230112.mem;
                                            CUdeviceptr kernel_arg_237802 =
                                                        mem_230117.mem;
                                            CUdeviceptr kernel_arg_237803 =
                                                        mem_230122.mem;
                                            CUdeviceptr kernel_arg_237804 =
                                                        mem_230128.mem;
                                            CUdeviceptr kernel_arg_237805 =
                                                        mem_230133.mem;
                                            CUdeviceptr kernel_arg_237806 =
                                                        segred_tmp_mem_233749.mem;
                                            CUdeviceptr kernel_arg_237807 =
                                                        segred_tmp_mem_233751.mem;
                                            CUdeviceptr kernel_arg_237808 =
                                                        mainzicounter_mem_233753.mem;
                                            unsigned int shared_offset_237789 =
                                                         0;
                                            unsigned int shared_offset_237791 =
                                                         0 +
                                                         (shared_sizze_237788 +
                                                          (8 -
                                                           shared_sizze_237788 %
                                                           8) % 8);
                                            unsigned int shared_offset_237793 =
                                                         0 +
                                                         (shared_sizze_237788 +
                                                          (8 -
                                                           shared_sizze_237788 %
                                                           8) % 8) +
                                                         (shared_sizze_237790 +
                                                          (8 -
                                                           shared_sizze_237790 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_214313 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_214312 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_214313;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237785[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237789,
                                                      &shared_offset_237791,
                                                      &shared_offset_237793,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_214313,
                                                      &groups_per_segment_233744,
                                                      &elements_per_thread_233745,
                                                      &virt_num_groups_233746,
                                                      &threads_per_segment_233748,
                                                      &kernel_arg_237794,
                                                      &kernel_arg_237795,
                                                      &kernel_arg_237796,
                                                      &kernel_arg_237797,
                                                      &kernel_arg_237798,
                                                      &kernel_arg_237799,
                                                      &kernel_arg_237800,
                                                      &kernel_arg_237801,
                                                      &kernel_arg_237802,
                                                      &kernel_arg_237803,
                                                      &kernel_arg_237804,
                                                      &kernel_arg_237805,
                                                      &kernel_arg_237806,
                                                      &kernel_arg_237807,
                                                      &kernel_arg_237808};
                                                int64_t time_start_237786 = 0,
                                                        time_end_237787 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_large_214321",
                                                            (long) num_groups_214313,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_214312,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237788 +
                                                                    (8 -
                                                                     shared_sizze_237788 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237790 +
                                                                    (8 -
                                                                     shared_sizze_237790 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237792 +
                                                                    (8 -
                                                                     shared_sizze_237792 %
                                                                     8) % 8)));
                                                    time_start_237786 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_214321_runs,
                                                                        &ctx->mainzisegred_large_214321_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_214321,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_214312,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237788 +
                                                                                       (8 -
                                                                                        shared_sizze_237788 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237790 +
                                                                                       (8 -
                                                                                        shared_sizze_237790 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237792 +
                                                                                       (8 -
                                                                                        shared_sizze_237792 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237785,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237787 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214321",
                                                            time_end_237787 -
                                                            time_start_237786);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233751,
                                                                      "segred_tmp_mem_233751") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233749,
                                                                      "segred_tmp_mem_233749") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230107,
                                                                  "mem_230107") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230112,
                                                                  "mem_230112") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230117,
                                                                  "mem_230117") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230122,
                                                                  "mem_230122") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230135,
                                                                &mem_230128,
                                                                "mem_230128") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230134,
                                                                &mem_230133,
                                                                "mem_230133") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230133,
                                                                  "mem_230133") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230128,
                                                                  "mem_230128") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230122,
                                                                  "mem_230122") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230117,
                                                                  "mem_230117") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230112,
                                                                  "mem_230112") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230107,
                                                                  "mem_230107") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230101,
                                                                  "mem_230101") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230096,
                                                                  "mem_230096") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230091,
                                                                  "mem_230091") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230085,
                                                                  "mem_230085") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230081,
                                                                  "mem_230081") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230137,
                                                            &ext_mem_230135,
                                                            "ext_mem_230135") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230136,
                                                            &ext_mem_230134,
                                                            "ext_mem_230134") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230134,
                                                              "ext_mem_230134") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230135,
                                                              "ext_mem_230135") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230151,
                                                        &ext_mem_230137,
                                                        "ext_mem_230137") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230150,
                                                        &ext_mem_230136,
                                                        "ext_mem_230136") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230136,
                                                          "ext_mem_230136") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230137,
                                                          "ext_mem_230137") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230165,
                                                    &ext_mem_230151,
                                                    "ext_mem_230151") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230164,
                                                    &ext_mem_230150,
                                                    "ext_mem_230150") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230150,
                                                      "ext_mem_230150") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230151,
                                                      "ext_mem_230151") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230526,
                                                &ext_mem_230165,
                                                "ext_mem_230165") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230525,
                                                &ext_mem_230164,
                                                "ext_mem_230164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230164,
                                                  "ext_mem_230164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230165,
                                                  "ext_mem_230165") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_214392;
                        
                        suff_outer_par_214392 =
                            *ctx->tuning_params.mainzisuff_outer_par_15 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_15",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_214392 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214554;
                        
                        segmap_group_sizze_214554 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214396;
                        
                        int64_t num_groups_214555;
                        int32_t max_num_groups_233801;
                        
                        max_num_groups_233801 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214398;
                        num_groups_214555 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_214554),
                                                                       sext_i32_i64(max_num_groups_233801))));
                        
                        int64_t segmap_group_sizze_216329;
                        
                        segmap_group_sizze_216329 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214716;
                        
                        int64_t num_groups_216330;
                        int32_t max_num_groups_233802;
                        
                        max_num_groups_233802 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214718;
                        num_groups_216330 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229310,
                                                                                 segmap_group_sizze_216329),
                                                                       sext_i32_i64(max_num_groups_233802))));
                        
                        bool suff_outer_par_216334;
                        
                        suff_outer_par_216334 =
                            *ctx->tuning_params.mainzisuff_outer_par_16 <=
                            binop_x_229310;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_16",
                                    (long) binop_x_229310,
                                    suff_outer_par_216334 ? "true" : "false");
                        
                        int64_t one_intra_par_min_216335 = q_s_203575 *
                                s_n_m_203726;
                        int64_t intra_avail_par_216337 = smin64(s_n_m_203726,
                                                                one_intra_par_min_216335);
                        int64_t computed_group_sizze_216338 =
                                smax64(s_n_m_203726, one_intra_par_min_216335);
                        bool fits_216342 = sle64(computed_group_sizze_216338,
                                                 max_group_sizze_206977);
                        bool suff_intra_par_216344;
                        
                        suff_intra_par_216344 =
                            *ctx->tuning_params.mainzisuff_intra_par_17 <=
                            intra_avail_par_216337;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_17",
                                    (long) intra_avail_par_216337,
                                    suff_intra_par_216344 ? "true" : "false");
                        
                        bool intra_suff_and_fits_216345 = fits_216342 &&
                             suff_intra_par_216344;
                        int64_t segmap_group_sizze_216684;
                        
                        segmap_group_sizze_216684 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215257;
                        
                        bool suff_outer_par_216689;
                        
                        suff_outer_par_216689 =
                            *ctx->tuning_params.mainzisuff_outer_par_18 <=
                            nest_sizze_208938;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_18",
                                    (long) nest_sizze_208938,
                                    suff_outer_par_216689 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_216839;
                        
                        segmap_group_sizze_216839 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215674;
                        
                        int64_t nest_sizze_216861 = q_s_203575 *
                                nest_sizze_208938;
                        int64_t segred_group_sizze_216862;
                        
                        segred_group_sizze_216862 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215602;
                        
                        int64_t num_groups_216863;
                        int32_t max_num_groups_233803;
                        
                        max_num_groups_233803 =
                            *ctx->tuning_params.mainzisegred_num_groups_215604;
                        num_groups_216863 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216861,
                                                                                 segred_group_sizze_216862),
                                                                       sext_i32_i64(max_num_groups_233803))));
                        
                        int64_t segmap_group_sizze_216931;
                        
                        segmap_group_sizze_216931 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215544;
                        
                        int64_t segred_group_sizze_216988;
                        
                        segred_group_sizze_216988 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215433;
                        
                        int64_t num_groups_216989;
                        int32_t max_num_groups_233804;
                        
                        max_num_groups_233804 =
                            *ctx->tuning_params.mainzisegred_num_groups_215435;
                        num_groups_216989 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216861,
                                                                                 segred_group_sizze_216988),
                                                                       sext_i32_i64(max_num_groups_233804))));
                        
                        int64_t bytes_230168 = (int64_t) 8 * nest_sizze_208938;
                        int64_t bytes_230175 = (int64_t) 8 * nest_sizze_207253;
                        int64_t binop_x_230286 = partition_sizze_203667 *
                                s_n_m_203726;
                        int64_t binop_x_230287 = n_p_203574 * binop_x_230286;
                        int64_t bytes_230288 = (int64_t) 8 * binop_x_230287;
                        int64_t binop_x_230294 = partition_sizze_203667 *
                                defunc_0_f_res_203721;
                        int64_t binop_x_230295 = n_p_203574 * binop_x_230294;
                        int64_t bytes_230296 = (int64_t) 8 * binop_x_230295;
                        int64_t bytes_230350 = smax64((int64_t) 0,
                                                      s_n_m_203726);
                        int64_t bytes_230423 = smax64((int64_t) 0,
                                                      binop_x_229403);
                        int64_t num_threads_232243 = segmap_group_sizze_214554 *
                                num_groups_214555;
                        int64_t total_sizze_232244 = bytes_229396 *
                                num_threads_232243;
                        int64_t total_sizze_232245 = bytes_229396 *
                                num_threads_232243;
                        int64_t num_threads_232246 = segmap_group_sizze_216329 *
                                num_groups_216330;
                        int64_t total_sizze_232247 = bytes_229419 *
                                num_threads_232246;
                        int64_t total_sizze_232248 = bytes_229419 *
                                num_threads_232246;
                        struct memblock_device ext_mem_230524;
                        
                        ext_mem_230524.references = NULL;
                        
                        struct memblock_device ext_mem_230523;
                        
                        ext_mem_230523.references = NULL;
                        
                        int32_t local_memory_capacity_234225;
                        
                        local_memory_capacity_234225 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_234225)) &&
                            suff_outer_par_214392) {
                            struct memblock_device mem_230169;
                            
                            mem_230169.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230169,
                                                      bytes_230168,
                                                      "mem_230169")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230169,
                                                                      (int64_t) 0,
                                                                      ext_mem_229470,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230172;
                            
                            mem_230172.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230172,
                                                      binop_y_229332,
                                                      "mem_230172")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230172,
                                                                      (int64_t) 0,
                                                                      ext_mem_229372,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230176;
                            
                            mem_230176.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230176,
                                                      bytes_230175,
                                                      "mem_230176")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230176,
                                                                      (int64_t) 0,
                                                                      mem_229639,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230180;
                            
                            mem_230180.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230180,
                                                      bytes_230168,
                                                      "mem_230180")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230180,
                                                                      (int64_t) 0,
                                                                      ext_mem_229471,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      s_n_m_203726,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230184;
                            
                            mem_230184.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230184,
                                                      bytes_230175,
                                                      "mem_230184")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230184,
                                                                      (int64_t) 0,
                                                                      mem_229634,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230188;
                            
                            mem_230188.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230188,
                                                      bytes_230175,
                                                      "mem_230188")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230188,
                                                                      (int64_t) 0,
                                                                      ext_mem_229373,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203574 *
                                                                      defunc_0_f_res_203721,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230188,
                                                          "mem_230188") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230281;
                            
                            mem_230281.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230281,
                                                      bytes_230168,
                                                      "mem_230281")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230285;
                            
                            mem_230285.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230285,
                                                      bytes_230168,
                                                      "mem_230285")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232115;
                            
                            color_232115.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232115,
                                                      total_sizze_232244,
                                                      "color_232115")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232116;
                            
                            color_232116.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232116,
                                                      total_sizze_232245,
                                                      "color_232116")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_237812 = mem_230169.mem;
                            CUdeviceptr kernel_arg_237813 = mem_230172.mem;
                            CUdeviceptr kernel_arg_237814 = mem_230176.mem;
                            CUdeviceptr kernel_arg_237815 = mem_230180.mem;
                            CUdeviceptr kernel_arg_237816 = mem_230184.mem;
                            CUdeviceptr kernel_arg_237817 = mem_230188.mem;
                            CUdeviceptr kernel_arg_237818 = mem_230281.mem;
                            CUdeviceptr kernel_arg_237819 = mem_230285.mem;
                            CUdeviceptr kernel_arg_237820 = color_232115.mem;
                            CUdeviceptr kernel_arg_237821 = color_232116.mem;
                            
                            if ((((((1 && num_groups_214555 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_214554 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_214555;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_237809[] =
                                     {&ctx->global_failure, &n_p_203574,
                                      &q_s_203575, &jump_s_203581,
                                      &partition_sizze_203667,
                                      &defunc_0_f_res_203721,
                                      &pad_css_len_203722, &s_n_m_203726,
                                      &num_groups_214555, &num_threads_232243,
                                      &kernel_arg_237812, &kernel_arg_237813,
                                      &kernel_arg_237814, &kernel_arg_237815,
                                      &kernel_arg_237816, &kernel_arg_237817,
                                      &kernel_arg_237818, &kernel_arg_237819,
                                      &kernel_arg_237820, &kernel_arg_237821};
                                int64_t time_start_237810 = 0, time_end_237811 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_214560",
                                            (long) num_groups_214555, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_214554,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_237810 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_214560_runs,
                                                              &ctx->mainzisegmap_214560_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_214560,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_214554,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_237809,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_237811 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_214560",
                                            time_end_237811 -
                                            time_start_237810);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230169,
                                                      "mem_230169") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230172,
                                                      "mem_230172") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230176,
                                                      "mem_230176") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230180,
                                                      "mem_230180") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230184,
                                                      "mem_230184") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230188,
                                                      "mem_230188") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232115,
                                                      "color_232115") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232116,
                                                      "color_232116") != 0)
                                return 1;
                            
                            struct memblock_device mem_230515;
                            
                            mem_230515.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230515,
                                                      bytes_229405,
                                                      "mem_230515")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230515,
                                                                      (int64_t) 0,
                                                                      mem_230281,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230515,
                                                          "mem_230515") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232116,
                                                          "color_232116") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232115,
                                                          "color_232115") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230285,
                                                          "mem_230285") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230281,
                                                          "mem_230281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230188,
                                                          "mem_230188") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230281,
                                                      "mem_230281") != 0)
                                return 1;
                            
                            struct memblock_device mem_230521;
                            
                            mem_230521.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230521,
                                                      bytes_229405,
                                                      "mem_230521")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230521,
                                                                      (int64_t) 0,
                                                                      mem_230285,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      n_p_203574 *
                                                                      s_n_m_203726) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230521,
                                                          "mem_230521") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230515,
                                                          "mem_230515") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232116,
                                                          "color_232116") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232115,
                                                          "color_232115") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230285,
                                                          "mem_230285") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230281,
                                                          "mem_230281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230188,
                                                          "mem_230188") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230184,
                                                          "mem_230184") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230180,
                                                          "mem_230180") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230176,
                                                          "mem_230176") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230172,
                                                          "mem_230172") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230169,
                                                          "mem_230169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230523,
                                                          "ext_mem_230523") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230524,
                                                          "ext_mem_230524") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230525,
                                                          "ext_mem_230525") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230526,
                                                          "ext_mem_230526") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230527,
                                                          "ext_mem_230527") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230528,
                                                          "ext_mem_230528") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230285,
                                                      "mem_230285") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230524,
                                                    &mem_230515,
                                                    "mem_230515") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230523,
                                                    &mem_230521,
                                                    "mem_230521") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230521,
                                                      "mem_230521") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230515,
                                                      "mem_230515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232116,
                                                      "color_232116") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232115,
                                                      "color_232115") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230285,
                                                      "mem_230285") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230281,
                                                      "mem_230281") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230188,
                                                      "mem_230188") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230184,
                                                      "mem_230184") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230180,
                                                      "mem_230180") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230176,
                                                      "mem_230176") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230172,
                                                      "mem_230172") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230169,
                                                      "mem_230169") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230510;
                            
                            ext_mem_230510.references = NULL;
                            
                            struct memblock_device ext_mem_230509;
                            
                            ext_mem_230509.references = NULL;
                            
                            int32_t local_memory_capacity_234224;
                            
                            local_memory_capacity_234224 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_234224)) &&
                                suff_outer_par_216334) {
                                struct memblock_device mem_230289;
                                
                                mem_230289.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230289,
                                                          bytes_230288,
                                                          "mem_230289")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230289,
                                                                          (int64_t) 0,
                                                                          ext_mem_229471,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230293;
                                
                                mem_230293.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230293,
                                                          bytes_230288,
                                                          "mem_230293")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230293,
                                                                          (int64_t) 0,
                                                                          ext_mem_229470,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203726,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230297;
                                
                                mem_230297.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230297,
                                                          bytes_230296,
                                                          "mem_230297")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230297,
                                                                          (int64_t) 0,
                                                                          ext_mem_229373,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230301;
                                
                                mem_230301.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230301,
                                                          bytes_230296,
                                                          "mem_230301")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230301,
                                                                          (int64_t) 0,
                                                                          mem_229639,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230305;
                                
                                mem_230305.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230305,
                                                          bytes_230296,
                                                          "mem_230305")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230305,
                                                                          (int64_t) 0,
                                                                          mem_229634,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203721,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230305,
                                                              "mem_230305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230340;
                                
                                mem_230340.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230340,
                                                          bytes_230288,
                                                          "mem_230340")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230344;
                                
                                mem_230344.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230344,
                                                          bytes_230288,
                                                          "mem_230344")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232117;
                                
                                color_232117.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232117,
                                                          total_sizze_232247,
                                                          "color_232117")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232118;
                                
                                color_232118.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232118,
                                                          total_sizze_232248,
                                                          "color_232118")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_237825 =
                                            ext_mem_229372.mem;
                                CUdeviceptr kernel_arg_237826 = mem_230289.mem;
                                CUdeviceptr kernel_arg_237827 = mem_230293.mem;
                                CUdeviceptr kernel_arg_237828 = mem_230297.mem;
                                CUdeviceptr kernel_arg_237829 = mem_230301.mem;
                                CUdeviceptr kernel_arg_237830 = mem_230305.mem;
                                CUdeviceptr kernel_arg_237831 = mem_230340.mem;
                                CUdeviceptr kernel_arg_237832 = mem_230344.mem;
                                CUdeviceptr kernel_arg_237833 =
                                            color_232117.mem;
                                CUdeviceptr kernel_arg_237834 =
                                            color_232118.mem;
                                
                                if ((((((1 && num_groups_216330 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segmap_group_sizze_216329 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_216330;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_237822[] =
                                         {&ctx->global_failure, &n_p_203574,
                                          &q_s_203575, &jump_s_203581,
                                          &partition_sizze_203667,
                                          &defunc_0_f_res_203721,
                                          &pad_css_len_203722, &s_n_m_203726,
                                          &num_groups_216330,
                                          &num_threads_232246,
                                          &kernel_arg_237825,
                                          &kernel_arg_237826,
                                          &kernel_arg_237827,
                                          &kernel_arg_237828,
                                          &kernel_arg_237829,
                                          &kernel_arg_237830,
                                          &kernel_arg_237831,
                                          &kernel_arg_237832,
                                          &kernel_arg_237833,
                                          &kernel_arg_237834};
                                    int64_t time_start_237823 = 0,
                                            time_end_237824 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_216352",
                                                (long) num_groups_216330,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_216329,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_237823 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_216352_runs,
                                                                  &ctx->mainzisegmap_216352_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216352,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_216329,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_237822,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_237824 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_216352",
                                                time_end_237824 -
                                                time_start_237823);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230289,
                                                          "mem_230289") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230293,
                                                          "mem_230293") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230297,
                                                          "mem_230297") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230301,
                                                          "mem_230301") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230305,
                                                          "mem_230305") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232117,
                                                          "color_232117") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232118,
                                                          "color_232118") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230501;
                                
                                mem_230501.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230501,
                                                          bytes_229405,
                                                          "mem_230501")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230501,
                                                                          (int64_t) 0,
                                                                          mem_230340,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230501,
                                                              "mem_230501") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232118,
                                                              "color_232118") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232117,
                                                              "color_232117") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230344,
                                                              "mem_230344") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230340,
                                                              "mem_230340") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230305,
                                                              "mem_230305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230340,
                                                          "mem_230340") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230507;
                                
                                mem_230507.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230507,
                                                          bytes_229405,
                                                          "mem_230507")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230507,
                                                                          (int64_t) 0,
                                                                          mem_230344,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203667 *
                                                                          n_p_203574,
                                                                          s_n_m_203726) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230507,
                                                              "mem_230507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230501,
                                                              "mem_230501") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232118,
                                                              "color_232118") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232117,
                                                              "color_232117") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230344,
                                                              "mem_230344") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230340,
                                                              "mem_230340") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230305,
                                                              "mem_230305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230301,
                                                              "mem_230301") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230297,
                                                              "mem_230297") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230293,
                                                              "mem_230293") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230289,
                                                              "mem_230289") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230509,
                                                              "ext_mem_230509") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230510,
                                                              "ext_mem_230510") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230523,
                                                              "ext_mem_230523") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230524,
                                                              "ext_mem_230524") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230525,
                                                              "ext_mem_230525") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230526,
                                                              "ext_mem_230526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230527,
                                                              "ext_mem_230527") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230528,
                                                              "ext_mem_230528") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230594,
                                                              "ext_mem_230594") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230595,
                                                              "ext_mem_230595") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230344,
                                                          "mem_230344") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230510,
                                                        &mem_230501,
                                                        "mem_230501") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230509,
                                                        &mem_230507,
                                                        "mem_230507") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230507,
                                                          "mem_230507") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230501,
                                                          "mem_230501") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232118,
                                                          "color_232118") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232117,
                                                          "color_232117") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230344,
                                                          "mem_230344") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230340,
                                                          "mem_230340") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230305,
                                                          "mem_230305") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230301,
                                                          "mem_230301") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230297,
                                                          "mem_230297") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230293,
                                                          "mem_230293") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230289,
                                                          "mem_230289") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230496;
                                
                                ext_mem_230496.references = NULL;
                                
                                struct memblock_device ext_mem_230495;
                                
                                ext_mem_230495.references = NULL;
                                
                                int32_t local_memory_capacity_234223;
                                
                                local_memory_capacity_234223 =
                                    ctx->cuda.max_shared_memory;
                                if (sle64(bytes_229419 + srem64((int64_t) 8 -
                                                                srem64(bytes_229419,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229419 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229419,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_230350 + srem64((int64_t) 8 -
                                                                 srem64(bytes_230350,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203726 *
                                                                    q_s_203575) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203726 *
                                                                                  q_s_203575),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203726 *
                                                          q_s_203575) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203726 *
                                                          q_s_203575),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_234223)) &&
                                    intra_suff_and_fits_216345) {
                                    struct memblock_device mem_230398;
                                    
                                    mem_230398.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230398,
                                                              bytes_229405,
                                                              "mem_230398")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_230403;
                                    
                                    mem_230403.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230403,
                                                              bytes_229405,
                                                              "mem_230403")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    
                                    unsigned int shared_sizze_237838 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237840 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237842 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237844 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237846 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237848 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237850 =
                                                 (int64_t) 8 * (s_n_m_203726 *
                                                                q_s_203575);
                                    unsigned int shared_sizze_237852 =
                                                 bytes_230350;
                                    unsigned int shared_sizze_237854 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237856 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237858 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237860 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237862 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237864 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237866 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237868 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237870 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237872 =
                                                 bytes_229419;
                                    unsigned int shared_sizze_237874 =
                                                 bytes_229419;
                                    CUdeviceptr kernel_arg_237876 =
                                                ext_mem_229372.mem;
                                    CUdeviceptr kernel_arg_237877 =
                                                ext_mem_229373.mem;
                                    CUdeviceptr kernel_arg_237878 =
                                                ext_mem_229470.mem;
                                    CUdeviceptr kernel_arg_237879 =
                                                ext_mem_229471.mem;
                                    CUdeviceptr kernel_arg_237880 =
                                                mem_229634.mem;
                                    CUdeviceptr kernel_arg_237881 =
                                                mem_229639.mem;
                                    CUdeviceptr kernel_arg_237882 =
                                                mem_230398.mem;
                                    CUdeviceptr kernel_arg_237883 =
                                                mem_230403.mem;
                                    unsigned int shared_offset_237839 = 0;
                                    unsigned int shared_offset_237841 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237843 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8);
                                    unsigned int shared_offset_237845 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237847 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8);
                                    unsigned int shared_offset_237849 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237851 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8);
                                    unsigned int shared_offset_237853 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237855 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8);
                                    unsigned int shared_offset_237857 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237859 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8);
                                    unsigned int shared_offset_237861 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237863 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8);
                                    unsigned int shared_offset_237865 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8) +
                                                 (shared_sizze_237862 + (8 -
                                                                         shared_sizze_237862 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237867 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8) +
                                                 (shared_sizze_237862 + (8 -
                                                                         shared_sizze_237862 %
                                                                         8) %
                                                  8) + (shared_sizze_237864 +
                                                        (8 -
                                                         shared_sizze_237864 %
                                                         8) % 8);
                                    unsigned int shared_offset_237869 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8) +
                                                 (shared_sizze_237862 + (8 -
                                                                         shared_sizze_237862 %
                                                                         8) %
                                                  8) + (shared_sizze_237864 +
                                                        (8 -
                                                         shared_sizze_237864 %
                                                         8) % 8) +
                                                 (shared_sizze_237866 + (8 -
                                                                         shared_sizze_237866 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237871 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8) +
                                                 (shared_sizze_237862 + (8 -
                                                                         shared_sizze_237862 %
                                                                         8) %
                                                  8) + (shared_sizze_237864 +
                                                        (8 -
                                                         shared_sizze_237864 %
                                                         8) % 8) +
                                                 (shared_sizze_237866 + (8 -
                                                                         shared_sizze_237866 %
                                                                         8) %
                                                  8) + (shared_sizze_237868 +
                                                        (8 -
                                                         shared_sizze_237868 %
                                                         8) % 8);
                                    unsigned int shared_offset_237873 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8) +
                                                 (shared_sizze_237862 + (8 -
                                                                         shared_sizze_237862 %
                                                                         8) %
                                                  8) + (shared_sizze_237864 +
                                                        (8 -
                                                         shared_sizze_237864 %
                                                         8) % 8) +
                                                 (shared_sizze_237866 + (8 -
                                                                         shared_sizze_237866 %
                                                                         8) %
                                                  8) + (shared_sizze_237868 +
                                                        (8 -
                                                         shared_sizze_237868 %
                                                         8) % 8) +
                                                 (shared_sizze_237870 + (8 -
                                                                         shared_sizze_237870 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_237875 = 0 +
                                                 (shared_sizze_237838 + (8 -
                                                                         shared_sizze_237838 %
                                                                         8) %
                                                  8) + (shared_sizze_237840 +
                                                        (8 -
                                                         shared_sizze_237840 %
                                                         8) % 8) +
                                                 (shared_sizze_237842 + (8 -
                                                                         shared_sizze_237842 %
                                                                         8) %
                                                  8) + (shared_sizze_237844 +
                                                        (8 -
                                                         shared_sizze_237844 %
                                                         8) % 8) +
                                                 (shared_sizze_237846 + (8 -
                                                                         shared_sizze_237846 %
                                                                         8) %
                                                  8) + (shared_sizze_237848 +
                                                        (8 -
                                                         shared_sizze_237848 %
                                                         8) % 8) +
                                                 (shared_sizze_237850 + (8 -
                                                                         shared_sizze_237850 %
                                                                         8) %
                                                  8) + (shared_sizze_237852 +
                                                        (8 -
                                                         shared_sizze_237852 %
                                                         8) % 8) +
                                                 (shared_sizze_237854 + (8 -
                                                                         shared_sizze_237854 %
                                                                         8) %
                                                  8) + (shared_sizze_237856 +
                                                        (8 -
                                                         shared_sizze_237856 %
                                                         8) % 8) +
                                                 (shared_sizze_237858 + (8 -
                                                                         shared_sizze_237858 %
                                                                         8) %
                                                  8) + (shared_sizze_237860 +
                                                        (8 -
                                                         shared_sizze_237860 %
                                                         8) % 8) +
                                                 (shared_sizze_237862 + (8 -
                                                                         shared_sizze_237862 %
                                                                         8) %
                                                  8) + (shared_sizze_237864 +
                                                        (8 -
                                                         shared_sizze_237864 %
                                                         8) % 8) +
                                                 (shared_sizze_237866 + (8 -
                                                                         shared_sizze_237866 %
                                                                         8) %
                                                  8) + (shared_sizze_237868 +
                                                        (8 -
                                                         shared_sizze_237868 %
                                                         8) % 8) +
                                                 (shared_sizze_237870 + (8 -
                                                                         shared_sizze_237870 %
                                                                         8) %
                                                  8) + (shared_sizze_237872 +
                                                        (8 -
                                                         shared_sizze_237872 %
                                                         8) % 8);
                                    
                                    if ((((((1 && binop_x_229310 != 0) && 1 !=
                                            0) && 1 != 0) &&
                                          computed_group_sizze_216338 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = binop_x_229310;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_237835[] =
                                             {&ctx->global_failure,
                                              &shared_offset_237839,
                                              &shared_offset_237841,
                                              &shared_offset_237843,
                                              &shared_offset_237845,
                                              &shared_offset_237847,
                                              &shared_offset_237849,
                                              &shared_offset_237851,
                                              &shared_offset_237853,
                                              &shared_offset_237855,
                                              &shared_offset_237857,
                                              &shared_offset_237859,
                                              &shared_offset_237861,
                                              &shared_offset_237863,
                                              &shared_offset_237865,
                                              &shared_offset_237867,
                                              &shared_offset_237869,
                                              &shared_offset_237871,
                                              &shared_offset_237873,
                                              &shared_offset_237875,
                                              &n_p_203574, &q_s_203575,
                                              &jump_s_203581,
                                              &partition_sizze_203667,
                                              &defunc_0_f_res_203721,
                                              &pad_css_len_203722,
                                              &s_n_m_203726,
                                              &computed_group_sizze_216338,
                                              &kernel_arg_237876,
                                              &kernel_arg_237877,
                                              &kernel_arg_237878,
                                              &kernel_arg_237879,
                                              &kernel_arg_237880,
                                              &kernel_arg_237881,
                                              &kernel_arg_237882,
                                              &kernel_arg_237883};
                                        int64_t time_start_237836 = 0,
                                                time_end_237837 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segmap_intragroup_216501",
                                                    (long) binop_x_229310,
                                                    (long) 1, (long) 1,
                                                    (long) computed_group_sizze_216338,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_237838 +
                                                            (8 -
                                                             shared_sizze_237838 %
                                                             8) % 8) +
                                                           (shared_sizze_237840 +
                                                            (8 -
                                                             shared_sizze_237840 %
                                                             8) % 8) +
                                                           (shared_sizze_237842 +
                                                            (8 -
                                                             shared_sizze_237842 %
                                                             8) % 8) +
                                                           (shared_sizze_237844 +
                                                            (8 -
                                                             shared_sizze_237844 %
                                                             8) % 8) +
                                                           (shared_sizze_237846 +
                                                            (8 -
                                                             shared_sizze_237846 %
                                                             8) % 8) +
                                                           (shared_sizze_237848 +
                                                            (8 -
                                                             shared_sizze_237848 %
                                                             8) % 8) +
                                                           (shared_sizze_237850 +
                                                            (8 -
                                                             shared_sizze_237850 %
                                                             8) % 8) +
                                                           (shared_sizze_237852 +
                                                            (8 -
                                                             shared_sizze_237852 %
                                                             8) % 8) +
                                                           (shared_sizze_237854 +
                                                            (8 -
                                                             shared_sizze_237854 %
                                                             8) % 8) +
                                                           (shared_sizze_237856 +
                                                            (8 -
                                                             shared_sizze_237856 %
                                                             8) % 8) +
                                                           (shared_sizze_237858 +
                                                            (8 -
                                                             shared_sizze_237858 %
                                                             8) % 8) +
                                                           (shared_sizze_237860 +
                                                            (8 -
                                                             shared_sizze_237860 %
                                                             8) % 8) +
                                                           (shared_sizze_237862 +
                                                            (8 -
                                                             shared_sizze_237862 %
                                                             8) % 8) +
                                                           (shared_sizze_237864 +
                                                            (8 -
                                                             shared_sizze_237864 %
                                                             8) % 8) +
                                                           (shared_sizze_237866 +
                                                            (8 -
                                                             shared_sizze_237866 %
                                                             8) % 8) +
                                                           (shared_sizze_237868 +
                                                            (8 -
                                                             shared_sizze_237868 %
                                                             8) % 8) +
                                                           (shared_sizze_237870 +
                                                            (8 -
                                                             shared_sizze_237870 %
                                                             8) % 8) +
                                                           (shared_sizze_237872 +
                                                            (8 -
                                                             shared_sizze_237872 %
                                                             8) % 8) +
                                                           (shared_sizze_237874 +
                                                            (8 -
                                                             shared_sizze_237874 %
                                                             8) % 8)));
                                            time_start_237836 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegmap_intragroup_216501_runs,
                                                                &ctx->mainzisegmap_intragroup_216501_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_216501,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              computed_group_sizze_216338,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_237838 +
                                                                               (8 -
                                                                                shared_sizze_237838 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237840 +
                                                                               (8 -
                                                                                shared_sizze_237840 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237842 +
                                                                               (8 -
                                                                                shared_sizze_237842 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237844 +
                                                                               (8 -
                                                                                shared_sizze_237844 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237846 +
                                                                               (8 -
                                                                                shared_sizze_237846 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237848 +
                                                                               (8 -
                                                                                shared_sizze_237848 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237850 +
                                                                               (8 -
                                                                                shared_sizze_237850 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237852 +
                                                                               (8 -
                                                                                shared_sizze_237852 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237854 +
                                                                               (8 -
                                                                                shared_sizze_237854 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237856 +
                                                                               (8 -
                                                                                shared_sizze_237856 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237858 +
                                                                               (8 -
                                                                                shared_sizze_237858 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237860 +
                                                                               (8 -
                                                                                shared_sizze_237860 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237862 +
                                                                               (8 -
                                                                                shared_sizze_237862 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237864 +
                                                                               (8 -
                                                                                shared_sizze_237864 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237866 +
                                                                               (8 -
                                                                                shared_sizze_237866 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237868 +
                                                                               (8 -
                                                                                shared_sizze_237868 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237870 +
                                                                               (8 -
                                                                                shared_sizze_237870 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237872 +
                                                                               (8 -
                                                                                shared_sizze_237872 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_237874 +
                                                                               (8 -
                                                                                shared_sizze_237874 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_237835,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_237837 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_216501",
                                                    time_end_237837 -
                                                    time_start_237836);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230496,
                                                            &mem_230398,
                                                            "mem_230398") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230495,
                                                            &mem_230403,
                                                            "mem_230403") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230403,
                                                              "mem_230403") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230398,
                                                              "mem_230398") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_216685 =
                                            sdiv_up64(nest_sizze_208938,
                                                      segmap_group_sizze_216684);
                                    struct memblock_device ext_mem_230494;
                                    
                                    ext_mem_230494.references = NULL;
                                    
                                    struct memblock_device ext_mem_230493;
                                    
                                    ext_mem_230493.references = NULL;
                                    
                                    int32_t local_memory_capacity_234222;
                                    
                                    local_memory_capacity_234222 =
                                        ctx->cuda.max_shared_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_234222)) &&
                                        suff_outer_par_216689) {
                                        struct memblock_device mem_230409;
                                        
                                        mem_230409.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230409,
                                                                  bytes_229405,
                                                                  "mem_230409")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230414;
                                        
                                        mem_230414.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230414,
                                                                  bytes_229405,
                                                                  "mem_230414")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237887 =
                                                    ext_mem_229372.mem;
                                        CUdeviceptr kernel_arg_237888 =
                                                    ext_mem_229373.mem;
                                        CUdeviceptr kernel_arg_237889 =
                                                    ext_mem_229470.mem;
                                        CUdeviceptr kernel_arg_237890 =
                                                    ext_mem_229471.mem;
                                        CUdeviceptr kernel_arg_237891 =
                                                    mem_229634.mem;
                                        CUdeviceptr kernel_arg_237892 =
                                                    mem_229639.mem;
                                        CUdeviceptr kernel_arg_237893 =
                                                    mem_230409.mem;
                                        CUdeviceptr kernel_arg_237894 =
                                                    mem_230414.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_216685 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_216684 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] =
                                                segmap_usable_groups_216685;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237884[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203574, &q_s_203575,
                                                  &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_237887,
                                                  &kernel_arg_237888,
                                                  &kernel_arg_237889,
                                                  &kernel_arg_237890,
                                                  &kernel_arg_237891,
                                                  &kernel_arg_237892,
                                                  &kernel_arg_237893,
                                                  &kernel_arg_237894};
                                            int64_t time_start_237885 = 0,
                                                    time_end_237886 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segmap_216697",
                                                        (long) segmap_usable_groups_216685,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_216684,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237885 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_216697_runs,
                                                                    &ctx->mainzisegmap_216697_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216697,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_216684,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237884,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237886 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_216697",
                                                        time_end_237886 -
                                                        time_start_237885);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230494,
                                                                &mem_230409,
                                                                "mem_230409") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230493,
                                                                &mem_230414,
                                                                "mem_230414") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230414,
                                                                  "mem_230414") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230409,
                                                                  "mem_230409") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_216840 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_216839);
                                        struct memblock_device mem_230420;
                                        
                                        mem_230420.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230420,
                                                                  bytes_229405,
                                                                  "mem_230420")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230424;
                                        
                                        mem_230424.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230424,
                                                                  bytes_230423,
                                                                  "mem_230424")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237898 =
                                                    mem_230420.mem;
                                        CUdeviceptr kernel_arg_237899 =
                                                    mem_230424.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_216840 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_216839 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] =
                                                segmap_usable_groups_216840;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237895[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203574, &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_237898,
                                                  &kernel_arg_237899};
                                            int64_t time_start_237896 = 0,
                                                    time_end_237897 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segmap_216846",
                                                        (long) segmap_usable_groups_216840,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_216839,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237896 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_216846_runs,
                                                                    &ctx->mainzisegmap_216846_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216846,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_216839,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237895,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237897 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_216846",
                                                        time_end_237897 -
                                                        time_start_237896);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230424,
                                                                  "mem_230424") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230430;
                                        
                                        mem_230430.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230430,
                                                                  bytes_229405,
                                                                  "mem_230430")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230435;
                                        
                                        mem_230435.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230435,
                                                                  bytes_229405,
                                                                  "mem_230435")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230440;
                                        
                                        mem_230440.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230440,
                                                                  bytes_229405,
                                                                  "mem_230440")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230445;
                                        
                                        mem_230445.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230445,
                                                                  bytes_229405,
                                                                  "mem_230445")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230450;
                                        
                                        mem_230450.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230450,
                                                                  bytes_229405,
                                                                  "mem_230450")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_216862)) {
                                            int64_t
                                            segment_sizze_nonzzero_233988 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_233989 =
                                                    num_groups_216863 *
                                                    segred_group_sizze_216862;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216862,
                                                                            segment_sizze_nonzzero_233988),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_216862,
                                                                                                   segment_sizze_nonzzero_233988))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237903 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237905 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237907 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237909 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237911 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            CUdeviceptr kernel_arg_237913 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237914 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237915 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237916 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237917 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237918 =
                                                        mem_230420.mem;
                                            CUdeviceptr kernel_arg_237919 =
                                                        mem_230430.mem;
                                            CUdeviceptr kernel_arg_237920 =
                                                        mem_230435.mem;
                                            CUdeviceptr kernel_arg_237921 =
                                                        mem_230440.mem;
                                            CUdeviceptr kernel_arg_237922 =
                                                        mem_230445.mem;
                                            CUdeviceptr kernel_arg_237923 =
                                                        mem_230450.mem;
                                            unsigned int shared_offset_237904 =
                                                         0;
                                            unsigned int shared_offset_237906 =
                                                         0 +
                                                         (shared_sizze_237903 +
                                                          (8 -
                                                           shared_sizze_237903 %
                                                           8) % 8);
                                            unsigned int shared_offset_237908 =
                                                         0 +
                                                         (shared_sizze_237903 +
                                                          (8 -
                                                           shared_sizze_237903 %
                                                           8) % 8) +
                                                         (shared_sizze_237905 +
                                                          (8 -
                                                           shared_sizze_237905 %
                                                           8) % 8);
                                            unsigned int shared_offset_237910 =
                                                         0 +
                                                         (shared_sizze_237903 +
                                                          (8 -
                                                           shared_sizze_237903 %
                                                           8) % 8) +
                                                         (shared_sizze_237905 +
                                                          (8 -
                                                           shared_sizze_237905 %
                                                           8) % 8) +
                                                         (shared_sizze_237907 +
                                                          (8 -
                                                           shared_sizze_237907 %
                                                           8) % 8);
                                            unsigned int shared_offset_237912 =
                                                         0 +
                                                         (shared_sizze_237903 +
                                                          (8 -
                                                           shared_sizze_237903 %
                                                           8) % 8) +
                                                         (shared_sizze_237905 +
                                                          (8 -
                                                           shared_sizze_237905 %
                                                           8) % 8) +
                                                         (shared_sizze_237907 +
                                                          (8 -
                                                           shared_sizze_237907 %
                                                           8) % 8) +
                                                         (shared_sizze_237909 +
                                                          (8 -
                                                           shared_sizze_237909 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216863 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216862 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_216863;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237900[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237904,
                                                      &shared_offset_237906,
                                                      &shared_offset_237908,
                                                      &shared_offset_237910,
                                                      &shared_offset_237912,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_216863,
                                                      &segment_sizze_nonzzero_233988,
                                                      &kernel_arg_237913,
                                                      &kernel_arg_237914,
                                                      &kernel_arg_237915,
                                                      &kernel_arg_237916,
                                                      &kernel_arg_237917,
                                                      &kernel_arg_237918,
                                                      &kernel_arg_237919,
                                                      &kernel_arg_237920,
                                                      &kernel_arg_237921,
                                                      &kernel_arg_237922,
                                                      &kernel_arg_237923};
                                                int64_t time_start_237901 = 0,
                                                        time_end_237902 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_small_216874",
                                                            (long) num_groups_216863,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216862,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237903 +
                                                                    (8 -
                                                                     shared_sizze_237903 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237905 +
                                                                    (8 -
                                                                     shared_sizze_237905 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237907 +
                                                                    (8 -
                                                                     shared_sizze_237907 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237909 +
                                                                    (8 -
                                                                     shared_sizze_237909 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237911 +
                                                                    (8 -
                                                                     shared_sizze_237911 %
                                                                     8) % 8)));
                                                    time_start_237901 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_216874_runs,
                                                                        &ctx->mainzisegred_small_216874_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_216874,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216862,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237903 +
                                                                                       (8 -
                                                                                        shared_sizze_237903 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237905 +
                                                                                       (8 -
                                                                                        shared_sizze_237905 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237907 +
                                                                                       (8 -
                                                                                        shared_sizze_237907 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237909 +
                                                                                       (8 -
                                                                                        shared_sizze_237909 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237911 +
                                                                                       (8 -
                                                                                        shared_sizze_237911 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237900,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237902 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216874",
                                                            time_end_237902 -
                                                            time_start_237901);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_234043 =
                                                    sdiv_up64(num_groups_216863,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_234044 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_216862 *
                                                              groups_per_segment_234043);
                                            int64_t virt_num_groups_234045 =
                                                    groups_per_segment_234043 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_234046 =
                                                    num_groups_216863 *
                                                    segred_group_sizze_216862;
                                            int64_t threads_per_segment_234047 =
                                                    groups_per_segment_234043 *
                                                    segred_group_sizze_216862;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_234045,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216863,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216862,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_234044,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_234043,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234048;
                                            
                                            segred_tmp_mem_234048.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234048,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234045,
                                                                      "segred_tmp_mem_234048")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234050;
                                            
                                            segred_tmp_mem_234050.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234050,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234045,
                                                                      "segred_tmp_mem_234050")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234052;
                                            
                                            segred_tmp_mem_234052.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234052,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234045,
                                                                      "segred_tmp_mem_234052")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234054;
                                            
                                            segred_tmp_mem_234054.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234054,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234045,
                                                                      "segred_tmp_mem_234054")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234056;
                                            
                                            segred_tmp_mem_234056.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234056,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234045,
                                                                      "segred_tmp_mem_234056")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_234058 =
                                            ctx->mainzicounter_mem_234058;
                                            unsigned int shared_sizze_237928 =
                                                         1;
                                            unsigned int shared_sizze_237930 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237932 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237934 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237936 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            unsigned int shared_sizze_237938 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216862;
                                            CUdeviceptr kernel_arg_237940 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237941 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237942 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237943 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237944 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237945 =
                                                        mem_230420.mem;
                                            CUdeviceptr kernel_arg_237946 =
                                                        mem_230430.mem;
                                            CUdeviceptr kernel_arg_237947 =
                                                        mem_230435.mem;
                                            CUdeviceptr kernel_arg_237948 =
                                                        mem_230440.mem;
                                            CUdeviceptr kernel_arg_237949 =
                                                        mem_230445.mem;
                                            CUdeviceptr kernel_arg_237950 =
                                                        mem_230450.mem;
                                            CUdeviceptr kernel_arg_237951 =
                                                        segred_tmp_mem_234048.mem;
                                            CUdeviceptr kernel_arg_237952 =
                                                        segred_tmp_mem_234050.mem;
                                            CUdeviceptr kernel_arg_237953 =
                                                        segred_tmp_mem_234052.mem;
                                            CUdeviceptr kernel_arg_237954 =
                                                        segred_tmp_mem_234054.mem;
                                            CUdeviceptr kernel_arg_237955 =
                                                        segred_tmp_mem_234056.mem;
                                            CUdeviceptr kernel_arg_237956 =
                                                        mainzicounter_mem_234058.mem;
                                            unsigned int shared_offset_237929 =
                                                         0;
                                            unsigned int shared_offset_237931 =
                                                         0 +
                                                         (shared_sizze_237928 +
                                                          (8 -
                                                           shared_sizze_237928 %
                                                           8) % 8);
                                            unsigned int shared_offset_237933 =
                                                         0 +
                                                         (shared_sizze_237928 +
                                                          (8 -
                                                           shared_sizze_237928 %
                                                           8) % 8) +
                                                         (shared_sizze_237930 +
                                                          (8 -
                                                           shared_sizze_237930 %
                                                           8) % 8);
                                            unsigned int shared_offset_237935 =
                                                         0 +
                                                         (shared_sizze_237928 +
                                                          (8 -
                                                           shared_sizze_237928 %
                                                           8) % 8) +
                                                         (shared_sizze_237930 +
                                                          (8 -
                                                           shared_sizze_237930 %
                                                           8) % 8) +
                                                         (shared_sizze_237932 +
                                                          (8 -
                                                           shared_sizze_237932 %
                                                           8) % 8);
                                            unsigned int shared_offset_237937 =
                                                         0 +
                                                         (shared_sizze_237928 +
                                                          (8 -
                                                           shared_sizze_237928 %
                                                           8) % 8) +
                                                         (shared_sizze_237930 +
                                                          (8 -
                                                           shared_sizze_237930 %
                                                           8) % 8) +
                                                         (shared_sizze_237932 +
                                                          (8 -
                                                           shared_sizze_237932 %
                                                           8) % 8) +
                                                         (shared_sizze_237934 +
                                                          (8 -
                                                           shared_sizze_237934 %
                                                           8) % 8);
                                            unsigned int shared_offset_237939 =
                                                         0 +
                                                         (shared_sizze_237928 +
                                                          (8 -
                                                           shared_sizze_237928 %
                                                           8) % 8) +
                                                         (shared_sizze_237930 +
                                                          (8 -
                                                           shared_sizze_237930 %
                                                           8) % 8) +
                                                         (shared_sizze_237932 +
                                                          (8 -
                                                           shared_sizze_237932 %
                                                           8) % 8) +
                                                         (shared_sizze_237934 +
                                                          (8 -
                                                           shared_sizze_237934 %
                                                           8) % 8) +
                                                         (shared_sizze_237936 +
                                                          (8 -
                                                           shared_sizze_237936 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216863 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216862 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_216863;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237925[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237929,
                                                      &shared_offset_237931,
                                                      &shared_offset_237933,
                                                      &shared_offset_237935,
                                                      &shared_offset_237937,
                                                      &shared_offset_237939,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_216863,
                                                      &groups_per_segment_234043,
                                                      &elements_per_thread_234044,
                                                      &virt_num_groups_234045,
                                                      &threads_per_segment_234047,
                                                      &kernel_arg_237940,
                                                      &kernel_arg_237941,
                                                      &kernel_arg_237942,
                                                      &kernel_arg_237943,
                                                      &kernel_arg_237944,
                                                      &kernel_arg_237945,
                                                      &kernel_arg_237946,
                                                      &kernel_arg_237947,
                                                      &kernel_arg_237948,
                                                      &kernel_arg_237949,
                                                      &kernel_arg_237950,
                                                      &kernel_arg_237951,
                                                      &kernel_arg_237952,
                                                      &kernel_arg_237953,
                                                      &kernel_arg_237954,
                                                      &kernel_arg_237955,
                                                      &kernel_arg_237956};
                                                int64_t time_start_237926 = 0,
                                                        time_end_237927 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_large_216874",
                                                            (long) num_groups_216863,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216862,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237928 +
                                                                    (8 -
                                                                     shared_sizze_237928 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237930 +
                                                                    (8 -
                                                                     shared_sizze_237930 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237932 +
                                                                    (8 -
                                                                     shared_sizze_237932 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237934 +
                                                                    (8 -
                                                                     shared_sizze_237934 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237936 +
                                                                    (8 -
                                                                     shared_sizze_237936 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237938 +
                                                                    (8 -
                                                                     shared_sizze_237938 %
                                                                     8) % 8)));
                                                    time_start_237926 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_216874_runs,
                                                                        &ctx->mainzisegred_large_216874_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_216874,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216862,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237928 +
                                                                                       (8 -
                                                                                        shared_sizze_237928 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237930 +
                                                                                       (8 -
                                                                                        shared_sizze_237930 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237932 +
                                                                                       (8 -
                                                                                        shared_sizze_237932 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237934 +
                                                                                       (8 -
                                                                                        shared_sizze_237934 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237936 +
                                                                                       (8 -
                                                                                        shared_sizze_237936 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237938 +
                                                                                       (8 -
                                                                                        shared_sizze_237938 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237925,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237927 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216874",
                                                            time_end_237927 -
                                                            time_start_237926);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234056,
                                                                      "segred_tmp_mem_234056") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234054,
                                                                      "segred_tmp_mem_234054") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234052,
                                                                      "segred_tmp_mem_234052") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234050,
                                                                      "segred_tmp_mem_234050") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234048,
                                                                      "segred_tmp_mem_234048") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230420,
                                                                  "mem_230420") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_216932 =
                                                sdiv_up64(nest_sizze_208938,
                                                          segmap_group_sizze_216931);
                                        struct memblock_device mem_230456;
                                        
                                        mem_230456.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230456,
                                                                  bytes_229405,
                                                                  "mem_230456")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230461;
                                        
                                        mem_230461.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230461,
                                                                  bytes_229405,
                                                                  "mem_230461")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230466;
                                        
                                        mem_230466.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230466,
                                                                  bytes_229405,
                                                                  "mem_230466")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230471;
                                        
                                        mem_230471.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230471,
                                                                  bytes_229405,
                                                                  "mem_230471")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230476;
                                        
                                        mem_230476.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230476,
                                                                  bytes_229405,
                                                                  "mem_230476")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230481;
                                        
                                        mem_230481.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230481,
                                                                  bytes_229405,
                                                                  "mem_230481")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        
                                        CUdeviceptr kernel_arg_237960 =
                                                    mem_230430.mem;
                                        CUdeviceptr kernel_arg_237961 =
                                                    mem_230435.mem;
                                        CUdeviceptr kernel_arg_237962 =
                                                    mem_230440.mem;
                                        CUdeviceptr kernel_arg_237963 =
                                                    mem_230445.mem;
                                        CUdeviceptr kernel_arg_237964 =
                                                    mem_230450.mem;
                                        CUdeviceptr kernel_arg_237965 =
                                                    mem_230456.mem;
                                        CUdeviceptr kernel_arg_237966 =
                                                    mem_230461.mem;
                                        CUdeviceptr kernel_arg_237967 =
                                                    mem_230466.mem;
                                        CUdeviceptr kernel_arg_237968 =
                                                    mem_230471.mem;
                                        CUdeviceptr kernel_arg_237969 =
                                                    mem_230476.mem;
                                        CUdeviceptr kernel_arg_237970 =
                                                    mem_230481.mem;
                                        
                                        if ((((((1 &&
                                                 segmap_usable_groups_216932 !=
                                                 0) && 1 != 0) && 1 != 0) &&
                                              segmap_group_sizze_216931 != 0) &&
                                             1 != 0) && 1 != 0) {
                                            int perm[3] = {0, 1, 2};
                                            
                                            if (1 >= 1 << 16) {
                                                perm[1] = perm[0];
                                                perm[0] = 1;
                                            }
                                            if (1 >= 1 << 16) {
                                                perm[2] = perm[0];
                                                perm[0] = 2;
                                            }
                                            
                                            size_t grid[3];
                                            
                                            grid[perm[0]] =
                                                segmap_usable_groups_216932;
                                            grid[perm[1]] = 1;
                                            grid[perm[2]] = 1;
                                            
                                            void *kernel_args_237957[] =
                                                 {&ctx->global_failure,
                                                  &n_p_203574, &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_237960,
                                                  &kernel_arg_237961,
                                                  &kernel_arg_237962,
                                                  &kernel_arg_237963,
                                                  &kernel_arg_237964,
                                                  &kernel_arg_237965,
                                                  &kernel_arg_237966,
                                                  &kernel_arg_237967,
                                                  &kernel_arg_237968,
                                                  &kernel_arg_237969,
                                                  &kernel_arg_237970};
                                            int64_t time_start_237958 = 0,
                                                    time_end_237959 = 0;
                                            
                                            if (ctx->debugging) {
                                                fprintf(ctx->log,
                                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                        "main.segmap_216942",
                                                        (long) segmap_usable_groups_216932,
                                                        (long) 1, (long) 1,
                                                        (long) segmap_group_sizze_216931,
                                                        (long) 1, (long) 1,
                                                        (int) 0);
                                                time_start_237958 =
                                                    get_wall_time();
                                            }
                                            
                                            cudaEvent_t *pevents = NULL;
                                            
                                            if (ctx->profiling &&
                                                !ctx->profiling_paused) {
                                                pevents =
                                                    cuda_get_events(&ctx->cuda,
                                                                    &ctx->mainzisegmap_216942_runs,
                                                                    &ctx->mainzisegmap_216942_total_runtime);
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                   0));
                                            }
                                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_216942,
                                                                                  grid[0],
                                                                                  grid[1],
                                                                                  grid[2],
                                                                                  segmap_group_sizze_216931,
                                                                                  1,
                                                                                  1,
                                                                                  0,
                                                                                  NULL,
                                                                                  kernel_args_237957,
                                                                                  NULL));
                                            if (pevents != NULL)
                                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                   0));
                                            if (ctx->debugging) {
                                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                time_end_237959 =
                                                    get_wall_time();
                                                fprintf(ctx->log,
                                                        "Kernel %s runtime: %ldus\n",
                                                        "main.segmap_216942",
                                                        time_end_237959 -
                                                        time_start_237958);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230430,
                                                                  "mem_230430") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230435,
                                                                  "mem_230435") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230440,
                                                                  "mem_230440") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230445,
                                                                  "mem_230445") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230450,
                                                                  "mem_230450") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230487;
                                        
                                        mem_230487.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230487,
                                                                  bytes_229405,
                                                                  "mem_230487")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230492;
                                        
                                        mem_230492.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230492,
                                                                  bytes_229405,
                                                                  "mem_230492")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203575 * (int64_t) 2,
                                                  segred_group_sizze_216988)) {
                                            int64_t
                                            segment_sizze_nonzzero_234132 =
                                            smax64((int64_t) 1, q_s_203575);
                                            int64_t num_threads_234133 =
                                                    num_groups_216989 *
                                                    segred_group_sizze_216988;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-small");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216988,
                                                                            segment_sizze_nonzzero_234132),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                           n_p_203574 *
                                                                                           s_n_m_203726,
                                                                                           squot64(segred_group_sizze_216988,
                                                                                                   segment_sizze_nonzzero_234132))),
                                                        '\n');
                                            
                                            unsigned int shared_sizze_237974 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216988;
                                            unsigned int shared_sizze_237976 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216988;
                                            CUdeviceptr kernel_arg_237978 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_237979 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_237980 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_237981 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_237982 =
                                                        mem_229634.mem;
                                            CUdeviceptr kernel_arg_237983 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_237984 =
                                                        mem_230456.mem;
                                            CUdeviceptr kernel_arg_237985 =
                                                        mem_230461.mem;
                                            CUdeviceptr kernel_arg_237986 =
                                                        mem_230466.mem;
                                            CUdeviceptr kernel_arg_237987 =
                                                        mem_230471.mem;
                                            CUdeviceptr kernel_arg_237988 =
                                                        mem_230476.mem;
                                            CUdeviceptr kernel_arg_237989 =
                                                        mem_230481.mem;
                                            CUdeviceptr kernel_arg_237990 =
                                                        mem_230487.mem;
                                            CUdeviceptr kernel_arg_237991 =
                                                        mem_230492.mem;
                                            unsigned int shared_offset_237975 =
                                                         0;
                                            unsigned int shared_offset_237977 =
                                                         0 +
                                                         (shared_sizze_237974 +
                                                          (8 -
                                                           shared_sizze_237974 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216989 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216988 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_216989;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237971[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237975,
                                                      &shared_offset_237977,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_216989,
                                                      &segment_sizze_nonzzero_234132,
                                                      &kernel_arg_237978,
                                                      &kernel_arg_237979,
                                                      &kernel_arg_237980,
                                                      &kernel_arg_237981,
                                                      &kernel_arg_237982,
                                                      &kernel_arg_237983,
                                                      &kernel_arg_237984,
                                                      &kernel_arg_237985,
                                                      &kernel_arg_237986,
                                                      &kernel_arg_237987,
                                                      &kernel_arg_237988,
                                                      &kernel_arg_237989,
                                                      &kernel_arg_237990,
                                                      &kernel_arg_237991};
                                                int64_t time_start_237972 = 0,
                                                        time_end_237973 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_small_216997",
                                                            (long) num_groups_216989,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216988,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237974 +
                                                                    (8 -
                                                                     shared_sizze_237974 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237976 +
                                                                    (8 -
                                                                     shared_sizze_237976 %
                                                                     8) % 8)));
                                                    time_start_237972 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_small_216997_runs,
                                                                        &ctx->mainzisegred_small_216997_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_216997,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216988,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237974 +
                                                                                       (8 -
                                                                                        shared_sizze_237974 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237976 +
                                                                                       (8 -
                                                                                        shared_sizze_237976 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237971,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237973 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216997",
                                                            time_end_237973 -
                                                            time_start_237972);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_234169 =
                                                    sdiv_up64(num_groups_216989,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726));
                                            int64_t elements_per_thread_234170 =
                                                    sdiv_up64(q_s_203575,
                                                              segred_group_sizze_216988 *
                                                              groups_per_segment_234169);
                                            int64_t virt_num_groups_234171 =
                                                    groups_per_segment_234169 *
                                                    (partition_sizze_203667 *
                                                     n_p_203574 * s_n_m_203726);
                                            int64_t num_threads_234172 =
                                                    num_groups_216989 *
                                                    segred_group_sizze_216988;
                                            int64_t threads_per_segment_234173 =
                                                    groups_per_segment_234169 *
                                                    segred_group_sizze_216988;
                                            
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n",
                                                        "\n# SegRed-large");
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_segments",
                                                        (long long) (partition_sizze_203667 *
                                                                     n_p_203574 *
                                                                     s_n_m_203726),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203575,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_234171,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216989,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216988,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_234170,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_234169,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234174;
                                            
                                            segred_tmp_mem_234174.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234174,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234171,
                                                                      "segred_tmp_mem_234174")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_234176;
                                            
                                            segred_tmp_mem_234176.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_234176,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_234171,
                                                                      "segred_tmp_mem_234176")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_234178 =
                                            ctx->mainzicounter_mem_234178;
                                            unsigned int shared_sizze_237996 =
                                                         1;
                                            unsigned int shared_sizze_237998 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216988;
                                            unsigned int shared_sizze_238000 =
                                                         (int64_t) 8 *
                                                         segred_group_sizze_216988;
                                            CUdeviceptr kernel_arg_238002 =
                                                        ext_mem_229372.mem;
                                            CUdeviceptr kernel_arg_238003 =
                                                        ext_mem_229373.mem;
                                            CUdeviceptr kernel_arg_238004 =
                                                        ext_mem_229470.mem;
                                            CUdeviceptr kernel_arg_238005 =
                                                        ext_mem_229471.mem;
                                            CUdeviceptr kernel_arg_238006 =
                                                        mem_229634.mem;
                                            CUdeviceptr kernel_arg_238007 =
                                                        mem_229639.mem;
                                            CUdeviceptr kernel_arg_238008 =
                                                        mem_230456.mem;
                                            CUdeviceptr kernel_arg_238009 =
                                                        mem_230461.mem;
                                            CUdeviceptr kernel_arg_238010 =
                                                        mem_230466.mem;
                                            CUdeviceptr kernel_arg_238011 =
                                                        mem_230471.mem;
                                            CUdeviceptr kernel_arg_238012 =
                                                        mem_230476.mem;
                                            CUdeviceptr kernel_arg_238013 =
                                                        mem_230481.mem;
                                            CUdeviceptr kernel_arg_238014 =
                                                        mem_230487.mem;
                                            CUdeviceptr kernel_arg_238015 =
                                                        mem_230492.mem;
                                            CUdeviceptr kernel_arg_238016 =
                                                        segred_tmp_mem_234174.mem;
                                            CUdeviceptr kernel_arg_238017 =
                                                        segred_tmp_mem_234176.mem;
                                            CUdeviceptr kernel_arg_238018 =
                                                        mainzicounter_mem_234178.mem;
                                            unsigned int shared_offset_237997 =
                                                         0;
                                            unsigned int shared_offset_237999 =
                                                         0 +
                                                         (shared_sizze_237996 +
                                                          (8 -
                                                           shared_sizze_237996 %
                                                           8) % 8);
                                            unsigned int shared_offset_238001 =
                                                         0 +
                                                         (shared_sizze_237996 +
                                                          (8 -
                                                           shared_sizze_237996 %
                                                           8) % 8) +
                                                         (shared_sizze_237998 +
                                                          (8 -
                                                           shared_sizze_237998 %
                                                           8) % 8);
                                            
                                            if ((((((1 && num_groups_216989 !=
                                                     0) && 1 != 0) && 1 != 0) &&
                                                  segred_group_sizze_216988 !=
                                                  0) && 1 != 0) && 1 != 0) {
                                                int perm[3] = {0, 1, 2};
                                                
                                                if (1 >= 1 << 16) {
                                                    perm[1] = perm[0];
                                                    perm[0] = 1;
                                                }
                                                if (1 >= 1 << 16) {
                                                    perm[2] = perm[0];
                                                    perm[0] = 2;
                                                }
                                                
                                                size_t grid[3];
                                                
                                                grid[perm[0]] =
                                                    num_groups_216989;
                                                grid[perm[1]] = 1;
                                                grid[perm[2]] = 1;
                                                
                                                void *kernel_args_237993[] =
                                                     {&ctx->global_failure,
                                                      &shared_offset_237997,
                                                      &shared_offset_237999,
                                                      &shared_offset_238001,
                                                      &n_p_203574, &q_s_203575,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &s_n_m_203726,
                                                      &num_groups_216989,
                                                      &groups_per_segment_234169,
                                                      &elements_per_thread_234170,
                                                      &virt_num_groups_234171,
                                                      &threads_per_segment_234173,
                                                      &kernel_arg_238002,
                                                      &kernel_arg_238003,
                                                      &kernel_arg_238004,
                                                      &kernel_arg_238005,
                                                      &kernel_arg_238006,
                                                      &kernel_arg_238007,
                                                      &kernel_arg_238008,
                                                      &kernel_arg_238009,
                                                      &kernel_arg_238010,
                                                      &kernel_arg_238011,
                                                      &kernel_arg_238012,
                                                      &kernel_arg_238013,
                                                      &kernel_arg_238014,
                                                      &kernel_arg_238015,
                                                      &kernel_arg_238016,
                                                      &kernel_arg_238017,
                                                      &kernel_arg_238018};
                                                int64_t time_start_237994 = 0,
                                                        time_end_237995 = 0;
                                                
                                                if (ctx->debugging) {
                                                    fprintf(ctx->log,
                                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                            "main.segred_large_216997",
                                                            (long) num_groups_216989,
                                                            (long) 1, (long) 1,
                                                            (long) segred_group_sizze_216988,
                                                            (long) 1, (long) 1,
                                                            (int) (0 +
                                                                   (shared_sizze_237996 +
                                                                    (8 -
                                                                     shared_sizze_237996 %
                                                                     8) % 8) +
                                                                   (shared_sizze_237998 +
                                                                    (8 -
                                                                     shared_sizze_237998 %
                                                                     8) % 8) +
                                                                   (shared_sizze_238000 +
                                                                    (8 -
                                                                     shared_sizze_238000 %
                                                                     8) % 8)));
                                                    time_start_237994 =
                                                        get_wall_time();
                                                }
                                                
                                                cudaEvent_t *pevents = NULL;
                                                
                                                if (ctx->profiling &&
                                                    !ctx->profiling_paused) {
                                                    pevents =
                                                        cuda_get_events(&ctx->cuda,
                                                                        &ctx->mainzisegred_large_216997_runs,
                                                                        &ctx->mainzisegred_large_216997_total_runtime);
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                                       0));
                                                }
                                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_216997,
                                                                                      grid[0],
                                                                                      grid[1],
                                                                                      grid[2],
                                                                                      segred_group_sizze_216988,
                                                                                      1,
                                                                                      1,
                                                                                      0 +
                                                                                      (shared_sizze_237996 +
                                                                                       (8 -
                                                                                        shared_sizze_237996 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_237998 +
                                                                                       (8 -
                                                                                        shared_sizze_237998 %
                                                                                        8) %
                                                                                       8) +
                                                                                      (shared_sizze_238000 +
                                                                                       (8 -
                                                                                        shared_sizze_238000 %
                                                                                        8) %
                                                                                       8),
                                                                                      NULL,
                                                                                      kernel_args_237993,
                                                                                      NULL));
                                                if (pevents != NULL)
                                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                                       0));
                                                if (ctx->debugging) {
                                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                                    time_end_237995 =
                                                        get_wall_time();
                                                    fprintf(ctx->log,
                                                            "Kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216997",
                                                            time_end_237995 -
                                                            time_start_237994);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234176,
                                                                      "segred_tmp_mem_234176") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_234174,
                                                                      "segred_tmp_mem_234174") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230456,
                                                                  "mem_230456") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230461,
                                                                  "mem_230461") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230466,
                                                                  "mem_230466") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230471,
                                                                  "mem_230471") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230476,
                                                                  "mem_230476") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230481,
                                                                  "mem_230481") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230494,
                                                                &mem_230487,
                                                                "mem_230487") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230493,
                                                                &mem_230492,
                                                                "mem_230492") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230492,
                                                                  "mem_230492") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230487,
                                                                  "mem_230487") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230481,
                                                                  "mem_230481") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230476,
                                                                  "mem_230476") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230471,
                                                                  "mem_230471") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230466,
                                                                  "mem_230466") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230461,
                                                                  "mem_230461") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230456,
                                                                  "mem_230456") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230450,
                                                                  "mem_230450") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230445,
                                                                  "mem_230445") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230440,
                                                                  "mem_230440") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230435,
                                                                  "mem_230435") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230430,
                                                                  "mem_230430") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230424,
                                                                  "mem_230424") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230420,
                                                                  "mem_230420") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230496,
                                                            &ext_mem_230494,
                                                            "ext_mem_230494") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230495,
                                                            &ext_mem_230493,
                                                            "ext_mem_230493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230493,
                                                              "ext_mem_230493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230494,
                                                              "ext_mem_230494") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230510,
                                                        &ext_mem_230496,
                                                        "ext_mem_230496") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230509,
                                                        &ext_mem_230495,
                                                        "ext_mem_230495") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230495,
                                                          "ext_mem_230495") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230496,
                                                          "ext_mem_230496") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230524,
                                                    &ext_mem_230510,
                                                    "ext_mem_230510") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230523,
                                                    &ext_mem_230509,
                                                    "ext_mem_230509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230509,
                                                      "ext_mem_230509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230510,
                                                      "ext_mem_230510") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230526,
                                                &ext_mem_230524,
                                                "ext_mem_230524") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230525,
                                                &ext_mem_230523,
                                                "ext_mem_230523") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230523,
                                                  "ext_mem_230523") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230524,
                                                  "ext_mem_230524") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230528,
                                            &ext_mem_230526,
                                            "ext_mem_230526") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230527,
                                            &ext_mem_230525,
                                            "ext_mem_230525") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230525,
                                              "ext_mem_230525") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230526,
                                              "ext_mem_230526") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230595, &ext_mem_230528,
                                        "ext_mem_230528") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230594, &ext_mem_230527,
                                        "ext_mem_230527") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230527,
                                          "ext_mem_230527") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230528,
                                          "ext_mem_230528") != 0)
                    return 1;
            } else {
                bool match_lit_204707 = (int64_t) 0 == d_s_203578;
                int64_t binop_y_230536 = (int64_t) 8 * q_s_203575;
                int64_t bytes_230537 = smax64((int64_t) 0, binop_y_230536);
                struct memblock_device ext_mem_230593;
                
                ext_mem_230593.references = NULL;
                
                struct memblock_device ext_mem_230592;
                
                ext_mem_230592.references = NULL;
                if (match_lit_204707) {
                    struct memblock_device mem_230533;
                    
                    mem_230533.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230533, bytes_229405,
                                              "mem_230533")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230533,
                                                      partition_sizze_203667 *
                                                      n_p_203574 * s_n_m_203726,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230533,
                                                  "mem_230533") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230592,
                                                  "ext_mem_230592") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230593,
                                                  "ext_mem_230593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230544;
                    
                    mem_230544.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230544, bytes_229405,
                                              "mem_230544")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_238022 = (int64_t) 8 * q_s_203575;
                    unsigned int shared_sizze_238024 = (int64_t) 8 * q_s_203575;
                    unsigned int shared_sizze_238026 = bytes_230537;
                    CUdeviceptr kernel_arg_238028 = ext_mem_229372.mem;
                    CUdeviceptr kernel_arg_238029 = ext_mem_229373.mem;
                    CUdeviceptr kernel_arg_238030 = ext_mem_229470.mem;
                    CUdeviceptr kernel_arg_238031 = ext_mem_229471.mem;
                    CUdeviceptr kernel_arg_238032 = mem_229634.mem;
                    CUdeviceptr kernel_arg_238033 = mem_229639.mem;
                    CUdeviceptr kernel_arg_238034 = mem_230544.mem;
                    unsigned int shared_offset_238023 = 0;
                    unsigned int shared_offset_238025 = 0 +
                                 (shared_sizze_238022 + (8 -
                                                         shared_sizze_238022 %
                                                         8) % 8);
                    unsigned int shared_offset_238027 = 0 +
                                 (shared_sizze_238022 + (8 -
                                                         shared_sizze_238022 %
                                                         8) % 8) +
                                 (shared_sizze_238024 + (8 -
                                                         shared_sizze_238024 %
                                                         8) % 8);
                    
                    if ((((((1 && nest_sizze_208938 != 0) && 1 != 0) && 1 !=
                           0) && q_s_203575 != 0) && 1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = nest_sizze_208938;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238019[] = {&ctx->global_failure,
                                                      &shared_offset_238023,
                                                      &shared_offset_238025,
                                                      &shared_offset_238027,
                                                      &n_p_203574, &q_s_203575,
                                                      &jump_s_203581,
                                                      &partition_sizze_203667,
                                                      &defunc_0_f_res_203721,
                                                      &pad_css_len_203722,
                                                      &s_n_m_203726,
                                                      &kernel_arg_238028,
                                                      &kernel_arg_238029,
                                                      &kernel_arg_238030,
                                                      &kernel_arg_238031,
                                                      &kernel_arg_238032,
                                                      &kernel_arg_238033,
                                                      &kernel_arg_238034};
                        int64_t time_start_238020 = 0, time_end_238021 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segmap_intragroup_217273",
                                    (long) nest_sizze_208938, (long) 1,
                                    (long) 1, (long) q_s_203575, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_238022 +
                                                          (8 -
                                                           shared_sizze_238022 %
                                                           8) % 8) +
                                                     (shared_sizze_238024 + (8 -
                                                                             shared_sizze_238024 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_238026 + (8 -
                                                                             shared_sizze_238026 %
                                                                             8) %
                                                      8)));
                            time_start_238020 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_217273_runs,
                                                      &ctx->mainzisegmap_intragroup_217273_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_217273,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              q_s_203575, 1, 1,
                                                              0 +
                                                              (shared_sizze_238022 +
                                                               (8 -
                                                                shared_sizze_238022 %
                                                                8) % 8) +
                                                              (shared_sizze_238024 +
                                                               (8 -
                                                                shared_sizze_238024 %
                                                                8) % 8) +
                                                              (shared_sizze_238026 +
                                                               (8 -
                                                                shared_sizze_238026 %
                                                                8) % 8), NULL,
                                                              kernel_args_238019,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238021 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_217273",
                                    time_end_238021 - time_start_238020);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_230593, &mem_230544,
                                            "mem_230544") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230592, &mem_230533,
                                            "mem_230533") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230544, "mem_230544") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230533, "mem_230533") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204779 = (int64_t) 1 == d_s_203578;
                    struct memblock_device ext_mem_230591;
                    
                    ext_mem_230591.references = NULL;
                    
                    struct memblock_device ext_mem_230590;
                    
                    ext_mem_230590.references = NULL;
                    if (match_lit_204779) {
                        struct memblock_device mem_230558;
                        
                        mem_230558.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230558,
                                                  bytes_229405, "mem_230558")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230563;
                        
                        mem_230563.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230563,
                                                  bytes_229405, "mem_230563")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238038 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238040 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238042 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238044 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238046 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238048 = bytes_230537;
                        unsigned int shared_sizze_238050 = bytes_230537;
                        CUdeviceptr kernel_arg_238052 = ext_mem_229372.mem;
                        CUdeviceptr kernel_arg_238053 = ext_mem_229373.mem;
                        CUdeviceptr kernel_arg_238054 = ext_mem_229470.mem;
                        CUdeviceptr kernel_arg_238055 = ext_mem_229471.mem;
                        CUdeviceptr kernel_arg_238056 = mem_229634.mem;
                        CUdeviceptr kernel_arg_238057 = mem_229639.mem;
                        CUdeviceptr kernel_arg_238058 = mem_230558.mem;
                        CUdeviceptr kernel_arg_238059 = mem_230563.mem;
                        unsigned int shared_offset_238039 = 0;
                        unsigned int shared_offset_238041 = 0 +
                                     (shared_sizze_238038 + (8 -
                                                             shared_sizze_238038 %
                                                             8) % 8);
                        unsigned int shared_offset_238043 = 0 +
                                     (shared_sizze_238038 + (8 -
                                                             shared_sizze_238038 %
                                                             8) % 8) +
                                     (shared_sizze_238040 + (8 -
                                                             shared_sizze_238040 %
                                                             8) % 8);
                        unsigned int shared_offset_238045 = 0 +
                                     (shared_sizze_238038 + (8 -
                                                             shared_sizze_238038 %
                                                             8) % 8) +
                                     (shared_sizze_238040 + (8 -
                                                             shared_sizze_238040 %
                                                             8) % 8) +
                                     (shared_sizze_238042 + (8 -
                                                             shared_sizze_238042 %
                                                             8) % 8);
                        unsigned int shared_offset_238047 = 0 +
                                     (shared_sizze_238038 + (8 -
                                                             shared_sizze_238038 %
                                                             8) % 8) +
                                     (shared_sizze_238040 + (8 -
                                                             shared_sizze_238040 %
                                                             8) % 8) +
                                     (shared_sizze_238042 + (8 -
                                                             shared_sizze_238042 %
                                                             8) % 8) +
                                     (shared_sizze_238044 + (8 -
                                                             shared_sizze_238044 %
                                                             8) % 8);
                        unsigned int shared_offset_238049 = 0 +
                                     (shared_sizze_238038 + (8 -
                                                             shared_sizze_238038 %
                                                             8) % 8) +
                                     (shared_sizze_238040 + (8 -
                                                             shared_sizze_238040 %
                                                             8) % 8) +
                                     (shared_sizze_238042 + (8 -
                                                             shared_sizze_238042 %
                                                             8) % 8) +
                                     (shared_sizze_238044 + (8 -
                                                             shared_sizze_238044 %
                                                             8) % 8) +
                                     (shared_sizze_238046 + (8 -
                                                             shared_sizze_238046 %
                                                             8) % 8);
                        unsigned int shared_offset_238051 = 0 +
                                     (shared_sizze_238038 + (8 -
                                                             shared_sizze_238038 %
                                                             8) % 8) +
                                     (shared_sizze_238040 + (8 -
                                                             shared_sizze_238040 %
                                                             8) % 8) +
                                     (shared_sizze_238042 + (8 -
                                                             shared_sizze_238042 %
                                                             8) % 8) +
                                     (shared_sizze_238044 + (8 -
                                                             shared_sizze_238044 %
                                                             8) % 8) +
                                     (shared_sizze_238046 + (8 -
                                                             shared_sizze_238046 %
                                                             8) % 8) +
                                     (shared_sizze_238048 + (8 -
                                                             shared_sizze_238048 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_208938 != 0) && 1 != 0) && 1 !=
                               0) && q_s_203575 != 0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = nest_sizze_208938;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238035[] = {&ctx->global_failure,
                                                          &shared_offset_238039,
                                                          &shared_offset_238041,
                                                          &shared_offset_238043,
                                                          &shared_offset_238045,
                                                          &shared_offset_238047,
                                                          &shared_offset_238049,
                                                          &shared_offset_238051,
                                                          &n_p_203574,
                                                          &q_s_203575,
                                                          &jump_s_203581,
                                                          &partition_sizze_203667,
                                                          &defunc_0_f_res_203721,
                                                          &pad_css_len_203722,
                                                          &s_n_m_203726,
                                                          &kernel_arg_238052,
                                                          &kernel_arg_238053,
                                                          &kernel_arg_238054,
                                                          &kernel_arg_238055,
                                                          &kernel_arg_238056,
                                                          &kernel_arg_238057,
                                                          &kernel_arg_238058,
                                                          &kernel_arg_238059};
                            int64_t time_start_238036 = 0, time_end_238037 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_intragroup_217594",
                                        (long) nest_sizze_208938, (long) 1,
                                        (long) 1, (long) q_s_203575, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238038 +
                                                          (8 -
                                                           shared_sizze_238038 %
                                                           8) % 8) +
                                                         (shared_sizze_238040 +
                                                          (8 -
                                                           shared_sizze_238040 %
                                                           8) % 8) +
                                                         (shared_sizze_238042 +
                                                          (8 -
                                                           shared_sizze_238042 %
                                                           8) % 8) +
                                                         (shared_sizze_238044 +
                                                          (8 -
                                                           shared_sizze_238044 %
                                                           8) % 8) +
                                                         (shared_sizze_238046 +
                                                          (8 -
                                                           shared_sizze_238046 %
                                                           8) % 8) +
                                                         (shared_sizze_238048 +
                                                          (8 -
                                                           shared_sizze_238048 %
                                                           8) % 8) +
                                                         (shared_sizze_238050 +
                                                          (8 -
                                                           shared_sizze_238050 %
                                                           8) % 8)));
                                time_start_238036 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_217594_runs,
                                                          &ctx->mainzisegmap_intragroup_217594_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_217594,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_s_203575, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238038 +
                                                                   (8 -
                                                                    shared_sizze_238038 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238040 +
                                                                   (8 -
                                                                    shared_sizze_238040 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238042 +
                                                                   (8 -
                                                                    shared_sizze_238042 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238044 +
                                                                   (8 -
                                                                    shared_sizze_238044 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238046 +
                                                                   (8 -
                                                                    shared_sizze_238046 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238048 +
                                                                   (8 -
                                                                    shared_sizze_238048 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238050 +
                                                                   (8 -
                                                                    shared_sizze_238050 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238035,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238037 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_217594",
                                        time_end_238037 - time_start_238036);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230591,
                                                &mem_230558, "mem_230558") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230590,
                                                &mem_230563, "mem_230563") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230563,
                                                  "mem_230563") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230558,
                                                  "mem_230558") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_230584;
                        
                        mem_230584.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230584,
                                                  bytes_229405, "mem_230584")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230589;
                        
                        mem_230589.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230589,
                                                  bytes_229405, "mem_230589")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238063 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238065 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238067 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238069 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238071 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238073 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238075 = (int64_t) 8 *
                                     q_s_203575;
                        unsigned int shared_sizze_238077 = bytes_230537;
                        unsigned int shared_sizze_238079 = bytes_230537;
                        unsigned int shared_sizze_238081 = bytes_230537;
                        unsigned int shared_sizze_238083 = bytes_230537;
                        CUdeviceptr kernel_arg_238085 = ext_mem_229372.mem;
                        CUdeviceptr kernel_arg_238086 = ext_mem_229373.mem;
                        CUdeviceptr kernel_arg_238087 = ext_mem_229470.mem;
                        CUdeviceptr kernel_arg_238088 = ext_mem_229471.mem;
                        CUdeviceptr kernel_arg_238089 = mem_229634.mem;
                        CUdeviceptr kernel_arg_238090 = mem_229639.mem;
                        CUdeviceptr kernel_arg_238091 = mem_230584.mem;
                        CUdeviceptr kernel_arg_238092 = mem_230589.mem;
                        unsigned int shared_offset_238064 = 0;
                        unsigned int shared_offset_238066 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8);
                        unsigned int shared_offset_238068 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8);
                        unsigned int shared_offset_238070 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8);
                        unsigned int shared_offset_238072 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8);
                        unsigned int shared_offset_238074 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8) +
                                     (shared_sizze_238071 + (8 -
                                                             shared_sizze_238071 %
                                                             8) % 8);
                        unsigned int shared_offset_238076 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8) +
                                     (shared_sizze_238071 + (8 -
                                                             shared_sizze_238071 %
                                                             8) % 8) +
                                     (shared_sizze_238073 + (8 -
                                                             shared_sizze_238073 %
                                                             8) % 8);
                        unsigned int shared_offset_238078 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8) +
                                     (shared_sizze_238071 + (8 -
                                                             shared_sizze_238071 %
                                                             8) % 8) +
                                     (shared_sizze_238073 + (8 -
                                                             shared_sizze_238073 %
                                                             8) % 8) +
                                     (shared_sizze_238075 + (8 -
                                                             shared_sizze_238075 %
                                                             8) % 8);
                        unsigned int shared_offset_238080 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8) +
                                     (shared_sizze_238071 + (8 -
                                                             shared_sizze_238071 %
                                                             8) % 8) +
                                     (shared_sizze_238073 + (8 -
                                                             shared_sizze_238073 %
                                                             8) % 8) +
                                     (shared_sizze_238075 + (8 -
                                                             shared_sizze_238075 %
                                                             8) % 8) +
                                     (shared_sizze_238077 + (8 -
                                                             shared_sizze_238077 %
                                                             8) % 8);
                        unsigned int shared_offset_238082 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8) +
                                     (shared_sizze_238071 + (8 -
                                                             shared_sizze_238071 %
                                                             8) % 8) +
                                     (shared_sizze_238073 + (8 -
                                                             shared_sizze_238073 %
                                                             8) % 8) +
                                     (shared_sizze_238075 + (8 -
                                                             shared_sizze_238075 %
                                                             8) % 8) +
                                     (shared_sizze_238077 + (8 -
                                                             shared_sizze_238077 %
                                                             8) % 8) +
                                     (shared_sizze_238079 + (8 -
                                                             shared_sizze_238079 %
                                                             8) % 8);
                        unsigned int shared_offset_238084 = 0 +
                                     (shared_sizze_238063 + (8 -
                                                             shared_sizze_238063 %
                                                             8) % 8) +
                                     (shared_sizze_238065 + (8 -
                                                             shared_sizze_238065 %
                                                             8) % 8) +
                                     (shared_sizze_238067 + (8 -
                                                             shared_sizze_238067 %
                                                             8) % 8) +
                                     (shared_sizze_238069 + (8 -
                                                             shared_sizze_238069 %
                                                             8) % 8) +
                                     (shared_sizze_238071 + (8 -
                                                             shared_sizze_238071 %
                                                             8) % 8) +
                                     (shared_sizze_238073 + (8 -
                                                             shared_sizze_238073 %
                                                             8) % 8) +
                                     (shared_sizze_238075 + (8 -
                                                             shared_sizze_238075 %
                                                             8) % 8) +
                                     (shared_sizze_238077 + (8 -
                                                             shared_sizze_238077 %
                                                             8) % 8) +
                                     (shared_sizze_238079 + (8 -
                                                             shared_sizze_238079 %
                                                             8) % 8) +
                                     (shared_sizze_238081 + (8 -
                                                             shared_sizze_238081 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_208938 != 0) && 1 != 0) && 1 !=
                               0) && q_s_203575 != 0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = nest_sizze_208938;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238060[] = {&ctx->global_failure,
                                                          &shared_offset_238064,
                                                          &shared_offset_238066,
                                                          &shared_offset_238068,
                                                          &shared_offset_238070,
                                                          &shared_offset_238072,
                                                          &shared_offset_238074,
                                                          &shared_offset_238076,
                                                          &shared_offset_238078,
                                                          &shared_offset_238080,
                                                          &shared_offset_238082,
                                                          &shared_offset_238084,
                                                          &n_p_203574,
                                                          &q_s_203575,
                                                          &jump_s_203581,
                                                          &partition_sizze_203667,
                                                          &defunc_0_f_res_203721,
                                                          &pad_css_len_203722,
                                                          &s_n_m_203726,
                                                          &kernel_arg_238085,
                                                          &kernel_arg_238086,
                                                          &kernel_arg_238087,
                                                          &kernel_arg_238088,
                                                          &kernel_arg_238089,
                                                          &kernel_arg_238090,
                                                          &kernel_arg_238091,
                                                          &kernel_arg_238092};
                            int64_t time_start_238061 = 0, time_end_238062 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_intragroup_218045",
                                        (long) nest_sizze_208938, (long) 1,
                                        (long) 1, (long) q_s_203575, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238063 +
                                                          (8 -
                                                           shared_sizze_238063 %
                                                           8) % 8) +
                                                         (shared_sizze_238065 +
                                                          (8 -
                                                           shared_sizze_238065 %
                                                           8) % 8) +
                                                         (shared_sizze_238067 +
                                                          (8 -
                                                           shared_sizze_238067 %
                                                           8) % 8) +
                                                         (shared_sizze_238069 +
                                                          (8 -
                                                           shared_sizze_238069 %
                                                           8) % 8) +
                                                         (shared_sizze_238071 +
                                                          (8 -
                                                           shared_sizze_238071 %
                                                           8) % 8) +
                                                         (shared_sizze_238073 +
                                                          (8 -
                                                           shared_sizze_238073 %
                                                           8) % 8) +
                                                         (shared_sizze_238075 +
                                                          (8 -
                                                           shared_sizze_238075 %
                                                           8) % 8) +
                                                         (shared_sizze_238077 +
                                                          (8 -
                                                           shared_sizze_238077 %
                                                           8) % 8) +
                                                         (shared_sizze_238079 +
                                                          (8 -
                                                           shared_sizze_238079 %
                                                           8) % 8) +
                                                         (shared_sizze_238081 +
                                                          (8 -
                                                           shared_sizze_238081 %
                                                           8) % 8) +
                                                         (shared_sizze_238083 +
                                                          (8 -
                                                           shared_sizze_238083 %
                                                           8) % 8)));
                                time_start_238061 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_218045_runs,
                                                          &ctx->mainzisegmap_intragroup_218045_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_218045,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_s_203575, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238063 +
                                                                   (8 -
                                                                    shared_sizze_238063 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238065 +
                                                                   (8 -
                                                                    shared_sizze_238065 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238067 +
                                                                   (8 -
                                                                    shared_sizze_238067 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238069 +
                                                                   (8 -
                                                                    shared_sizze_238069 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238071 +
                                                                   (8 -
                                                                    shared_sizze_238071 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238073 +
                                                                   (8 -
                                                                    shared_sizze_238073 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238075 +
                                                                   (8 -
                                                                    shared_sizze_238075 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238077 +
                                                                   (8 -
                                                                    shared_sizze_238077 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238079 +
                                                                   (8 -
                                                                    shared_sizze_238079 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238081 +
                                                                   (8 -
                                                                    shared_sizze_238081 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238083 +
                                                                   (8 -
                                                                    shared_sizze_238083 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238060,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238062 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_218045",
                                        time_end_238062 - time_start_238061);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230591,
                                                &mem_230584, "mem_230584") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230590,
                                                &mem_230589, "mem_230589") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230589,
                                                  "mem_230589") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230584,
                                                  "mem_230584") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230593,
                                            &ext_mem_230591,
                                            "ext_mem_230591") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230592,
                                            &ext_mem_230590,
                                            "ext_mem_230590") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230590,
                                              "ext_mem_230590") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230591,
                                              "ext_mem_230591") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230595, &ext_mem_230593,
                                        "ext_mem_230593") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230594, &ext_mem_230592,
                                        "ext_mem_230592") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230592,
                                          "ext_mem_230592") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230593,
                                          "ext_mem_230593") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_230602;
            
            ext_mem_230602.references = NULL;
            if (cond_203725) {
                if (memblock_set_device(ctx, &ext_mem_230602, &ext_mem_230595,
                                        "ext_mem_230595") != 0)
                    return 1;
            } else {
                bool bounds_invalid_upwards_205061 = slt64(pad_css_len_203722,
                                                           (int64_t) 0);
                bool valid_205062 = !bounds_invalid_upwards_205061;
                bool range_valid_c_205063;
                
                if (!valid_205062) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Range ", (long long) (int64_t) 0, "..",
                                  (long long) (int64_t) 1, "..<",
                                  (long long) pad_css_len_203722,
                                  " is invalid.",
                                  "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:557:3-566:9\n   #4  stl.fut:220:31-96\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:219:23-221:48\n   #8  /prelude/soacs.fut:67:19-23\n   #9  /prelude/soacs.fut:67:3-37\n   #10 stl.fut:218:15-222:44\n   #11 stl.fut:415:61-429:75\n   #12 stl.fut:455:3-469:34\n   #13 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_218495 = n_p_203574 * pad_css_len_203722;
                int64_t nest_sizze_218496 = partition_sizze_203667 * y_218495;
                int64_t segmap_group_sizze_218497;
                
                segmap_group_sizze_218497 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_218205;
                
                int64_t segmap_usable_groups_218498 =
                        sdiv_up64(nest_sizze_218496, segmap_group_sizze_218497);
                struct memblock_device mem_230601;
                
                mem_230601.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230601, bytes_230600,
                                          "mem_230601")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238096 = ext_mem_230594.mem;
                CUdeviceptr kernel_arg_238097 = ext_mem_230595.mem;
                CUdeviceptr kernel_arg_238098 = mem_230601.mem;
                
                if ((((((1 && segmap_usable_groups_218498 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218497 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_218498;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238093[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_p_203574, &jump_s_203581,
                                                  &partition_sizze_203667,
                                                  &defunc_0_f_res_203721,
                                                  &pad_css_len_203722,
                                                  &s_n_m_203726,
                                                  &kernel_arg_238096,
                                                  &kernel_arg_238097,
                                                  &kernel_arg_238098};
                    int64_t time_start_238094 = 0, time_end_238095 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_218503",
                                (long) segmap_usable_groups_218498, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218497,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238094 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218503_runs,
                                                  &ctx->mainzisegmap_218503_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218503,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218497,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238093,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238095 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218503", time_end_238095 -
                                time_start_238094);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_230602, &mem_230601,
                                        "mem_230601") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230601, "mem_230601") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230594, "ext_mem_230594") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230595, "ext_mem_230595") !=
                0)
                return 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_238102 = ext_mem_230602.mem;
            CUdeviceptr kernel_arg_238103 = mem_230608.mem;
            
            if ((((((1 && segmap_usable_groups_218648 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_218647 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_218648;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_238099[] = {&ctx->global_failure,
                                              &ctx->failure_is_an_option,
                                              &ctx->global_failure_args,
                                              &n_p_203574,
                                              &partition_sizze_203667,
                                              &C_len_203724,
                                              &css_results_l_204200,
                                              &kernel_arg_238102,
                                              &kernel_arg_238103};
                int64_t time_start_238100 = 0, time_end_238101 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_218652",
                            (long) segmap_usable_groups_218648, (long) 1,
                            (long) 1, (long) segmap_group_sizze_218647,
                            (long) 1, (long) 1, (int) 0);
                    time_start_238100 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_218652_runs,
                                              &ctx->mainzisegmap_218652_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218652,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_218647,
                                                      1, 1, 0, NULL,
                                                      kernel_args_238099,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_238101 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_218652", time_end_238101 -
                            time_start_238100);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_230602, "ext_mem_230602") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230620;
            
            ext_mem_230620.references = NULL;
            
            int32_t local_memory_capacity_234407;
            
            local_memory_capacity_234407 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234407)) &&
                suff_outer_par_218668) {
                struct memblock_device mem_230611;
                
                mem_230611.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230611, binop_y_230606,
                                          "mem_230611")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230611,
                                                          (int64_t) 0,
                                                          mem_230608,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          C_len_203724,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230611, "mem_230611") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230615;
                
                mem_230615.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230615, bytes_229288,
                                          "mem_230615")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238107 = mem_230611.mem;
                CUdeviceptr kernel_arg_238108 = mem_230615.mem;
                
                if ((((((1 && segmap_usable_groups_218685 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218684 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_218685;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238104[] = {&ctx->global_failure,
                                                  &n_p_203574,
                                                  &partition_sizze_203667,
                                                  &kernel_arg_238107,
                                                  &kernel_arg_238108};
                    int64_t time_start_238105 = 0, time_end_238106 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_218688",
                                (long) segmap_usable_groups_218685, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218684,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238105 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218688_runs,
                                                  &ctx->mainzisegmap_218688_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218688,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218684,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238104,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238106 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218688", time_end_238106 -
                                time_start_238105);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230611, "mem_230611") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230620, &mem_230615,
                                        "mem_230615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230615, "mem_230615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230611, "mem_230611") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230619;
                
                mem_230619.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230619, bytes_229288,
                                          "mem_230619")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203574 * (int64_t) 2,
                          segred_group_sizze_218715)) {
                    int64_t segment_sizze_nonzzero_234339 = smax64((int64_t) 1,
                                                                   n_p_203574);
                    int64_t num_threads_234340 = num_groups_218716 *
                            segred_group_sizze_218715;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218715,
                                                    segment_sizze_nonzzero_234339),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_218715,
                                                                           segment_sizze_nonzzero_234339))),
                                '\n');
                    
                    unsigned int shared_sizze_238112 = (int64_t) 8 *
                                 segred_group_sizze_218715;
                    CUdeviceptr kernel_arg_238114 = mem_230608.mem;
                    CUdeviceptr kernel_arg_238115 = mem_230619.mem;
                    unsigned int shared_offset_238113 = 0;
                    
                    if ((((((1 && num_groups_218716 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218715 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_218716;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238109[] = {&ctx->global_failure,
                                                      &shared_offset_238113,
                                                      &n_p_203574,
                                                      &partition_sizze_203667,
                                                      &C_len_203724,
                                                      &num_groups_218716,
                                                      &segment_sizze_nonzzero_234339,
                                                      &kernel_arg_238114,
                                                      &kernel_arg_238115};
                        int64_t time_start_238110 = 0, time_end_238111 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_small_218721",
                                    (long) num_groups_218716, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218715,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238112 +
                                                                (8 -
                                                                 shared_sizze_238112 %
                                                                 8) % 8)));
                            time_start_238110 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_218721_runs,
                                                      &ctx->mainzisegred_small_218721_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_218721,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218715,
                                                              1, 1, 0 +
                                                              (shared_sizze_238112 +
                                                               (8 -
                                                                shared_sizze_238112 %
                                                                8) % 8), NULL,
                                                              kernel_args_238109,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238111 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_218721",
                                    time_end_238111 - time_start_238110);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234366 =
                            sdiv_up64(num_groups_218716, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_234367 = sdiv_up64(n_p_203574,
                                                                   segred_group_sizze_218715 *
                                                                   groups_per_segment_234366);
                    int64_t virt_num_groups_234368 = groups_per_segment_234366 *
                            partition_sizze_203667;
                    int64_t num_threads_234369 = num_groups_218716 *
                            segred_group_sizze_218715;
                    int64_t threads_per_segment_234370 =
                            groups_per_segment_234366 *
                            segred_group_sizze_218715;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234368, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218716, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218715, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234367, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234366, '\n');
                    
                    struct memblock_device segred_tmp_mem_234371;
                    
                    segred_tmp_mem_234371.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234371,
                                              (int64_t) 8 *
                                              virt_num_groups_234368,
                                              "segred_tmp_mem_234371")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234373 =
                                           ctx->mainzicounter_mem_234373;
                    unsigned int shared_sizze_238120 = 1;
                    unsigned int shared_sizze_238122 = (int64_t) 8 *
                                 segred_group_sizze_218715;
                    CUdeviceptr kernel_arg_238124 = mem_230608.mem;
                    CUdeviceptr kernel_arg_238125 = mem_230619.mem;
                    CUdeviceptr kernel_arg_238126 = segred_tmp_mem_234371.mem;
                    CUdeviceptr kernel_arg_238127 =
                                mainzicounter_mem_234373.mem;
                    unsigned int shared_offset_238121 = 0;
                    unsigned int shared_offset_238123 = 0 +
                                 (shared_sizze_238120 + (8 -
                                                         shared_sizze_238120 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_218716 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218715 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_218716;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238117[] = {&ctx->global_failure,
                                                      &shared_offset_238121,
                                                      &shared_offset_238123,
                                                      &n_p_203574,
                                                      &partition_sizze_203667,
                                                      &C_len_203724,
                                                      &num_groups_218716,
                                                      &groups_per_segment_234366,
                                                      &elements_per_thread_234367,
                                                      &virt_num_groups_234368,
                                                      &threads_per_segment_234370,
                                                      &kernel_arg_238124,
                                                      &kernel_arg_238125,
                                                      &kernel_arg_238126,
                                                      &kernel_arg_238127};
                        int64_t time_start_238118 = 0, time_end_238119 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_large_218721",
                                    (long) num_groups_218716, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218715,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238120 +
                                                                (8 -
                                                                 shared_sizze_238120 %
                                                                 8) % 8) +
                                                               (shared_sizze_238122 +
                                                                (8 -
                                                                 shared_sizze_238122 %
                                                                 8) % 8)));
                            time_start_238118 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_218721_runs,
                                                      &ctx->mainzisegred_large_218721_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_218721,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218715,
                                                              1, 1, 0 +
                                                              (shared_sizze_238120 +
                                                               (8 -
                                                                shared_sizze_238120 %
                                                                8) % 8) +
                                                              (shared_sizze_238122 +
                                                               (8 -
                                                                shared_sizze_238122 %
                                                                8) % 8), NULL,
                                                              kernel_args_238117,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238119 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_218721",
                                    time_end_238119 - time_start_238118);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234371,
                                              "segred_tmp_mem_234371") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230620, &mem_230619,
                                        "mem_230619") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230619, "mem_230619") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 *
                      lifted_single_ma_l_arg_204224)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: number of elements processed sequentially per thread is m:",
                            (long long) 11, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: memory constraints is: ", (long long) 11,
                            '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: register constraints is: ",
                            (long long) 15, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "SegScan: sumT' is: ",
                            (long long) 2, '\n');
                
                int64_t numThreads_234408 = sdiv_up64(partition_sizze_203667 *
                                                      lifted_single_ma_l_arg_204224,
                                                      segscan_group_sizze_218767 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_218767;
                int64_t numGroups_234409 = sdiv_up64(partition_sizze_203667 *
                                                     lifted_single_ma_l_arg_204224,
                                                     segscan_group_sizze_218767 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_234410 =
                                       ctx->mainziid_counter_mem_234410;
                struct memblock_device status_flags_mem_234412;
                
                status_flags_mem_234412.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_234412,
                                          numGroups_234409,
                                          "status_flags_mem_234412")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_234414;
                
                aggregates_mem_234414.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_234414,
                                          (int64_t) 8 * numGroups_234409,
                                          "aggregates_mem_234414")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_234416;
                
                incprefixes_mem_234416.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_234416,
                                          (int64_t) 8 * numGroups_234409,
                                          "incprefixes_mem_234416")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_234412,
                                                 numGroups_234409,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_234416,
                                              "incprefixes_mem_234416") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_234414,
                                              "aggregates_mem_234414") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_234412,
                                              "status_flags_mem_234412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_238132 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_218767),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_218767 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_238134 = mem_230608.mem;
                CUdeviceptr kernel_arg_238135 = ext_mem_230620.mem;
                CUdeviceptr kernel_arg_238136 = mem_230625.mem;
                CUdeviceptr kernel_arg_238137 = mainziid_counter_mem_234410.mem;
                CUdeviceptr kernel_arg_238138 = status_flags_mem_234412.mem;
                CUdeviceptr kernel_arg_238139 = aggregates_mem_234414.mem;
                CUdeviceptr kernel_arg_238140 = incprefixes_mem_234416.mem;
                unsigned int shared_offset_238133 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203667 *
                                        lifted_single_ma_l_arg_204224,
                                        segscan_group_sizze_218767 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_218767 != 0) && 1 != 0) && 1 !=
                    0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = sdiv_up64(partition_sizze_203667 *
                                              lifted_single_ma_l_arg_204224,
                                              segscan_group_sizze_218767 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238129[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_238133,
                                                  &n_p_203574, &i64_res_203589,
                                                  &partition_sizze_203667,
                                                  &C_len_203724,
                                                  &lifted_single_ma_l_arg_204224,
                                                  &kernel_arg_238134,
                                                  &kernel_arg_238135,
                                                  &kernel_arg_238136,
                                                  &kernel_arg_238137,
                                                  &kernel_arg_238138,
                                                  &kernel_arg_238139,
                                                  &kernel_arg_238140};
                    int64_t time_start_238130 = 0, time_end_238131 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segscan_218773",
                                (long) sdiv_up64(partition_sizze_203667 *
                                                 lifted_single_ma_l_arg_204224,
                                                 segscan_group_sizze_218767 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_218767,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_238132 +
                                                            (8 -
                                                             shared_sizze_238132 %
                                                             8) % 8)));
                        time_start_238130 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_218773_runs,
                                                  &ctx->mainzisegscan_218773_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_218773,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_218767,
                                                          1, 1, 0 +
                                                          (shared_sizze_238132 +
                                                           (8 -
                                                            shared_sizze_238132 %
                                                            8) % 8), NULL,
                                                          kernel_args_238129,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238131 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_218773", time_end_238131 -
                                time_start_238130);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (memblock_unref_device(ctx, &incprefixes_mem_234416,
                                          "incprefixes_mem_234416") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_234414,
                                          "aggregates_mem_234414") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_234412,
                                          "status_flags_mem_234412") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230620, "ext_mem_230620") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230637;
            
            ext_mem_230637.references = NULL;
            
            int32_t local_memory_capacity_234588;
            
            local_memory_capacity_234588 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234588)) &&
                suff_outer_par_218799) {
                struct memblock_device mem_230628;
                
                mem_230628.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230628, binop_y_230623,
                                          "mem_230628")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230628,
                                                          (int64_t) 0,
                                                          mem_230625,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          lifted_single_ma_l_arg_204224,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230628, "mem_230628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230632;
                
                mem_230632.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230632, bytes_229288,
                                          "mem_230632")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238144 = mem_230628.mem;
                CUdeviceptr kernel_arg_238145 = mem_230632.mem;
                
                if ((((((1 && segmap_usable_groups_218816 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218815 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_218816;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238141[] = {&ctx->global_failure,
                                                  &n_p_203574,
                                                  &partition_sizze_203667,
                                                  &kernel_arg_238144,
                                                  &kernel_arg_238145};
                    int64_t time_start_238142 = 0, time_end_238143 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_218819",
                                (long) segmap_usable_groups_218816, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218815,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238142 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218819_runs,
                                                  &ctx->mainzisegmap_218819_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218819,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218815,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238141,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238143 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218819", time_end_238143 -
                                time_start_238142);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230628, "mem_230628") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230637, &mem_230632,
                                        "mem_230632") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230632, "mem_230632") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230628, "mem_230628") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230636;
                
                mem_230636.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230636, bytes_229288,
                                          "mem_230636")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203574 * (int64_t) 2,
                          segred_group_sizze_218846)) {
                    int64_t segment_sizze_nonzzero_234520 = smax64((int64_t) 1,
                                                                   n_p_203574);
                    int64_t num_threads_234521 = num_groups_218847 *
                            segred_group_sizze_218846;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218846,
                                                    segment_sizze_nonzzero_234520),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_218846,
                                                                           segment_sizze_nonzzero_234520))),
                                '\n');
                    
                    unsigned int shared_sizze_238149 = (int64_t) 8 *
                                 segred_group_sizze_218846;
                    CUdeviceptr kernel_arg_238151 = mem_230625.mem;
                    CUdeviceptr kernel_arg_238152 = mem_230636.mem;
                    unsigned int shared_offset_238150 = 0;
                    
                    if ((((((1 && num_groups_218847 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218846 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_218847;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238146[] = {&ctx->global_failure,
                                                      &shared_offset_238150,
                                                      &n_p_203574,
                                                      &partition_sizze_203667,
                                                      &lifted_single_ma_l_arg_204224,
                                                      &num_groups_218847,
                                                      &segment_sizze_nonzzero_234520,
                                                      &kernel_arg_238151,
                                                      &kernel_arg_238152};
                        int64_t time_start_238147 = 0, time_end_238148 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_small_218852",
                                    (long) num_groups_218847, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218846,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238149 +
                                                                (8 -
                                                                 shared_sizze_238149 %
                                                                 8) % 8)));
                            time_start_238147 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_218852_runs,
                                                      &ctx->mainzisegred_small_218852_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_218852,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218846,
                                                              1, 1, 0 +
                                                              (shared_sizze_238149 +
                                                               (8 -
                                                                shared_sizze_238149 %
                                                                8) % 8), NULL,
                                                              kernel_args_238146,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238148 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_218852",
                                    time_end_238148 - time_start_238147);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234547 =
                            sdiv_up64(num_groups_218847, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_234548 = sdiv_up64(n_p_203574,
                                                                   segred_group_sizze_218846 *
                                                                   groups_per_segment_234547);
                    int64_t virt_num_groups_234549 = groups_per_segment_234547 *
                            partition_sizze_203667;
                    int64_t num_threads_234550 = num_groups_218847 *
                            segred_group_sizze_218846;
                    int64_t threads_per_segment_234551 =
                            groups_per_segment_234547 *
                            segred_group_sizze_218846;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203574, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234549, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218847, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218846, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234548, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234547, '\n');
                    
                    struct memblock_device segred_tmp_mem_234552;
                    
                    segred_tmp_mem_234552.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234552,
                                              (int64_t) 8 *
                                              virt_num_groups_234549,
                                              "segred_tmp_mem_234552")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234554 =
                                           ctx->mainzicounter_mem_234554;
                    unsigned int shared_sizze_238157 = 1;
                    unsigned int shared_sizze_238159 = (int64_t) 8 *
                                 segred_group_sizze_218846;
                    CUdeviceptr kernel_arg_238161 = mem_230625.mem;
                    CUdeviceptr kernel_arg_238162 = mem_230636.mem;
                    CUdeviceptr kernel_arg_238163 = segred_tmp_mem_234552.mem;
                    CUdeviceptr kernel_arg_238164 =
                                mainzicounter_mem_234554.mem;
                    unsigned int shared_offset_238158 = 0;
                    unsigned int shared_offset_238160 = 0 +
                                 (shared_sizze_238157 + (8 -
                                                         shared_sizze_238157 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_218847 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218846 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_218847;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238154[] = {&ctx->global_failure,
                                                      &shared_offset_238158,
                                                      &shared_offset_238160,
                                                      &n_p_203574,
                                                      &partition_sizze_203667,
                                                      &lifted_single_ma_l_arg_204224,
                                                      &num_groups_218847,
                                                      &groups_per_segment_234547,
                                                      &elements_per_thread_234548,
                                                      &virt_num_groups_234549,
                                                      &threads_per_segment_234551,
                                                      &kernel_arg_238161,
                                                      &kernel_arg_238162,
                                                      &kernel_arg_238163,
                                                      &kernel_arg_238164};
                        int64_t time_start_238155 = 0, time_end_238156 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_large_218852",
                                    (long) num_groups_218847, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218846,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238157 +
                                                                (8 -
                                                                 shared_sizze_238157 %
                                                                 8) % 8) +
                                                               (shared_sizze_238159 +
                                                                (8 -
                                                                 shared_sizze_238159 %
                                                                 8) % 8)));
                            time_start_238155 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_218852_runs,
                                                      &ctx->mainzisegred_large_218852_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_218852,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218846,
                                                              1, 1, 0 +
                                                              (shared_sizze_238157 +
                                                               (8 -
                                                                shared_sizze_238157 %
                                                                8) % 8) +
                                                              (shared_sizze_238159 +
                                                               (8 -
                                                                shared_sizze_238159 %
                                                                8) % 8), NULL,
                                                              kernel_args_238154,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238156 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_218852",
                                    time_end_238156 - time_start_238155);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234552,
                                              "segred_tmp_mem_234552") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230637, &mem_230636,
                                        "mem_230636") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230636, "mem_230636") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 *
                      dyn_lifted_single_ma_l_arg_204234)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: number of elements processed sequentially per thread is m:",
                            (long long) 11, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: memory constraints is: ", (long long) 11,
                            '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: register constraints is: ",
                            (long long) 15, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "SegScan: sumT' is: ",
                            (long long) 2, '\n');
                
                int64_t numThreads_234589 = sdiv_up64(partition_sizze_203667 *
                                                      dyn_lifted_single_ma_l_arg_204234,
                                                      segscan_group_sizze_218898 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_218898;
                int64_t numGroups_234590 = sdiv_up64(partition_sizze_203667 *
                                                     dyn_lifted_single_ma_l_arg_204234,
                                                     segscan_group_sizze_218898 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_234591 =
                                       ctx->mainziid_counter_mem_234591;
                struct memblock_device status_flags_mem_234593;
                
                status_flags_mem_234593.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_234593,
                                          numGroups_234590,
                                          "status_flags_mem_234593")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_234595;
                
                aggregates_mem_234595.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_234595,
                                          (int64_t) 8 * numGroups_234590,
                                          "aggregates_mem_234595")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_234597;
                
                incprefixes_mem_234597.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_234597,
                                          (int64_t) 8 * numGroups_234590,
                                          "incprefixes_mem_234597")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_234593,
                                                 numGroups_234590,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_234597,
                                              "incprefixes_mem_234597") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_234595,
                                              "aggregates_mem_234595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_234593,
                                              "status_flags_mem_234593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_238169 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_218898),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_218898 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_238171 = mem_230625.mem;
                CUdeviceptr kernel_arg_238172 = ext_mem_230637.mem;
                CUdeviceptr kernel_arg_238173 = mem_230642.mem;
                CUdeviceptr kernel_arg_238174 = mainziid_counter_mem_234591.mem;
                CUdeviceptr kernel_arg_238175 = status_flags_mem_234593.mem;
                CUdeviceptr kernel_arg_238176 = aggregates_mem_234595.mem;
                CUdeviceptr kernel_arg_238177 = incprefixes_mem_234597.mem;
                unsigned int shared_offset_238170 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203667 *
                                        dyn_lifted_single_ma_l_arg_204234,
                                        segscan_group_sizze_218898 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_218898 != 0) && 1 != 0) && 1 !=
                    0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = sdiv_up64(partition_sizze_203667 *
                                              dyn_lifted_single_ma_l_arg_204234,
                                              segscan_group_sizze_218898 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238166[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_238170,
                                                  &n_p_203574, &i64_res_203589,
                                                  &partition_sizze_203667,
                                                  &lifted_single_ma_l_arg_204224,
                                                  &dyn_lifted_single_ma_l_arg_204234,
                                                  &kernel_arg_238171,
                                                  &kernel_arg_238172,
                                                  &kernel_arg_238173,
                                                  &kernel_arg_238174,
                                                  &kernel_arg_238175,
                                                  &kernel_arg_238176,
                                                  &kernel_arg_238177};
                    int64_t time_start_238167 = 0, time_end_238168 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segscan_218904",
                                (long) sdiv_up64(partition_sizze_203667 *
                                                 dyn_lifted_single_ma_l_arg_204234,
                                                 segscan_group_sizze_218898 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_218898,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_238169 +
                                                            (8 -
                                                             shared_sizze_238169 %
                                                             8) % 8)));
                        time_start_238167 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_218904_runs,
                                                  &ctx->mainzisegscan_218904_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_218904,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_218898,
                                                          1, 1, 0 +
                                                          (shared_sizze_238169 +
                                                           (8 -
                                                            shared_sizze_238169 %
                                                            8) % 8), NULL,
                                                          kernel_args_238166,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238168 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_218904", time_end_238168 -
                                time_start_238167);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (memblock_unref_device(ctx, &incprefixes_mem_234597,
                                          "incprefixes_mem_234597") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_234595,
                                          "aggregates_mem_234595") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_234593,
                                          "status_flags_mem_234593") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230637, "ext_mem_230637") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230654;
            
            ext_mem_230654.references = NULL;
            
            int32_t local_memory_capacity_234769;
            
            local_memory_capacity_234769 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234769)) &&
                suff_outer_par_218930) {
                struct memblock_device mem_230645;
                
                mem_230645.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230645, binop_y_230640,
                                          "mem_230645")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230645,
                                                          (int64_t) 0,
                                                          mem_230642,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          dyn_lifted_single_ma_l_arg_204234,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230645, "mem_230645") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230649;
                
                mem_230649.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230649, bytes_229288,
                                          "mem_230649")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238181 = mem_230645.mem;
                CUdeviceptr kernel_arg_238182 = mem_230649.mem;
                
                if ((((((1 && segmap_usable_groups_218947 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_218946 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_218947;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238178[] = {&ctx->global_failure,
                                                  &partition_sizze_203667,
                                                  &kernel_arg_238181,
                                                  &kernel_arg_238182};
                    int64_t time_start_238179 = 0, time_end_238180 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_218950",
                                (long) segmap_usable_groups_218947, (long) 1,
                                (long) 1, (long) segmap_group_sizze_218946,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238179 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_218950_runs,
                                                  &ctx->mainzisegmap_218950_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_218950,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_218946,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238178,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238180 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_218950", time_end_238180 -
                                time_start_238179);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230645, "mem_230645") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230654, &mem_230649,
                                        "mem_230649") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230649, "mem_230649") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230645, "mem_230645") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230653;
                
                mem_230653.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230653, bytes_229288,
                                          "mem_230653")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 6, segred_group_sizze_218977)) {
                    int64_t segment_sizze_nonzzero_234701 = smax64((int64_t) 1,
                                                                   (int64_t) 3);
                    int64_t num_threads_234702 = num_groups_218978 *
                            segred_group_sizze_218977;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) (int64_t) 3, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218977,
                                                    segment_sizze_nonzzero_234701),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_218977,
                                                                           segment_sizze_nonzzero_234701))),
                                '\n');
                    
                    unsigned int shared_sizze_238186 = (int64_t) 8 *
                                 segred_group_sizze_218977;
                    CUdeviceptr kernel_arg_238188 = mem_230642.mem;
                    CUdeviceptr kernel_arg_238189 = mem_230653.mem;
                    unsigned int shared_offset_238187 = 0;
                    
                    if ((((((1 && num_groups_218978 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218977 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_218978;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238183[] = {&ctx->global_failure,
                                                      &shared_offset_238187,
                                                      &partition_sizze_203667,
                                                      &dyn_lifted_single_ma_l_arg_204234,
                                                      &num_groups_218978,
                                                      &segment_sizze_nonzzero_234701,
                                                      &kernel_arg_238188,
                                                      &kernel_arg_238189};
                        int64_t time_start_238184 = 0, time_end_238185 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_small_218983",
                                    (long) num_groups_218978, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218977,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238186 +
                                                                (8 -
                                                                 shared_sizze_238186 %
                                                                 8) % 8)));
                            time_start_238184 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_218983_runs,
                                                      &ctx->mainzisegred_small_218983_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_218983,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218977,
                                                              1, 1, 0 +
                                                              (shared_sizze_238186 +
                                                               (8 -
                                                                shared_sizze_238186 %
                                                                8) % 8), NULL,
                                                              kernel_args_238183,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238185 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_218983",
                                    time_end_238185 - time_start_238184);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234728 =
                            sdiv_up64(num_groups_218978, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_234729 = sdiv_up64((int64_t) 3,
                                                                   segred_group_sizze_218977 *
                                                                   groups_per_segment_234728);
                    int64_t virt_num_groups_234730 = groups_per_segment_234728 *
                            partition_sizze_203667;
                    int64_t num_threads_234731 = num_groups_218978 *
                            segred_group_sizze_218977;
                    int64_t threads_per_segment_234732 =
                            groups_per_segment_234728 *
                            segred_group_sizze_218977;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) (int64_t) 3, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234730, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218978, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218977, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234729, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234728, '\n');
                    
                    struct memblock_device segred_tmp_mem_234733;
                    
                    segred_tmp_mem_234733.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234733,
                                              (int64_t) 8 *
                                              virt_num_groups_234730,
                                              "segred_tmp_mem_234733")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234735 =
                                           ctx->mainzicounter_mem_234735;
                    unsigned int shared_sizze_238194 = 1;
                    unsigned int shared_sizze_238196 = (int64_t) 8 *
                                 segred_group_sizze_218977;
                    CUdeviceptr kernel_arg_238198 = mem_230642.mem;
                    CUdeviceptr kernel_arg_238199 = mem_230653.mem;
                    CUdeviceptr kernel_arg_238200 = segred_tmp_mem_234733.mem;
                    CUdeviceptr kernel_arg_238201 =
                                mainzicounter_mem_234735.mem;
                    unsigned int shared_offset_238195 = 0;
                    unsigned int shared_offset_238197 = 0 +
                                 (shared_sizze_238194 + (8 -
                                                         shared_sizze_238194 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_218978 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_218977 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_218978;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238191[] = {&ctx->global_failure,
                                                      &shared_offset_238195,
                                                      &shared_offset_238197,
                                                      &partition_sizze_203667,
                                                      &dyn_lifted_single_ma_l_arg_204234,
                                                      &num_groups_218978,
                                                      &groups_per_segment_234728,
                                                      &elements_per_thread_234729,
                                                      &virt_num_groups_234730,
                                                      &threads_per_segment_234732,
                                                      &kernel_arg_238198,
                                                      &kernel_arg_238199,
                                                      &kernel_arg_238200,
                                                      &kernel_arg_238201};
                        int64_t time_start_238192 = 0, time_end_238193 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_large_218983",
                                    (long) num_groups_218978, (long) 1,
                                    (long) 1, (long) segred_group_sizze_218977,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_238194 +
                                                                (8 -
                                                                 shared_sizze_238194 %
                                                                 8) % 8) +
                                                               (shared_sizze_238196 +
                                                                (8 -
                                                                 shared_sizze_238196 %
                                                                 8) % 8)));
                            time_start_238192 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_218983_runs,
                                                      &ctx->mainzisegred_large_218983_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_218983,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_218977,
                                                              1, 1, 0 +
                                                              (shared_sizze_238194 +
                                                               (8 -
                                                                shared_sizze_238194 %
                                                                8) % 8) +
                                                              (shared_sizze_238196 +
                                                               (8 -
                                                                shared_sizze_238196 %
                                                                8) % 8), NULL,
                                                              kernel_args_238191,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238193 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_218983",
                                    time_end_238193 - time_start_238192);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234733,
                                              "segred_tmp_mem_234733") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230654, &mem_230653,
                                        "mem_230653") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230653, "mem_230653") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203667 * n_203572)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: number of elements processed sequentially per thread is m:",
                            (long long) 11, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: memory constraints is: ", (long long) 11,
                            '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c",
                            "SegScan: register constraints is: ",
                            (long long) 15, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "SegScan: sumT' is: ",
                            (long long) 2, '\n');
                
                int64_t numThreads_234770 = sdiv_up64(partition_sizze_203667 *
                                                      n_203572,
                                                      segscan_group_sizze_219029 *
                                                      (int64_t) 11) *
                        segscan_group_sizze_219029;
                int64_t numGroups_234771 = sdiv_up64(partition_sizze_203667 *
                                                     n_203572,
                                                     segscan_group_sizze_219029 *
                                                     (int64_t) 11);
                struct memblock_device mainziid_counter_mem_234772 =
                                       ctx->mainziid_counter_mem_234772;
                struct memblock_device status_flags_mem_234774;
                
                status_flags_mem_234774.references = NULL;
                if (memblock_alloc_device(ctx, &status_flags_mem_234774,
                                          numGroups_234771,
                                          "status_flags_mem_234774")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device aggregates_mem_234776;
                
                aggregates_mem_234776.references = NULL;
                if (memblock_alloc_device(ctx, &aggregates_mem_234776,
                                          (int64_t) 8 * numGroups_234771,
                                          "aggregates_mem_234776")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device incprefixes_mem_234778;
                
                incprefixes_mem_234778.references = NULL;
                if (memblock_alloc_device(ctx, &incprefixes_mem_234778,
                                          (int64_t) 8 * numGroups_234771,
                                          "incprefixes_mem_234778")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i8(ctx, status_flags_mem_234774,
                                                 numGroups_234771,
                                                 (int8_t) 0) != 0) {
                    if (memblock_unref_device(ctx, &incprefixes_mem_234778,
                                              "incprefixes_mem_234778") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &aggregates_mem_234776,
                                              "aggregates_mem_234776") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &status_flags_mem_234774,
                                              "status_flags_mem_234774") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                unsigned int shared_sizze_238206 = smax64(smax64((int64_t) 288,
                                                                 (int64_t) 8 *
                                                                 segscan_group_sizze_219029),
                                                          (int64_t) 11 *
                                                          segscan_group_sizze_219029 *
                                                          (int64_t) 8);
                CUdeviceptr kernel_arg_238208 = mem_230642.mem;
                CUdeviceptr kernel_arg_238209 = ext_mem_230654.mem;
                CUdeviceptr kernel_arg_238210 = mem_230659.mem;
                CUdeviceptr kernel_arg_238211 = mainziid_counter_mem_234772.mem;
                CUdeviceptr kernel_arg_238212 = status_flags_mem_234774.mem;
                CUdeviceptr kernel_arg_238213 = aggregates_mem_234776.mem;
                CUdeviceptr kernel_arg_238214 = incprefixes_mem_234778.mem;
                unsigned int shared_offset_238207 = 0;
                
                if ((((((1 && sdiv_up64(partition_sizze_203667 * n_203572,
                                        segscan_group_sizze_219029 *
                                        (int64_t) 11) != 0) && 1 != 0) && 1 !=
                       0) && segscan_group_sizze_219029 != 0) && 1 != 0) && 1 !=
                    0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = sdiv_up64(partition_sizze_203667 * n_203572,
                                              segscan_group_sizze_219029 *
                                              (int64_t) 11);
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238203[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_238207,
                                                  &n_203572,
                                                  &partition_sizze_203667,
                                                  &dyn_lifted_single_ma_l_arg_204234,
                                                  &kernel_arg_238208,
                                                  &kernel_arg_238209,
                                                  &kernel_arg_238210,
                                                  &kernel_arg_238211,
                                                  &kernel_arg_238212,
                                                  &kernel_arg_238213,
                                                  &kernel_arg_238214};
                    int64_t time_start_238204 = 0, time_end_238205 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segscan_219035",
                                (long) sdiv_up64(partition_sizze_203667 *
                                                 n_203572,
                                                 segscan_group_sizze_219029 *
                                                 (int64_t) 11), (long) 1,
                                (long) 1, (long) segscan_group_sizze_219029,
                                (long) 1, (long) 1, (int) (0 +
                                                           (shared_sizze_238206 +
                                                            (8 -
                                                             shared_sizze_238206 %
                                                             8) % 8)));
                        time_start_238204 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegscan_219035_runs,
                                                  &ctx->mainzisegscan_219035_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_219035,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segscan_group_sizze_219029,
                                                          1, 1, 0 +
                                                          (shared_sizze_238206 +
                                                           (8 -
                                                            shared_sizze_238206 %
                                                            8) % 8), NULL,
                                                          kernel_args_238203,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238205 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segscan_219035", time_end_238205 -
                                time_start_238204);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (memblock_unref_device(ctx, &incprefixes_mem_234778,
                                          "incprefixes_mem_234778") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &aggregates_mem_234776,
                                          "aggregates_mem_234776") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &status_flags_mem_234774,
                                          "status_flags_mem_234774") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230654, "ext_mem_230654") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_231016;
            
            ext_mem_231016.references = NULL;
            
            struct memblock_device ext_mem_231015;
            
            ext_mem_231015.references = NULL;
            if (cond_204250) {
                bool match_lit_205280 = (int64_t) 0 == d_l_203580;
                struct memblock_device ext_mem_230955;
                
                ext_mem_230955.references = NULL;
                
                struct memblock_device ext_mem_230954;
                
                ext_mem_230954.references = NULL;
                if (match_lit_205280) {
                    struct memblock_device mem_230663;
                    
                    mem_230663.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230663, bytes_229486,
                                              "mem_230663")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230663,
                                                      partition_sizze_203667 *
                                                      l_n_m_203733, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230663,
                                                  "mem_230663") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230954,
                                                  "ext_mem_230954") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230955,
                                                  "ext_mem_230955") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_219061;
                    
                    suff_outer_par_219061 =
                        *ctx->tuning_params.mainzisuff_outer_par_22 <=
                        partition_sizze_203667;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_22",
                                (long) partition_sizze_203667,
                                suff_outer_par_219061 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_219134;
                    
                    segmap_group_sizze_219134 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219065;
                    
                    int64_t num_groups_219135;
                    int32_t max_num_groups_234873;
                    
                    max_num_groups_234873 =
                        *ctx->tuning_params.mainzisegmap_num_groups_219067;
                    num_groups_219135 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203667,
                                                                             segmap_group_sizze_219134),
                                                                   sext_i32_i64(max_num_groups_234873))));
                    
                    int64_t segmap_group_sizze_219515;
                    
                    segmap_group_sizze_219515 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219206;
                    
                    bool suff_outer_par_219519;
                    
                    suff_outer_par_219519 =
                        *ctx->tuning_params.mainzisuff_outer_par_23 <=
                        nest_sizze_209582;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_23",
                                (long) nest_sizze_209582,
                                suff_outer_par_219519 ? "true" : "false");
                    
                    int64_t nest_sizze_219597 = q_l_203577 * nest_sizze_209582;
                    int64_t segred_group_sizze_219598;
                    
                    segred_group_sizze_219598 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219350;
                    
                    int64_t num_groups_219599;
                    int32_t max_num_groups_234874;
                    
                    max_num_groups_234874 =
                        *ctx->tuning_params.mainzisegred_num_groups_219352;
                    num_groups_219599 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219597,
                                                                             segred_group_sizze_219598),
                                                                   sext_i32_i64(max_num_groups_234874))));
                    
                    int64_t segmap_group_sizze_219636;
                    
                    segmap_group_sizze_219636 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219337;
                    
                    int64_t segred_group_sizze_219647;
                    
                    segred_group_sizze_219647 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219283;
                    
                    int64_t num_groups_219648;
                    int32_t max_num_groups_234875;
                    
                    max_num_groups_234875 =
                        *ctx->tuning_params.mainzisegred_num_groups_219285;
                    num_groups_219648 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219597,
                                                                             segred_group_sizze_219647),
                                                                   sext_i32_i64(max_num_groups_234875))));
                    
                    int64_t num_threads_232269 = segmap_group_sizze_219134 *
                            num_groups_219135;
                    int64_t total_sizze_232270 = bytes_229479 *
                            num_threads_232269;
                    struct memblock_device ext_mem_230721;
                    
                    ext_mem_230721.references = NULL;
                    
                    int32_t local_memory_capacity_235071;
                    
                    local_memory_capacity_235071 = ctx->cuda.max_shared_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235071)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235071))) &&
                        suff_outer_par_219061) {
                        struct memblock_device mem_230666;
                        
                        mem_230666.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230666,
                                                  binop_y_229485,
                                                  "mem_230666")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230666,
                                                                  (int64_t) 0,
                                                                  ext_mem_229520,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203733,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230669;
                        
                        mem_230669.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230669,
                                                  binop_y_229485,
                                                  "mem_230669")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230669,
                                                                  (int64_t) 0,
                                                                  ext_mem_229519,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203733,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230669,
                                                      "mem_230669") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230672;
                        
                        mem_230672.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230672,
                                                  binop_y_229284,
                                                  "mem_230672")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_234879;
                        
                        group_sizze_234879 =
                            *ctx->tuning_params.mainzigroup_sizze_234879;
                        
                        int64_t num_groups_234880 =
                                sdiv_up64(partition_sizze_203667 * n_203572,
                                          group_sizze_234879);
                        CUdeviceptr kernel_arg_238218 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_238219 = mem_230672.mem;
                        
                        if ((((((1 && num_groups_234880 != 0) && 1 != 0) && 1 !=
                               0) && group_sizze_234879 != 0) && 1 != 0) && 1 !=
                            0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = num_groups_234880;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238215[] = {&n_203572,
                                                          &partition_sizze_203667,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_238218,
                                                          &kernel_arg_238219};
                            int64_t time_start_238216 = 0, time_end_238217 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.copy_234876",
                                        (long) num_groups_234880, (long) 1,
                                        (long) 1, (long) group_sizze_234879,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238216 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzicopy_234876_runs,
                                                          &ctx->mainzicopy_234876_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_234876,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  group_sizze_234879,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238215,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238217 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.copy_234876", time_end_238217 -
                                        time_start_238216);
                            }
                        }
                        
                        struct memblock_device mem_230675;
                        
                        mem_230675.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230675,
                                                  binop_y_229284,
                                                  "mem_230675")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230675,
                                                                  (int64_t) 0,
                                                                  mem_230659,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203572,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230675,
                                                      "mem_230675") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230672,
                                                      "mem_230672") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230669,
                                                      "mem_230669") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230694;
                        
                        mem_230694.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230694,
                                                  binop_y_229485,
                                                  "mem_230694")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232138;
                        
                        color_232138.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232138,
                                                  total_sizze_232270,
                                                  "color_232138")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238223 = mem_230666.mem;
                        CUdeviceptr kernel_arg_238224 = mem_230669.mem;
                        CUdeviceptr kernel_arg_238225 = mem_230672.mem;
                        CUdeviceptr kernel_arg_238226 = mem_230675.mem;
                        CUdeviceptr kernel_arg_238227 = mem_230694.mem;
                        CUdeviceptr kernel_arg_238228 = color_232138.mem;
                        
                        if ((((((1 && num_groups_219135 != 0) && 1 != 0) && 1 !=
                               0) && segmap_group_sizze_219134 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = num_groups_219135;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238220[] = {&ctx->global_failure,
                                                          &n_203572,
                                                          &q_l_203577,
                                                          &jump_t_203582,
                                                          &partition_sizze_203667,
                                                          &l_n_m_203733,
                                                          &i_203760,
                                                          &num_groups_219135,
                                                          &num_threads_232269,
                                                          &kernel_arg_238223,
                                                          &kernel_arg_238224,
                                                          &kernel_arg_238225,
                                                          &kernel_arg_238226,
                                                          &kernel_arg_238227,
                                                          &kernel_arg_238228};
                            int64_t time_start_238221 = 0, time_end_238222 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_219139",
                                        (long) num_groups_219135, (long) 1,
                                        (long) 1,
                                        (long) segmap_group_sizze_219134,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238221 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_219139_runs,
                                                          &ctx->mainzisegmap_219139_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219139,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_219134,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238220,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238222 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_219139", time_end_238222 -
                                        time_start_238221);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_230666,
                                                  "mem_230666") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230669,
                                                  "mem_230669") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230672,
                                                  "mem_230672") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230675,
                                                  "mem_230675") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232138,
                                                  "color_232138") != 0)
                            return 1;
                        
                        struct memblock_device mem_230719;
                        
                        mem_230719.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230719,
                                                  bytes_229486, "mem_230719")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230719,
                                                                  (int64_t) 0,
                                                                  mem_230694,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203667,
                                                                  l_n_m_203733) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230719,
                                                      "mem_230719") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232138,
                                                      "color_232138") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230694,
                                                      "mem_230694") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230675,
                                                      "mem_230675") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230672,
                                                      "mem_230672") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230669,
                                                      "mem_230669") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230666,
                                                      "mem_230666") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230721,
                                                      "ext_mem_230721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230663,
                                                      "mem_230663") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230954,
                                                      "ext_mem_230954") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230955,
                                                      "ext_mem_230955") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_230694,
                                                  "mem_230694") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230721,
                                                &mem_230719, "mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230719,
                                                  "mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232138,
                                                  "color_232138") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230694,
                                                  "mem_230694") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230675,
                                                  "mem_230675") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230672,
                                                  "mem_230672") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230669,
                                                  "mem_230669") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230666,
                                                  "mem_230666") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_219516 =
                                sdiv_up64(nest_sizze_209582,
                                          segmap_group_sizze_219515);
                        struct memblock_device ext_mem_230715;
                        
                        ext_mem_230715.references = NULL;
                        
                        int32_t local_memory_capacity_235070;
                        
                        local_memory_capacity_235070 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_235070)) &&
                            suff_outer_par_219519) {
                            struct memblock_device mem_230699;
                            
                            mem_230699.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230699,
                                                      bytes_229486,
                                                      "mem_230699")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238232 = ext_mem_229519.mem;
                            CUdeviceptr kernel_arg_238233 = ext_mem_229520.mem;
                            CUdeviceptr kernel_arg_238234 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238235 = mem_230659.mem;
                            CUdeviceptr kernel_arg_238236 = mem_230699.mem;
                            
                            if ((((((1 && segmap_usable_groups_219516 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_219515 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_219516;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238229[] =
                                     {&ctx->global_failure, &n_203572,
                                      &q_l_203577, &jump_t_203582,
                                      &partition_sizze_203667, &l_n_m_203733,
                                      &i_203760, &ctx_param_ext_229596,
                                      &ctx_param_ext_229597,
                                      &ctx_param_ext_229599, &kernel_arg_238232,
                                      &kernel_arg_238233, &kernel_arg_238234,
                                      &kernel_arg_238235, &kernel_arg_238236};
                                int64_t time_start_238230 = 0, time_end_238231 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_219524",
                                            (long) segmap_usable_groups_219516,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_219515,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238230 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_219524_runs,
                                                              &ctx->mainzisegmap_219524_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219524,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_219515,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238229,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238231 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_219524",
                                            time_end_238231 -
                                            time_start_238230);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_230715,
                                                    &mem_230699,
                                                    "mem_230699") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230699,
                                                      "mem_230699") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_230704;
                            
                            mem_230704.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230704,
                                                      bytes_229486,
                                                      "mem_230704")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203577 * (int64_t) 2,
                                      segred_group_sizze_219598)) {
                                int64_t segment_sizze_nonzzero_234916 =
                                        smax64((int64_t) 1, q_l_203577);
                                int64_t num_threads_234917 = num_groups_219599 *
                                        segred_group_sizze_219598;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219598,
                                                                segment_sizze_nonzzero_234916),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               l_n_m_203733,
                                                                               squot64(segred_group_sizze_219598,
                                                                                       segment_sizze_nonzzero_234916))),
                                            '\n');
                                
                                unsigned int shared_sizze_238240 = (int64_t) 8 *
                                             segred_group_sizze_219598;
                                CUdeviceptr kernel_arg_238242 =
                                            ext_mem_229519.mem;
                                CUdeviceptr kernel_arg_238243 =
                                            ext_mem_229520.mem;
                                CUdeviceptr kernel_arg_238244 =
                                            mem_param_229601.mem;
                                CUdeviceptr kernel_arg_238245 = mem_230704.mem;
                                unsigned int shared_offset_238241 = 0;
                                
                                if ((((((1 && num_groups_219599 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219598 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_219599;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238237[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238241, &n_203572,
                                          &q_l_203577, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760,
                                          &num_groups_219599,
                                          &ctx_param_ext_229596,
                                          &ctx_param_ext_229597,
                                          &ctx_param_ext_229599,
                                          &segment_sizze_nonzzero_234916,
                                          &kernel_arg_238242,
                                          &kernel_arg_238243,
                                          &kernel_arg_238244,
                                          &kernel_arg_238245};
                                    int64_t time_start_238238 = 0,
                                            time_end_238239 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_small_219605",
                                                (long) num_groups_219599,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219598,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238240 +
                                                                            (8 -
                                                                             shared_sizze_238240 %
                                                                             8) %
                                                                            8)));
                                        time_start_238238 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_219605_runs,
                                                                  &ctx->mainzisegred_small_219605_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_219605,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219598,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238240 +
                                                                           (8 -
                                                                            shared_sizze_238240 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238237,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238239 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_219605",
                                                time_end_238239 -
                                                time_start_238238);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234945 =
                                        sdiv_up64(num_groups_219599,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         l_n_m_203733));
                                int64_t elements_per_thread_234946 =
                                        sdiv_up64(q_l_203577,
                                                  segred_group_sizze_219598 *
                                                  groups_per_segment_234945);
                                int64_t virt_num_groups_234947 =
                                        groups_per_segment_234945 *
                                        (partition_sizze_203667 * l_n_m_203733);
                                int64_t num_threads_234948 = num_groups_219599 *
                                        segred_group_sizze_219598;
                                int64_t threads_per_segment_234949 =
                                        groups_per_segment_234945 *
                                        segred_group_sizze_219598;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234947,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219599,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219598,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234946,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234945,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234950;
                                
                                segred_tmp_mem_234950.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234950,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234947,
                                                          "segred_tmp_mem_234950")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234952
                                                       =
                                                       ctx->mainzicounter_mem_234952;
                                unsigned int shared_sizze_238250 = 1;
                                unsigned int shared_sizze_238252 = (int64_t) 8 *
                                             segred_group_sizze_219598;
                                CUdeviceptr kernel_arg_238254 =
                                            ext_mem_229519.mem;
                                CUdeviceptr kernel_arg_238255 =
                                            ext_mem_229520.mem;
                                CUdeviceptr kernel_arg_238256 =
                                            mem_param_229601.mem;
                                CUdeviceptr kernel_arg_238257 = mem_230704.mem;
                                CUdeviceptr kernel_arg_238258 =
                                            segred_tmp_mem_234950.mem;
                                CUdeviceptr kernel_arg_238259 =
                                            mainzicounter_mem_234952.mem;
                                unsigned int shared_offset_238251 = 0;
                                unsigned int shared_offset_238253 = 0 +
                                             (shared_sizze_238250 + (8 -
                                                                     shared_sizze_238250 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_219599 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219598 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_219599;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238247[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238251,
                                          &shared_offset_238253, &n_203572,
                                          &q_l_203577, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760,
                                          &num_groups_219599,
                                          &ctx_param_ext_229596,
                                          &ctx_param_ext_229597,
                                          &ctx_param_ext_229599,
                                          &groups_per_segment_234945,
                                          &elements_per_thread_234946,
                                          &virt_num_groups_234947,
                                          &threads_per_segment_234949,
                                          &kernel_arg_238254,
                                          &kernel_arg_238255,
                                          &kernel_arg_238256,
                                          &kernel_arg_238257,
                                          &kernel_arg_238258,
                                          &kernel_arg_238259};
                                    int64_t time_start_238248 = 0,
                                            time_end_238249 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_large_219605",
                                                (long) num_groups_219599,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219598,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238250 +
                                                                            (8 -
                                                                             shared_sizze_238250 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238252 +
                                                                            (8 -
                                                                             shared_sizze_238252 %
                                                                             8) %
                                                                            8)));
                                        time_start_238248 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_219605_runs,
                                                                  &ctx->mainzisegred_large_219605_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_219605,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219598,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238250 +
                                                                           (8 -
                                                                            shared_sizze_238250 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238252 +
                                                                           (8 -
                                                                            shared_sizze_238252 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238247,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238249 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_219605",
                                                time_end_238249 -
                                                time_start_238248);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234950,
                                                          "segred_tmp_mem_234950") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_219637 =
                                    sdiv_up64(nest_sizze_209582,
                                              segmap_group_sizze_219636);
                            struct memblock_device mem_230709;
                            
                            mem_230709.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230709,
                                                      bytes_229486,
                                                      "mem_230709")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238263 = mem_230704.mem;
                            CUdeviceptr kernel_arg_238264 = mem_230709.mem;
                            
                            if ((((((1 && segmap_usable_groups_219637 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_219636 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_219637;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238260[] =
                                     {&ctx->global_failure,
                                      &partition_sizze_203667, &l_n_m_203733,
                                      &kernel_arg_238263, &kernel_arg_238264};
                                int64_t time_start_238261 = 0, time_end_238262 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_219641",
                                            (long) segmap_usable_groups_219637,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_219636,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238261 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_219641_runs,
                                                              &ctx->mainzisegmap_219641_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219641,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_219636,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238260,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238262 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_219641",
                                            time_end_238262 -
                                            time_start_238261);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230704,
                                                      "mem_230704") != 0)
                                return 1;
                            
                            struct memblock_device mem_230714;
                            
                            mem_230714.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230714,
                                                      bytes_229486,
                                                      "mem_230714")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203577 * (int64_t) 2,
                                      segred_group_sizze_219647)) {
                                int64_t segment_sizze_nonzzero_234998 =
                                        smax64((int64_t) 1, q_l_203577);
                                int64_t num_threads_234999 = num_groups_219648 *
                                        segred_group_sizze_219647;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219647,
                                                                segment_sizze_nonzzero_234998),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               l_n_m_203733,
                                                                               squot64(segred_group_sizze_219647,
                                                                                       segment_sizze_nonzzero_234998))),
                                            '\n');
                                
                                unsigned int shared_sizze_238268 = (int64_t) 8 *
                                             segred_group_sizze_219647;
                                CUdeviceptr kernel_arg_238270 =
                                            ext_mem_229519.mem;
                                CUdeviceptr kernel_arg_238271 =
                                            ext_mem_229520.mem;
                                CUdeviceptr kernel_arg_238272 =
                                            mem_param_229601.mem;
                                CUdeviceptr kernel_arg_238273 = mem_230659.mem;
                                CUdeviceptr kernel_arg_238274 = mem_230709.mem;
                                CUdeviceptr kernel_arg_238275 = mem_230714.mem;
                                unsigned int shared_offset_238269 = 0;
                                
                                if ((((((1 && num_groups_219648 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219647 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_219648;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238265[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238269, &n_203572,
                                          &q_l_203577, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760,
                                          &num_groups_219648,
                                          &ctx_param_ext_229596,
                                          &ctx_param_ext_229597,
                                          &ctx_param_ext_229599,
                                          &segment_sizze_nonzzero_234998,
                                          &kernel_arg_238270,
                                          &kernel_arg_238271,
                                          &kernel_arg_238272,
                                          &kernel_arg_238273,
                                          &kernel_arg_238274,
                                          &kernel_arg_238275};
                                    int64_t time_start_238266 = 0,
                                            time_end_238267 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_small_219654",
                                                (long) num_groups_219648,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219647,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238268 +
                                                                            (8 -
                                                                             shared_sizze_238268 %
                                                                             8) %
                                                                            8)));
                                        time_start_238266 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_219654_runs,
                                                                  &ctx->mainzisegred_small_219654_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_219654,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219647,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238268 +
                                                                           (8 -
                                                                            shared_sizze_238268 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238265,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238267 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_219654",
                                                time_end_238267 -
                                                time_start_238266);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235027 =
                                        sdiv_up64(num_groups_219648,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         l_n_m_203733));
                                int64_t elements_per_thread_235028 =
                                        sdiv_up64(q_l_203577,
                                                  segred_group_sizze_219647 *
                                                  groups_per_segment_235027);
                                int64_t virt_num_groups_235029 =
                                        groups_per_segment_235027 *
                                        (partition_sizze_203667 * l_n_m_203733);
                                int64_t num_threads_235030 = num_groups_219648 *
                                        segred_group_sizze_219647;
                                int64_t threads_per_segment_235031 =
                                        groups_per_segment_235027 *
                                        segred_group_sizze_219647;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         l_n_m_203733), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203577, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235029,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219648,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219647,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235028,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235027,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235032;
                                
                                segred_tmp_mem_235032.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235032,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235029,
                                                          "segred_tmp_mem_235032")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235034
                                                       =
                                                       ctx->mainzicounter_mem_235034;
                                unsigned int shared_sizze_238280 = 1;
                                unsigned int shared_sizze_238282 = (int64_t) 8 *
                                             segred_group_sizze_219647;
                                CUdeviceptr kernel_arg_238284 =
                                            ext_mem_229519.mem;
                                CUdeviceptr kernel_arg_238285 =
                                            ext_mem_229520.mem;
                                CUdeviceptr kernel_arg_238286 =
                                            mem_param_229601.mem;
                                CUdeviceptr kernel_arg_238287 = mem_230659.mem;
                                CUdeviceptr kernel_arg_238288 = mem_230709.mem;
                                CUdeviceptr kernel_arg_238289 = mem_230714.mem;
                                CUdeviceptr kernel_arg_238290 =
                                            segred_tmp_mem_235032.mem;
                                CUdeviceptr kernel_arg_238291 =
                                            mainzicounter_mem_235034.mem;
                                unsigned int shared_offset_238281 = 0;
                                unsigned int shared_offset_238283 = 0 +
                                             (shared_sizze_238280 + (8 -
                                                                     shared_sizze_238280 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_219648 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_219647 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_219648;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238277[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238281,
                                          &shared_offset_238283, &n_203572,
                                          &q_l_203577, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760,
                                          &num_groups_219648,
                                          &ctx_param_ext_229596,
                                          &ctx_param_ext_229597,
                                          &ctx_param_ext_229599,
                                          &groups_per_segment_235027,
                                          &elements_per_thread_235028,
                                          &virt_num_groups_235029,
                                          &threads_per_segment_235031,
                                          &kernel_arg_238284,
                                          &kernel_arg_238285,
                                          &kernel_arg_238286,
                                          &kernel_arg_238287,
                                          &kernel_arg_238288,
                                          &kernel_arg_238289,
                                          &kernel_arg_238290,
                                          &kernel_arg_238291};
                                    int64_t time_start_238278 = 0,
                                            time_end_238279 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_large_219654",
                                                (long) num_groups_219648,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_219647,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238280 +
                                                                            (8 -
                                                                             shared_sizze_238280 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238282 +
                                                                            (8 -
                                                                             shared_sizze_238282 %
                                                                             8) %
                                                                            8)));
                                        time_start_238278 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_219654_runs,
                                                                  &ctx->mainzisegred_large_219654_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_219654,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_219647,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238280 +
                                                                           (8 -
                                                                            shared_sizze_238280 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238282 +
                                                                           (8 -
                                                                            shared_sizze_238282 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238277,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238279 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_219654",
                                                time_end_238279 -
                                                time_start_238278);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235032,
                                                          "segred_tmp_mem_235032") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_230709,
                                                      "mem_230709") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230715,
                                                    &mem_230714,
                                                    "mem_230714") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230714,
                                                      "mem_230714") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230709,
                                                      "mem_230709") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230704,
                                                      "mem_230704") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230721,
                                                &ext_mem_230715,
                                                "ext_mem_230715") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230715,
                                                  "ext_mem_230715") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230955,
                                            &ext_mem_230721,
                                            "ext_mem_230721") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230954, &mem_230663,
                                            "mem_230663") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230721,
                                              "ext_mem_230721") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230663, "mem_230663") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205349 = (int64_t) 1 == d_l_203580;
                    struct memblock_device ext_mem_230953;
                    
                    ext_mem_230953.references = NULL;
                    
                    struct memblock_device ext_mem_230952;
                    
                    ext_mem_230952.references = NULL;
                    if (match_lit_205349) {
                        bool suff_outer_par_219694;
                        
                        suff_outer_par_219694 =
                            *ctx->tuning_params.mainzisuff_outer_par_24 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_24",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_219694 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_219796;
                        
                        segmap_group_sizze_219796 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219698;
                        
                        int64_t num_groups_219797;
                        int32_t max_num_groups_235072;
                        
                        max_num_groups_235072 =
                            *ctx->tuning_params.mainzisegmap_num_groups_219700;
                        num_groups_219797 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_219796),
                                                                       sext_i32_i64(max_num_groups_235072))));
                        
                        int64_t segmap_group_sizze_220312;
                        
                        segmap_group_sizze_220312 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219898;
                        
                        bool suff_outer_par_220316;
                        
                        suff_outer_par_220316 =
                            *ctx->tuning_params.mainzisuff_outer_par_25 <=
                            nest_sizze_209582;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_25",
                                    (long) nest_sizze_209582,
                                    suff_outer_par_220316 ? "true" : "false");
                        
                        int64_t nest_sizze_220424 = q_l_203577 *
                                nest_sizze_209582;
                        int64_t segred_group_sizze_220425;
                        
                        segred_group_sizze_220425 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220102;
                        
                        int64_t num_groups_220426;
                        int32_t max_num_groups_235073;
                        
                        max_num_groups_235073 =
                            *ctx->tuning_params.mainzisegred_num_groups_220104;
                        num_groups_220426 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220424,
                                                                                 segred_group_sizze_220425),
                                                                       sext_i32_i64(max_num_groups_235073))));
                        
                        int64_t segmap_group_sizze_220473;
                        
                        segmap_group_sizze_220473 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220080;
                        
                        int64_t segred_group_sizze_220495;
                        
                        segred_group_sizze_220495 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220008;
                        
                        int64_t num_groups_220496;
                        int32_t max_num_groups_235074;
                        
                        max_num_groups_235074 =
                            *ctx->tuning_params.mainzisegred_num_groups_220010;
                        num_groups_220496 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220424,
                                                                                 segred_group_sizze_220495),
                                                                       sext_i32_i64(max_num_groups_235074))));
                        
                        int64_t num_threads_232275 = segmap_group_sizze_219796 *
                                num_groups_219797;
                        int64_t total_sizze_232276 = bytes_229479 *
                                num_threads_232275;
                        int64_t total_sizze_232277 = bytes_229479 *
                                num_threads_232275;
                        struct memblock_device ext_mem_230828;
                        
                        ext_mem_230828.references = NULL;
                        
                        struct memblock_device ext_mem_230827;
                        
                        ext_mem_230827.references = NULL;
                        
                        int32_t local_memory_capacity_235321;
                        
                        local_memory_capacity_235321 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235321)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235321))) &&
                            suff_outer_par_219694) {
                            struct memblock_device mem_230724;
                            
                            mem_230724.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230724,
                                                      binop_y_229485,
                                                      "mem_230724")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230724,
                                                                      (int64_t) 0,
                                                                      ext_mem_229520,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230727;
                            
                            mem_230727.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230727,
                                                      binop_y_229485,
                                                      "mem_230727")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230727,
                                                                      (int64_t) 0,
                                                                      ext_mem_229519,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230730;
                            
                            mem_230730.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230730,
                                                      binop_y_229284,
                                                      "mem_230730")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235078;
                            
                            group_sizze_235078 =
                                *ctx->tuning_params.mainzigroup_sizze_235078;
                            
                            int64_t num_groups_235079 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_235078);
                            CUdeviceptr kernel_arg_238295 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238296 = mem_230730.mem;
                            
                            if ((((((1 && num_groups_235079 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_235078 != 0) && 1 !=
                                 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_235079;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238292[] = {&n_203572,
                                                              &partition_sizze_203667,
                                                              &ctx_param_ext_229596,
                                                              &ctx_param_ext_229597,
                                                              &ctx_param_ext_229599,
                                                              &kernel_arg_238295,
                                                              &kernel_arg_238296};
                                int64_t time_start_238293 = 0, time_end_238294 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.copy_235075",
                                            (long) num_groups_235079, (long) 1,
                                            (long) 1, (long) group_sizze_235078,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238293 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_235075_runs,
                                                              &ctx->mainzicopy_235075_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235075,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_235078,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238292,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238294 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_235075",
                                            time_end_238294 -
                                            time_start_238293);
                                }
                            }
                            
                            struct memblock_device mem_230733;
                            
                            mem_230733.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230733,
                                                      binop_y_229284,
                                                      "mem_230733")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230733,
                                                                      (int64_t) 0,
                                                                      mem_230659,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230733,
                                                          "mem_230733") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230730,
                                                          "mem_230730") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230767;
                            
                            mem_230767.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230767,
                                                      binop_y_229485,
                                                      "mem_230767")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230770;
                            
                            mem_230770.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230770,
                                                      binop_y_229485,
                                                      "mem_230770")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232139;
                            
                            color_232139.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232139,
                                                      total_sizze_232276,
                                                      "color_232139")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232140;
                            
                            color_232140.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232140,
                                                      total_sizze_232277,
                                                      "color_232140")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238300 = mem_230724.mem;
                            CUdeviceptr kernel_arg_238301 = mem_230727.mem;
                            CUdeviceptr kernel_arg_238302 = mem_230730.mem;
                            CUdeviceptr kernel_arg_238303 = mem_230733.mem;
                            CUdeviceptr kernel_arg_238304 = mem_230767.mem;
                            CUdeviceptr kernel_arg_238305 = mem_230770.mem;
                            CUdeviceptr kernel_arg_238306 = color_232139.mem;
                            CUdeviceptr kernel_arg_238307 = color_232140.mem;
                            
                            if ((((((1 && num_groups_219797 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_219796 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_219797;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238297[] =
                                     {&ctx->global_failure, &n_203572,
                                      &q_l_203577, &jump_t_203582,
                                      &partition_sizze_203667, &l_n_m_203733,
                                      &i_203760, &num_groups_219797,
                                      &num_threads_232275, &kernel_arg_238300,
                                      &kernel_arg_238301, &kernel_arg_238302,
                                      &kernel_arg_238303, &kernel_arg_238304,
                                      &kernel_arg_238305, &kernel_arg_238306,
                                      &kernel_arg_238307};
                                int64_t time_start_238298 = 0, time_end_238299 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_219802",
                                            (long) num_groups_219797, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_219796,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238298 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_219802_runs,
                                                              &ctx->mainzisegmap_219802_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_219802,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_219796,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238297,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238299 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_219802",
                                            time_end_238299 -
                                            time_start_238298);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230724,
                                                      "mem_230724") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230727,
                                                      "mem_230727") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230730,
                                                      "mem_230730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230733,
                                                      "mem_230733") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232139,
                                                      "color_232139") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232140,
                                                      "color_232140") != 0)
                                return 1;
                            
                            struct memblock_device mem_230820;
                            
                            mem_230820.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230820,
                                                      bytes_229486,
                                                      "mem_230820")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230820,
                                                                      (int64_t) 0,
                                                                      mem_230767,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232140,
                                                          "color_232140") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232139,
                                                          "color_232139") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230770,
                                                          "mem_230770") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230767,
                                                          "mem_230767") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230733,
                                                          "mem_230733") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230730,
                                                          "mem_230730") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230767,
                                                      "mem_230767") != 0)
                                return 1;
                            
                            struct memblock_device mem_230825;
                            
                            mem_230825.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230825,
                                                      bytes_229486,
                                                      "mem_230825")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230825,
                                                                      (int64_t) 0,
                                                                      mem_230770,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230825,
                                                          "mem_230825") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232140,
                                                          "color_232140") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232139,
                                                          "color_232139") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230770,
                                                          "mem_230770") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230767,
                                                          "mem_230767") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230733,
                                                          "mem_230733") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230730,
                                                          "mem_230730") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230727,
                                                          "mem_230727") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230724,
                                                          "mem_230724") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230827,
                                                          "ext_mem_230827") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230828,
                                                          "ext_mem_230828") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230770,
                                                      "mem_230770") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230828,
                                                    &mem_230820,
                                                    "mem_230820") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230827,
                                                    &mem_230825,
                                                    "mem_230825") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230825,
                                                      "mem_230825") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230820,
                                                      "mem_230820") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232140,
                                                      "color_232140") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232139,
                                                      "color_232139") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230770,
                                                      "mem_230770") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230767,
                                                      "mem_230767") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230733,
                                                      "mem_230733") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230730,
                                                      "mem_230730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230727,
                                                      "mem_230727") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230724,
                                                      "mem_230724") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_220313 =
                                    sdiv_up64(nest_sizze_209582,
                                              segmap_group_sizze_220312);
                            struct memblock_device ext_mem_230816;
                            
                            ext_mem_230816.references = NULL;
                            
                            struct memblock_device ext_mem_230815;
                            
                            ext_mem_230815.references = NULL;
                            
                            int32_t local_memory_capacity_235320;
                            
                            local_memory_capacity_235320 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235320)) &&
                                suff_outer_par_220316) {
                                struct memblock_device mem_230775;
                                
                                mem_230775.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230775,
                                                          bytes_229486,
                                                          "mem_230775")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230779;
                                
                                mem_230779.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230779,
                                                          bytes_229486,
                                                          "mem_230779")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238311 =
                                            ext_mem_229519.mem;
                                CUdeviceptr kernel_arg_238312 =
                                            ext_mem_229520.mem;
                                CUdeviceptr kernel_arg_238313 =
                                            mem_param_229601.mem;
                                CUdeviceptr kernel_arg_238314 = mem_230659.mem;
                                CUdeviceptr kernel_arg_238315 = mem_230775.mem;
                                CUdeviceptr kernel_arg_238316 = mem_230779.mem;
                                
                                if ((((((1 && segmap_usable_groups_220313 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_220312 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_220313;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238308[] =
                                         {&ctx->global_failure, &n_203572,
                                          &q_l_203577, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760,
                                          &ctx_param_ext_229596,
                                          &ctx_param_ext_229597,
                                          &ctx_param_ext_229599,
                                          &kernel_arg_238311,
                                          &kernel_arg_238312,
                                          &kernel_arg_238313,
                                          &kernel_arg_238314,
                                          &kernel_arg_238315,
                                          &kernel_arg_238316};
                                    int64_t time_start_238309 = 0,
                                            time_end_238310 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_220323",
                                                (long) segmap_usable_groups_220313,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_220312,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238309 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_220323_runs,
                                                                  &ctx->mainzisegmap_220323_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_220323,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_220312,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238308,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238310 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_220323",
                                                time_end_238310 -
                                                time_start_238309);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230816,
                                                        &mem_230775,
                                                        "mem_230775") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230815,
                                                        &mem_230779,
                                                        "mem_230779") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230779,
                                                          "mem_230779") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230775,
                                                          "mem_230775") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230784;
                                
                                mem_230784.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230784,
                                                          bytes_229486,
                                                          "mem_230784")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230788;
                                
                                mem_230788.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230788,
                                                          bytes_229486,
                                                          "mem_230788")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230792;
                                
                                mem_230792.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230792,
                                                          bytes_229486,
                                                          "mem_230792")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_220425)) {
                                    int64_t segment_sizze_nonzzero_235124 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_235125 =
                                            num_groups_220426 *
                                            segred_group_sizze_220425;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220425,
                                                                    segment_sizze_nonzzero_235124),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_220425,
                                                                                           segment_sizze_nonzzero_235124))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238320 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220425;
                                    unsigned int shared_sizze_238322 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220425;
                                    unsigned int shared_sizze_238324 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220425;
                                    CUdeviceptr kernel_arg_238326 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238327 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238328 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238329 =
                                                mem_230784.mem;
                                    CUdeviceptr kernel_arg_238330 =
                                                mem_230788.mem;
                                    CUdeviceptr kernel_arg_238331 =
                                                mem_230792.mem;
                                    unsigned int shared_offset_238321 = 0;
                                    unsigned int shared_offset_238323 = 0 +
                                                 (shared_sizze_238320 + (8 -
                                                                         shared_sizze_238320 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238325 = 0 +
                                                 (shared_sizze_238320 + (8 -
                                                                         shared_sizze_238320 %
                                                                         8) %
                                                  8) + (shared_sizze_238322 +
                                                        (8 -
                                                         shared_sizze_238322 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_220426 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220425 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_220426;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238317[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238321,
                                              &shared_offset_238323,
                                              &shared_offset_238325, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_220426,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &segment_sizze_nonzzero_235124,
                                              &kernel_arg_238326,
                                              &kernel_arg_238327,
                                              &kernel_arg_238328,
                                              &kernel_arg_238329,
                                              &kernel_arg_238330,
                                              &kernel_arg_238331};
                                        int64_t time_start_238318 = 0,
                                                time_end_238319 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_220434",
                                                    (long) num_groups_220426,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220425,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238320 +
                                                            (8 -
                                                             shared_sizze_238320 %
                                                             8) % 8) +
                                                           (shared_sizze_238322 +
                                                            (8 -
                                                             shared_sizze_238322 %
                                                             8) % 8) +
                                                           (shared_sizze_238324 +
                                                            (8 -
                                                             shared_sizze_238324 %
                                                             8) % 8)));
                                            time_start_238318 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_220434_runs,
                                                                &ctx->mainzisegred_small_220434_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_220434,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220425,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238320 +
                                                                               (8 -
                                                                                shared_sizze_238320 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238322 +
                                                                               (8 -
                                                                                shared_sizze_238322 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238324 +
                                                                               (8 -
                                                                                shared_sizze_238324 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238317,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238319 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220434",
                                                    time_end_238319 -
                                                    time_start_238318);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235165 =
                                            sdiv_up64(num_groups_220426,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235166 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_220425 *
                                                      groups_per_segment_235165);
                                    int64_t virt_num_groups_235167 =
                                            groups_per_segment_235165 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235168 =
                                            num_groups_220426 *
                                            segred_group_sizze_220425;
                                    int64_t threads_per_segment_235169 =
                                            groups_per_segment_235165 *
                                            segred_group_sizze_220425;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235167,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220426,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220425,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235166,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235165,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235170;
                                    
                                    segred_tmp_mem_235170.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235170,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235167,
                                                              "segred_tmp_mem_235170")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235172;
                                    
                                    segred_tmp_mem_235172.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235172,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235167,
                                                              "segred_tmp_mem_235172")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235174;
                                    
                                    segred_tmp_mem_235174.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235174,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235167,
                                                              "segred_tmp_mem_235174")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235176 =
                                    ctx->mainzicounter_mem_235176;
                                    unsigned int shared_sizze_238336 = 1;
                                    unsigned int shared_sizze_238338 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220425;
                                    unsigned int shared_sizze_238340 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220425;
                                    unsigned int shared_sizze_238342 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220425;
                                    CUdeviceptr kernel_arg_238344 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238345 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238346 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238347 =
                                                mem_230784.mem;
                                    CUdeviceptr kernel_arg_238348 =
                                                mem_230788.mem;
                                    CUdeviceptr kernel_arg_238349 =
                                                mem_230792.mem;
                                    CUdeviceptr kernel_arg_238350 =
                                                segred_tmp_mem_235170.mem;
                                    CUdeviceptr kernel_arg_238351 =
                                                segred_tmp_mem_235172.mem;
                                    CUdeviceptr kernel_arg_238352 =
                                                segred_tmp_mem_235174.mem;
                                    CUdeviceptr kernel_arg_238353 =
                                                mainzicounter_mem_235176.mem;
                                    unsigned int shared_offset_238337 = 0;
                                    unsigned int shared_offset_238339 = 0 +
                                                 (shared_sizze_238336 + (8 -
                                                                         shared_sizze_238336 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238341 = 0 +
                                                 (shared_sizze_238336 + (8 -
                                                                         shared_sizze_238336 %
                                                                         8) %
                                                  8) + (shared_sizze_238338 +
                                                        (8 -
                                                         shared_sizze_238338 %
                                                         8) % 8);
                                    unsigned int shared_offset_238343 = 0 +
                                                 (shared_sizze_238336 + (8 -
                                                                         shared_sizze_238336 %
                                                                         8) %
                                                  8) + (shared_sizze_238338 +
                                                        (8 -
                                                         shared_sizze_238338 %
                                                         8) % 8) +
                                                 (shared_sizze_238340 + (8 -
                                                                         shared_sizze_238340 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_220426 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220425 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_220426;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238333[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238337,
                                              &shared_offset_238339,
                                              &shared_offset_238341,
                                              &shared_offset_238343, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_220426,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &groups_per_segment_235165,
                                              &elements_per_thread_235166,
                                              &virt_num_groups_235167,
                                              &threads_per_segment_235169,
                                              &kernel_arg_238344,
                                              &kernel_arg_238345,
                                              &kernel_arg_238346,
                                              &kernel_arg_238347,
                                              &kernel_arg_238348,
                                              &kernel_arg_238349,
                                              &kernel_arg_238350,
                                              &kernel_arg_238351,
                                              &kernel_arg_238352,
                                              &kernel_arg_238353};
                                        int64_t time_start_238334 = 0,
                                                time_end_238335 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_220434",
                                                    (long) num_groups_220426,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220425,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238336 +
                                                            (8 -
                                                             shared_sizze_238336 %
                                                             8) % 8) +
                                                           (shared_sizze_238338 +
                                                            (8 -
                                                             shared_sizze_238338 %
                                                             8) % 8) +
                                                           (shared_sizze_238340 +
                                                            (8 -
                                                             shared_sizze_238340 %
                                                             8) % 8) +
                                                           (shared_sizze_238342 +
                                                            (8 -
                                                             shared_sizze_238342 %
                                                             8) % 8)));
                                            time_start_238334 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_220434_runs,
                                                                &ctx->mainzisegred_large_220434_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_220434,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220425,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238336 +
                                                                               (8 -
                                                                                shared_sizze_238336 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238338 +
                                                                               (8 -
                                                                                shared_sizze_238338 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238340 +
                                                                               (8 -
                                                                                shared_sizze_238340 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238342 +
                                                                               (8 -
                                                                                shared_sizze_238342 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238333,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238335 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220434",
                                                    time_end_238335 -
                                                    time_start_238334);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235174,
                                                              "segred_tmp_mem_235174") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235172,
                                                              "segred_tmp_mem_235172") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235170,
                                                              "segred_tmp_mem_235170") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_220474 =
                                        sdiv_up64(nest_sizze_209582,
                                                  segmap_group_sizze_220473);
                                struct memblock_device mem_230797;
                                
                                mem_230797.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230797,
                                                          bytes_229486,
                                                          "mem_230797")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230801;
                                
                                mem_230801.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230801,
                                                          bytes_229486,
                                                          "mem_230801")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230805;
                                
                                mem_230805.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230805,
                                                          bytes_229486,
                                                          "mem_230805")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238357 = mem_230784.mem;
                                CUdeviceptr kernel_arg_238358 = mem_230788.mem;
                                CUdeviceptr kernel_arg_238359 = mem_230792.mem;
                                CUdeviceptr kernel_arg_238360 = mem_230797.mem;
                                CUdeviceptr kernel_arg_238361 = mem_230801.mem;
                                CUdeviceptr kernel_arg_238362 = mem_230805.mem;
                                
                                if ((((((1 && segmap_usable_groups_220474 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_220473 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_220474;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238354[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &kernel_arg_238357,
                                          &kernel_arg_238358,
                                          &kernel_arg_238359,
                                          &kernel_arg_238360,
                                          &kernel_arg_238361,
                                          &kernel_arg_238362};
                                    int64_t time_start_238355 = 0,
                                            time_end_238356 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_220480",
                                                (long) segmap_usable_groups_220474,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_220473,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238355 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_220480_runs,
                                                                  &ctx->mainzisegmap_220480_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_220480,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_220473,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238354,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238356 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_220480",
                                                time_end_238356 -
                                                time_start_238355);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230784,
                                                          "mem_230784") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230788,
                                                          "mem_230788") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230792,
                                                          "mem_230792") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230810;
                                
                                mem_230810.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230810,
                                                          bytes_229486,
                                                          "mem_230810")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230814;
                                
                                mem_230814.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230814,
                                                          bytes_229486,
                                                          "mem_230814")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_220495)) {
                                    int64_t segment_sizze_nonzzero_235234 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_235235 =
                                            num_groups_220496 *
                                            segred_group_sizze_220495;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220495,
                                                                    segment_sizze_nonzzero_235234),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_220495,
                                                                                           segment_sizze_nonzzero_235234))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238366 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220495;
                                    unsigned int shared_sizze_238368 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220495;
                                    CUdeviceptr kernel_arg_238370 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238371 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238372 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238373 =
                                                mem_230659.mem;
                                    CUdeviceptr kernel_arg_238374 =
                                                mem_230797.mem;
                                    CUdeviceptr kernel_arg_238375 =
                                                mem_230801.mem;
                                    CUdeviceptr kernel_arg_238376 =
                                                mem_230805.mem;
                                    CUdeviceptr kernel_arg_238377 =
                                                mem_230810.mem;
                                    CUdeviceptr kernel_arg_238378 =
                                                mem_230814.mem;
                                    unsigned int shared_offset_238367 = 0;
                                    unsigned int shared_offset_238369 = 0 +
                                                 (shared_sizze_238366 + (8 -
                                                                         shared_sizze_238366 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_220496 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220495 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_220496;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238363[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238367,
                                              &shared_offset_238369, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_220496,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &segment_sizze_nonzzero_235234,
                                              &kernel_arg_238370,
                                              &kernel_arg_238371,
                                              &kernel_arg_238372,
                                              &kernel_arg_238373,
                                              &kernel_arg_238374,
                                              &kernel_arg_238375,
                                              &kernel_arg_238376,
                                              &kernel_arg_238377,
                                              &kernel_arg_238378};
                                        int64_t time_start_238364 = 0,
                                                time_end_238365 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_220503",
                                                    (long) num_groups_220496,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220495,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238366 +
                                                            (8 -
                                                             shared_sizze_238366 %
                                                             8) % 8) +
                                                           (shared_sizze_238368 +
                                                            (8 -
                                                             shared_sizze_238368 %
                                                             8) % 8)));
                                            time_start_238364 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_220503_runs,
                                                                &ctx->mainzisegred_small_220503_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_220503,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220495,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238366 +
                                                                               (8 -
                                                                                shared_sizze_238366 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238368 +
                                                                               (8 -
                                                                                shared_sizze_238368 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238363,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238365 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220503",
                                                    time_end_238365 -
                                                    time_start_238364);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235269 =
                                            sdiv_up64(num_groups_220496,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235270 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_220495 *
                                                      groups_per_segment_235269);
                                    int64_t virt_num_groups_235271 =
                                            groups_per_segment_235269 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235272 =
                                            num_groups_220496 *
                                            segred_group_sizze_220495;
                                    int64_t threads_per_segment_235273 =
                                            groups_per_segment_235269 *
                                            segred_group_sizze_220495;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235271,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220496,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220495,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235270,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235269,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235274;
                                    
                                    segred_tmp_mem_235274.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235274,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235271,
                                                              "segred_tmp_mem_235274")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235276;
                                    
                                    segred_tmp_mem_235276.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235276,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235271,
                                                              "segred_tmp_mem_235276")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235278 =
                                    ctx->mainzicounter_mem_235278;
                                    unsigned int shared_sizze_238383 = 1;
                                    unsigned int shared_sizze_238385 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220495;
                                    unsigned int shared_sizze_238387 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_220495;
                                    CUdeviceptr kernel_arg_238389 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238390 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238391 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238392 =
                                                mem_230659.mem;
                                    CUdeviceptr kernel_arg_238393 =
                                                mem_230797.mem;
                                    CUdeviceptr kernel_arg_238394 =
                                                mem_230801.mem;
                                    CUdeviceptr kernel_arg_238395 =
                                                mem_230805.mem;
                                    CUdeviceptr kernel_arg_238396 =
                                                mem_230810.mem;
                                    CUdeviceptr kernel_arg_238397 =
                                                mem_230814.mem;
                                    CUdeviceptr kernel_arg_238398 =
                                                segred_tmp_mem_235274.mem;
                                    CUdeviceptr kernel_arg_238399 =
                                                segred_tmp_mem_235276.mem;
                                    CUdeviceptr kernel_arg_238400 =
                                                mainzicounter_mem_235278.mem;
                                    unsigned int shared_offset_238384 = 0;
                                    unsigned int shared_offset_238386 = 0 +
                                                 (shared_sizze_238383 + (8 -
                                                                         shared_sizze_238383 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238388 = 0 +
                                                 (shared_sizze_238383 + (8 -
                                                                         shared_sizze_238383 %
                                                                         8) %
                                                  8) + (shared_sizze_238385 +
                                                        (8 -
                                                         shared_sizze_238385 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_220496 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_220495 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_220496;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238380[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238384,
                                              &shared_offset_238386,
                                              &shared_offset_238388, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_220496,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &groups_per_segment_235269,
                                              &elements_per_thread_235270,
                                              &virt_num_groups_235271,
                                              &threads_per_segment_235273,
                                              &kernel_arg_238389,
                                              &kernel_arg_238390,
                                              &kernel_arg_238391,
                                              &kernel_arg_238392,
                                              &kernel_arg_238393,
                                              &kernel_arg_238394,
                                              &kernel_arg_238395,
                                              &kernel_arg_238396,
                                              &kernel_arg_238397,
                                              &kernel_arg_238398,
                                              &kernel_arg_238399,
                                              &kernel_arg_238400};
                                        int64_t time_start_238381 = 0,
                                                time_end_238382 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_220503",
                                                    (long) num_groups_220496,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_220495,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238383 +
                                                            (8 -
                                                             shared_sizze_238383 %
                                                             8) % 8) +
                                                           (shared_sizze_238385 +
                                                            (8 -
                                                             shared_sizze_238385 %
                                                             8) % 8) +
                                                           (shared_sizze_238387 +
                                                            (8 -
                                                             shared_sizze_238387 %
                                                             8) % 8)));
                                            time_start_238381 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_220503_runs,
                                                                &ctx->mainzisegred_large_220503_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_220503,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_220495,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238383 +
                                                                               (8 -
                                                                                shared_sizze_238383 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238385 +
                                                                               (8 -
                                                                                shared_sizze_238385 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238387 +
                                                                               (8 -
                                                                                shared_sizze_238387 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238380,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238382 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220503",
                                                    time_end_238382 -
                                                    time_start_238381);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235276,
                                                              "segred_tmp_mem_235276") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235274,
                                                              "segred_tmp_mem_235274") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230797,
                                                          "mem_230797") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230801,
                                                          "mem_230801") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230805,
                                                          "mem_230805") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230816,
                                                        &mem_230810,
                                                        "mem_230810") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230815,
                                                        &mem_230814,
                                                        "mem_230814") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230814,
                                                          "mem_230814") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230810,
                                                          "mem_230810") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230805,
                                                          "mem_230805") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230801,
                                                          "mem_230801") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230797,
                                                          "mem_230797") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230792,
                                                          "mem_230792") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230788,
                                                          "mem_230788") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230784,
                                                          "mem_230784") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230828,
                                                    &ext_mem_230816,
                                                    "ext_mem_230816") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230827,
                                                    &ext_mem_230815,
                                                    "ext_mem_230815") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230815,
                                                      "ext_mem_230815") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230816,
                                                      "ext_mem_230816") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230953,
                                                &ext_mem_230828,
                                                "ext_mem_230828") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230952,
                                                &ext_mem_230827,
                                                "ext_mem_230827") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230827,
                                                  "ext_mem_230827") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230828,
                                                  "ext_mem_230828") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_220559;
                        
                        suff_outer_par_220559 =
                            *ctx->tuning_params.mainzisuff_outer_par_26 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_26",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_220559 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_220693;
                        
                        segmap_group_sizze_220693 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220563;
                        
                        int64_t num_groups_220694;
                        int32_t max_num_groups_235322;
                        
                        max_num_groups_235322 =
                            *ctx->tuning_params.mainzisegmap_num_groups_220565;
                        num_groups_220694 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_220693),
                                                                       sext_i32_i64(max_num_groups_235322))));
                        
                        int64_t segmap_group_sizze_221357;
                        
                        segmap_group_sizze_221357 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220827;
                        
                        bool suff_outer_par_221361;
                        
                        suff_outer_par_221361 =
                            *ctx->tuning_params.mainzisuff_outer_par_27 <=
                            nest_sizze_209582;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_27",
                                    (long) nest_sizze_209582,
                                    suff_outer_par_221361 ? "true" : "false");
                        
                        int64_t nest_sizze_221501 = q_l_203577 *
                                nest_sizze_209582;
                        int64_t segred_group_sizze_221502;
                        
                        segred_group_sizze_221502 =
                            *ctx->tuning_params.mainzisegred_group_sizze_221099;
                        
                        int64_t num_groups_221503;
                        int32_t max_num_groups_235323;
                        
                        max_num_groups_235323 =
                            *ctx->tuning_params.mainzisegred_num_groups_221101;
                        num_groups_221503 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221501,
                                                                                 segred_group_sizze_221502),
                                                                       sext_i32_i64(max_num_groups_235323))));
                        
                        int64_t segmap_group_sizze_221560;
                        
                        segmap_group_sizze_221560 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_221058;
                        
                        int64_t segred_group_sizze_221603;
                        
                        segred_group_sizze_221603 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220973;
                        
                        int64_t num_groups_221604;
                        int32_t max_num_groups_235324;
                        
                        max_num_groups_235324 =
                            *ctx->tuning_params.mainzisegred_num_groups_220975;
                        num_groups_221604 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221501,
                                                                                 segred_group_sizze_221603),
                                                                       sext_i32_i64(max_num_groups_235324))));
                        
                        int64_t num_threads_232282 = segmap_group_sizze_220693 *
                                num_groups_220694;
                        int64_t total_sizze_232283 = bytes_229479 *
                                num_threads_232282;
                        int64_t total_sizze_232284 = bytes_229479 *
                                num_threads_232282;
                        struct memblock_device ext_mem_230951;
                        
                        ext_mem_230951.references = NULL;
                        
                        struct memblock_device ext_mem_230950;
                        
                        ext_mem_230950.references = NULL;
                        
                        int32_t local_memory_capacity_235603;
                        
                        local_memory_capacity_235603 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235603)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235603))) &&
                            suff_outer_par_220559) {
                            struct memblock_device mem_230831;
                            
                            mem_230831.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230831,
                                                      binop_y_229485,
                                                      "mem_230831")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230831,
                                                                      (int64_t) 0,
                                                                      ext_mem_229520,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230834;
                            
                            mem_230834.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230834,
                                                      binop_y_229485,
                                                      "mem_230834")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230834,
                                                                      (int64_t) 0,
                                                                      ext_mem_229519,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203733,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230837;
                            
                            mem_230837.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230837,
                                                      binop_y_229284,
                                                      "mem_230837")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235328;
                            
                            group_sizze_235328 =
                                *ctx->tuning_params.mainzigroup_sizze_235328;
                            
                            int64_t num_groups_235329 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_235328);
                            CUdeviceptr kernel_arg_238404 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238405 = mem_230837.mem;
                            
                            if ((((((1 && num_groups_235329 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_235328 != 0) && 1 !=
                                 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_235329;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238401[] = {&n_203572,
                                                              &partition_sizze_203667,
                                                              &ctx_param_ext_229596,
                                                              &ctx_param_ext_229597,
                                                              &ctx_param_ext_229599,
                                                              &kernel_arg_238404,
                                                              &kernel_arg_238405};
                                int64_t time_start_238402 = 0, time_end_238403 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.copy_235325",
                                            (long) num_groups_235329, (long) 1,
                                            (long) 1, (long) group_sizze_235328,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238402 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_235325_runs,
                                                              &ctx->mainzicopy_235325_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235325,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_235328,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238401,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238403 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_235325",
                                            time_end_238403 -
                                            time_start_238402);
                                }
                            }
                            
                            struct memblock_device mem_230840;
                            
                            mem_230840.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230840,
                                                      binop_y_229284,
                                                      "mem_230840")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230840,
                                                                      (int64_t) 0,
                                                                      mem_230659,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230837,
                                                          "mem_230837") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230874;
                            
                            mem_230874.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230874,
                                                      binop_y_229485,
                                                      "mem_230874")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230877;
                            
                            mem_230877.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230877,
                                                      binop_y_229485,
                                                      "mem_230877")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232141;
                            
                            color_232141.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232141,
                                                      total_sizze_232283,
                                                      "color_232141")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232142;
                            
                            color_232142.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232142,
                                                      total_sizze_232284,
                                                      "color_232142")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238409 = mem_230831.mem;
                            CUdeviceptr kernel_arg_238410 = mem_230834.mem;
                            CUdeviceptr kernel_arg_238411 = mem_230837.mem;
                            CUdeviceptr kernel_arg_238412 = mem_230840.mem;
                            CUdeviceptr kernel_arg_238413 = mem_230874.mem;
                            CUdeviceptr kernel_arg_238414 = mem_230877.mem;
                            CUdeviceptr kernel_arg_238415 = color_232141.mem;
                            CUdeviceptr kernel_arg_238416 = color_232142.mem;
                            
                            if ((((((1 && num_groups_220694 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_220693 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_220694;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238406[] =
                                     {&ctx->global_failure, &n_203572,
                                      &q_l_203577, &jump_t_203582,
                                      &partition_sizze_203667, &l_n_m_203733,
                                      &i_203760, &num_groups_220694,
                                      &num_threads_232282, &kernel_arg_238409,
                                      &kernel_arg_238410, &kernel_arg_238411,
                                      &kernel_arg_238412, &kernel_arg_238413,
                                      &kernel_arg_238414, &kernel_arg_238415,
                                      &kernel_arg_238416};
                                int64_t time_start_238407 = 0, time_end_238408 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_220699",
                                            (long) num_groups_220694, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_220693,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238407 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_220699_runs,
                                                              &ctx->mainzisegmap_220699_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_220699,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_220693,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238406,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238408 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_220699",
                                            time_end_238408 -
                                            time_start_238407);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230831,
                                                      "mem_230831") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230834,
                                                      "mem_230834") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230837,
                                                      "mem_230837") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230840,
                                                      "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232141,
                                                      "color_232141") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232142,
                                                      "color_232142") != 0)
                                return 1;
                            
                            struct memblock_device mem_230943;
                            
                            mem_230943.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230943,
                                                      bytes_229486,
                                                      "mem_230943")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230943,
                                                                      (int64_t) 0,
                                                                      mem_230874,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230943,
                                                          "mem_230943") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232142,
                                                          "color_232142") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232141,
                                                          "color_232141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230877,
                                                          "mem_230877") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230874,
                                                          "mem_230874") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230837,
                                                          "mem_230837") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230874,
                                                      "mem_230874") != 0)
                                return 1;
                            
                            struct memblock_device mem_230948;
                            
                            mem_230948.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230948,
                                                      bytes_229486,
                                                      "mem_230948")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230948,
                                                                      (int64_t) 0,
                                                                      mem_230877,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      l_n_m_203733) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230948,
                                                          "mem_230948") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230943,
                                                          "mem_230943") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232142,
                                                          "color_232142") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232141,
                                                          "color_232141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230877,
                                                          "mem_230877") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230874,
                                                          "mem_230874") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230837,
                                                          "mem_230837") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230834,
                                                          "mem_230834") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230831,
                                                          "mem_230831") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230950,
                                                          "ext_mem_230950") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230951,
                                                          "ext_mem_230951") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230952,
                                                          "ext_mem_230952") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230953,
                                                          "ext_mem_230953") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230954,
                                                          "ext_mem_230954") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230955,
                                                          "ext_mem_230955") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230877,
                                                      "mem_230877") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230951,
                                                    &mem_230943,
                                                    "mem_230943") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230950,
                                                    &mem_230948,
                                                    "mem_230948") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230948,
                                                      "mem_230948") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230943,
                                                      "mem_230943") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232142,
                                                      "color_232142") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232141,
                                                      "color_232141") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230877,
                                                      "mem_230877") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230874,
                                                      "mem_230874") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230840,
                                                      "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230837,
                                                      "mem_230837") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230834,
                                                      "mem_230834") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230831,
                                                      "mem_230831") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_221358 =
                                    sdiv_up64(nest_sizze_209582,
                                              segmap_group_sizze_221357);
                            struct memblock_device ext_mem_230939;
                            
                            ext_mem_230939.references = NULL;
                            
                            struct memblock_device ext_mem_230938;
                            
                            ext_mem_230938.references = NULL;
                            
                            int32_t local_memory_capacity_235602;
                            
                            local_memory_capacity_235602 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235602)) &&
                                suff_outer_par_221361) {
                                struct memblock_device mem_230882;
                                
                                mem_230882.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230882,
                                                          bytes_229486,
                                                          "mem_230882")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230886;
                                
                                mem_230886.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230886,
                                                          bytes_229486,
                                                          "mem_230886")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238420 =
                                            ext_mem_229519.mem;
                                CUdeviceptr kernel_arg_238421 =
                                            ext_mem_229520.mem;
                                CUdeviceptr kernel_arg_238422 =
                                            mem_param_229601.mem;
                                CUdeviceptr kernel_arg_238423 = mem_230659.mem;
                                CUdeviceptr kernel_arg_238424 = mem_230882.mem;
                                CUdeviceptr kernel_arg_238425 = mem_230886.mem;
                                
                                if ((((((1 && segmap_usable_groups_221358 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_221357 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_221358;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238417[] =
                                         {&ctx->global_failure, &n_203572,
                                          &q_l_203577, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &i_203760,
                                          &ctx_param_ext_229596,
                                          &ctx_param_ext_229597,
                                          &ctx_param_ext_229599,
                                          &kernel_arg_238420,
                                          &kernel_arg_238421,
                                          &kernel_arg_238422,
                                          &kernel_arg_238423,
                                          &kernel_arg_238424,
                                          &kernel_arg_238425};
                                    int64_t time_start_238418 = 0,
                                            time_end_238419 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_221368",
                                                (long) segmap_usable_groups_221358,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_221357,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238418 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_221368_runs,
                                                                  &ctx->mainzisegmap_221368_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_221368,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_221357,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238417,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238419 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_221368",
                                                time_end_238419 -
                                                time_start_238418);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230939,
                                                        &mem_230882,
                                                        "mem_230882") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230938,
                                                        &mem_230886,
                                                        "mem_230886") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230886,
                                                          "mem_230886") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230882,
                                                          "mem_230882") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230891;
                                
                                mem_230891.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230891,
                                                          bytes_229486,
                                                          "mem_230891")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230895;
                                
                                mem_230895.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230895,
                                                          bytes_229486,
                                                          "mem_230895")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230899;
                                
                                mem_230899.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230899,
                                                          bytes_229486,
                                                          "mem_230899")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230903;
                                
                                mem_230903.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230903,
                                                          bytes_229486,
                                                          "mem_230903")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230907;
                                
                                mem_230907.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230907,
                                                          bytes_229486,
                                                          "mem_230907")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_221502)) {
                                    int64_t segment_sizze_nonzzero_235378 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_235379 =
                                            num_groups_221503 *
                                            segred_group_sizze_221502;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221502,
                                                                    segment_sizze_nonzzero_235378),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_221502,
                                                                                           segment_sizze_nonzzero_235378))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238429 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238431 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238433 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238435 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238437 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    CUdeviceptr kernel_arg_238439 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238440 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238441 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238442 =
                                                mem_230891.mem;
                                    CUdeviceptr kernel_arg_238443 =
                                                mem_230895.mem;
                                    CUdeviceptr kernel_arg_238444 =
                                                mem_230899.mem;
                                    CUdeviceptr kernel_arg_238445 =
                                                mem_230903.mem;
                                    CUdeviceptr kernel_arg_238446 =
                                                mem_230907.mem;
                                    unsigned int shared_offset_238430 = 0;
                                    unsigned int shared_offset_238432 = 0 +
                                                 (shared_sizze_238429 + (8 -
                                                                         shared_sizze_238429 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238434 = 0 +
                                                 (shared_sizze_238429 + (8 -
                                                                         shared_sizze_238429 %
                                                                         8) %
                                                  8) + (shared_sizze_238431 +
                                                        (8 -
                                                         shared_sizze_238431 %
                                                         8) % 8);
                                    unsigned int shared_offset_238436 = 0 +
                                                 (shared_sizze_238429 + (8 -
                                                                         shared_sizze_238429 %
                                                                         8) %
                                                  8) + (shared_sizze_238431 +
                                                        (8 -
                                                         shared_sizze_238431 %
                                                         8) % 8) +
                                                 (shared_sizze_238433 + (8 -
                                                                         shared_sizze_238433 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238438 = 0 +
                                                 (shared_sizze_238429 + (8 -
                                                                         shared_sizze_238429 %
                                                                         8) %
                                                  8) + (shared_sizze_238431 +
                                                        (8 -
                                                         shared_sizze_238431 %
                                                         8) % 8) +
                                                 (shared_sizze_238433 + (8 -
                                                                         shared_sizze_238433 %
                                                                         8) %
                                                  8) + (shared_sizze_238435 +
                                                        (8 -
                                                         shared_sizze_238435 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_221503 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221502 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_221503;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238426[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238430,
                                              &shared_offset_238432,
                                              &shared_offset_238434,
                                              &shared_offset_238436,
                                              &shared_offset_238438, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_221503,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &segment_sizze_nonzzero_235378,
                                              &kernel_arg_238439,
                                              &kernel_arg_238440,
                                              &kernel_arg_238441,
                                              &kernel_arg_238442,
                                              &kernel_arg_238443,
                                              &kernel_arg_238444,
                                              &kernel_arg_238445,
                                              &kernel_arg_238446};
                                        int64_t time_start_238427 = 0,
                                                time_end_238428 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_221513",
                                                    (long) num_groups_221503,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221502,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238429 +
                                                            (8 -
                                                             shared_sizze_238429 %
                                                             8) % 8) +
                                                           (shared_sizze_238431 +
                                                            (8 -
                                                             shared_sizze_238431 %
                                                             8) % 8) +
                                                           (shared_sizze_238433 +
                                                            (8 -
                                                             shared_sizze_238433 %
                                                             8) % 8) +
                                                           (shared_sizze_238435 +
                                                            (8 -
                                                             shared_sizze_238435 %
                                                             8) % 8) +
                                                           (shared_sizze_238437 +
                                                            (8 -
                                                             shared_sizze_238437 %
                                                             8) % 8)));
                                            time_start_238427 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_221513_runs,
                                                                &ctx->mainzisegred_small_221513_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_221513,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221502,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238429 +
                                                                               (8 -
                                                                                shared_sizze_238429 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238431 +
                                                                               (8 -
                                                                                shared_sizze_238431 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238433 +
                                                                               (8 -
                                                                                shared_sizze_238433 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238435 +
                                                                               (8 -
                                                                                shared_sizze_238435 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238437 +
                                                                               (8 -
                                                                                shared_sizze_238437 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238426,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238428 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221513",
                                                    time_end_238428 -
                                                    time_start_238427);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235431 =
                                            sdiv_up64(num_groups_221503,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235432 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_221502 *
                                                      groups_per_segment_235431);
                                    int64_t virt_num_groups_235433 =
                                            groups_per_segment_235431 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235434 =
                                            num_groups_221503 *
                                            segred_group_sizze_221502;
                                    int64_t threads_per_segment_235435 =
                                            groups_per_segment_235431 *
                                            segred_group_sizze_221502;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235433,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221503,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221502,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235432,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235431,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235436;
                                    
                                    segred_tmp_mem_235436.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235436,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235433,
                                                              "segred_tmp_mem_235436")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235438;
                                    
                                    segred_tmp_mem_235438.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235438,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235433,
                                                              "segred_tmp_mem_235438")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235440;
                                    
                                    segred_tmp_mem_235440.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235440,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235433,
                                                              "segred_tmp_mem_235440")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235442;
                                    
                                    segred_tmp_mem_235442.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235442,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235433,
                                                              "segred_tmp_mem_235442")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235444;
                                    
                                    segred_tmp_mem_235444.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235444,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235433,
                                                              "segred_tmp_mem_235444")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235446 =
                                    ctx->mainzicounter_mem_235446;
                                    unsigned int shared_sizze_238451 = 1;
                                    unsigned int shared_sizze_238453 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238455 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238457 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238459 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    unsigned int shared_sizze_238461 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221502;
                                    CUdeviceptr kernel_arg_238463 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238464 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238465 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238466 =
                                                mem_230891.mem;
                                    CUdeviceptr kernel_arg_238467 =
                                                mem_230895.mem;
                                    CUdeviceptr kernel_arg_238468 =
                                                mem_230899.mem;
                                    CUdeviceptr kernel_arg_238469 =
                                                mem_230903.mem;
                                    CUdeviceptr kernel_arg_238470 =
                                                mem_230907.mem;
                                    CUdeviceptr kernel_arg_238471 =
                                                segred_tmp_mem_235436.mem;
                                    CUdeviceptr kernel_arg_238472 =
                                                segred_tmp_mem_235438.mem;
                                    CUdeviceptr kernel_arg_238473 =
                                                segred_tmp_mem_235440.mem;
                                    CUdeviceptr kernel_arg_238474 =
                                                segred_tmp_mem_235442.mem;
                                    CUdeviceptr kernel_arg_238475 =
                                                segred_tmp_mem_235444.mem;
                                    CUdeviceptr kernel_arg_238476 =
                                                mainzicounter_mem_235446.mem;
                                    unsigned int shared_offset_238452 = 0;
                                    unsigned int shared_offset_238454 = 0 +
                                                 (shared_sizze_238451 + (8 -
                                                                         shared_sizze_238451 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238456 = 0 +
                                                 (shared_sizze_238451 + (8 -
                                                                         shared_sizze_238451 %
                                                                         8) %
                                                  8) + (shared_sizze_238453 +
                                                        (8 -
                                                         shared_sizze_238453 %
                                                         8) % 8);
                                    unsigned int shared_offset_238458 = 0 +
                                                 (shared_sizze_238451 + (8 -
                                                                         shared_sizze_238451 %
                                                                         8) %
                                                  8) + (shared_sizze_238453 +
                                                        (8 -
                                                         shared_sizze_238453 %
                                                         8) % 8) +
                                                 (shared_sizze_238455 + (8 -
                                                                         shared_sizze_238455 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238460 = 0 +
                                                 (shared_sizze_238451 + (8 -
                                                                         shared_sizze_238451 %
                                                                         8) %
                                                  8) + (shared_sizze_238453 +
                                                        (8 -
                                                         shared_sizze_238453 %
                                                         8) % 8) +
                                                 (shared_sizze_238455 + (8 -
                                                                         shared_sizze_238455 %
                                                                         8) %
                                                  8) + (shared_sizze_238457 +
                                                        (8 -
                                                         shared_sizze_238457 %
                                                         8) % 8);
                                    unsigned int shared_offset_238462 = 0 +
                                                 (shared_sizze_238451 + (8 -
                                                                         shared_sizze_238451 %
                                                                         8) %
                                                  8) + (shared_sizze_238453 +
                                                        (8 -
                                                         shared_sizze_238453 %
                                                         8) % 8) +
                                                 (shared_sizze_238455 + (8 -
                                                                         shared_sizze_238455 %
                                                                         8) %
                                                  8) + (shared_sizze_238457 +
                                                        (8 -
                                                         shared_sizze_238457 %
                                                         8) % 8) +
                                                 (shared_sizze_238459 + (8 -
                                                                         shared_sizze_238459 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_221503 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221502 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_221503;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238448[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238452,
                                              &shared_offset_238454,
                                              &shared_offset_238456,
                                              &shared_offset_238458,
                                              &shared_offset_238460,
                                              &shared_offset_238462, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_221503,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &groups_per_segment_235431,
                                              &elements_per_thread_235432,
                                              &virt_num_groups_235433,
                                              &threads_per_segment_235435,
                                              &kernel_arg_238463,
                                              &kernel_arg_238464,
                                              &kernel_arg_238465,
                                              &kernel_arg_238466,
                                              &kernel_arg_238467,
                                              &kernel_arg_238468,
                                              &kernel_arg_238469,
                                              &kernel_arg_238470,
                                              &kernel_arg_238471,
                                              &kernel_arg_238472,
                                              &kernel_arg_238473,
                                              &kernel_arg_238474,
                                              &kernel_arg_238475,
                                              &kernel_arg_238476};
                                        int64_t time_start_238449 = 0,
                                                time_end_238450 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_221513",
                                                    (long) num_groups_221503,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221502,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238451 +
                                                            (8 -
                                                             shared_sizze_238451 %
                                                             8) % 8) +
                                                           (shared_sizze_238453 +
                                                            (8 -
                                                             shared_sizze_238453 %
                                                             8) % 8) +
                                                           (shared_sizze_238455 +
                                                            (8 -
                                                             shared_sizze_238455 %
                                                             8) % 8) +
                                                           (shared_sizze_238457 +
                                                            (8 -
                                                             shared_sizze_238457 %
                                                             8) % 8) +
                                                           (shared_sizze_238459 +
                                                            (8 -
                                                             shared_sizze_238459 %
                                                             8) % 8) +
                                                           (shared_sizze_238461 +
                                                            (8 -
                                                             shared_sizze_238461 %
                                                             8) % 8)));
                                            time_start_238449 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_221513_runs,
                                                                &ctx->mainzisegred_large_221513_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_221513,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221502,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238451 +
                                                                               (8 -
                                                                                shared_sizze_238451 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238453 +
                                                                               (8 -
                                                                                shared_sizze_238453 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238455 +
                                                                               (8 -
                                                                                shared_sizze_238455 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238457 +
                                                                               (8 -
                                                                                shared_sizze_238457 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238459 +
                                                                               (8 -
                                                                                shared_sizze_238459 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238461 +
                                                                               (8 -
                                                                                shared_sizze_238461 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238448,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238450 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221513",
                                                    time_end_238450 -
                                                    time_start_238449);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235444,
                                                              "segred_tmp_mem_235444") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235442,
                                                              "segred_tmp_mem_235442") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235440,
                                                              "segred_tmp_mem_235440") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235438,
                                                              "segred_tmp_mem_235438") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235436,
                                                              "segred_tmp_mem_235436") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_221561 =
                                        sdiv_up64(nest_sizze_209582,
                                                  segmap_group_sizze_221560);
                                struct memblock_device mem_230912;
                                
                                mem_230912.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230912,
                                                          bytes_229486,
                                                          "mem_230912")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230916;
                                
                                mem_230916.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230916,
                                                          bytes_229486,
                                                          "mem_230916")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230920;
                                
                                mem_230920.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230920,
                                                          bytes_229486,
                                                          "mem_230920")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230924;
                                
                                mem_230924.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230924,
                                                          bytes_229486,
                                                          "mem_230924")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230928;
                                
                                mem_230928.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230928,
                                                          bytes_229486,
                                                          "mem_230928")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238480 = mem_230891.mem;
                                CUdeviceptr kernel_arg_238481 = mem_230895.mem;
                                CUdeviceptr kernel_arg_238482 = mem_230899.mem;
                                CUdeviceptr kernel_arg_238483 = mem_230903.mem;
                                CUdeviceptr kernel_arg_238484 = mem_230907.mem;
                                CUdeviceptr kernel_arg_238485 = mem_230912.mem;
                                CUdeviceptr kernel_arg_238486 = mem_230916.mem;
                                CUdeviceptr kernel_arg_238487 = mem_230920.mem;
                                CUdeviceptr kernel_arg_238488 = mem_230924.mem;
                                CUdeviceptr kernel_arg_238489 = mem_230928.mem;
                                
                                if ((((((1 && segmap_usable_groups_221561 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_221560 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_221561;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238477[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203667,
                                          &l_n_m_203733, &kernel_arg_238480,
                                          &kernel_arg_238481,
                                          &kernel_arg_238482,
                                          &kernel_arg_238483,
                                          &kernel_arg_238484,
                                          &kernel_arg_238485,
                                          &kernel_arg_238486,
                                          &kernel_arg_238487,
                                          &kernel_arg_238488,
                                          &kernel_arg_238489};
                                    int64_t time_start_238478 = 0,
                                            time_end_238479 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_221569",
                                                (long) segmap_usable_groups_221561,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_221560,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238478 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_221569_runs,
                                                                  &ctx->mainzisegmap_221569_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_221569,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_221560,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238477,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238479 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_221569",
                                                time_end_238479 -
                                                time_start_238478);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230891,
                                                          "mem_230891") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230895,
                                                          "mem_230895") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230899,
                                                          "mem_230899") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230903,
                                                          "mem_230903") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230907,
                                                          "mem_230907") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230933;
                                
                                mem_230933.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230933,
                                                          bytes_229486,
                                                          "mem_230933")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230937;
                                
                                mem_230937.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230937,
                                                          bytes_229486,
                                                          "mem_230937")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203577 * (int64_t) 2,
                                          segred_group_sizze_221603)) {
                                    int64_t segment_sizze_nonzzero_235516 =
                                            smax64((int64_t) 1, q_l_203577);
                                    int64_t num_threads_235517 =
                                            num_groups_221604 *
                                            segred_group_sizze_221603;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221603,
                                                                    segment_sizze_nonzzero_235516),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   l_n_m_203733,
                                                                                   squot64(segred_group_sizze_221603,
                                                                                           segment_sizze_nonzzero_235516))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238493 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221603;
                                    unsigned int shared_sizze_238495 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221603;
                                    CUdeviceptr kernel_arg_238497 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238498 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238499 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238500 =
                                                mem_230659.mem;
                                    CUdeviceptr kernel_arg_238501 =
                                                mem_230912.mem;
                                    CUdeviceptr kernel_arg_238502 =
                                                mem_230916.mem;
                                    CUdeviceptr kernel_arg_238503 =
                                                mem_230920.mem;
                                    CUdeviceptr kernel_arg_238504 =
                                                mem_230924.mem;
                                    CUdeviceptr kernel_arg_238505 =
                                                mem_230928.mem;
                                    CUdeviceptr kernel_arg_238506 =
                                                mem_230933.mem;
                                    CUdeviceptr kernel_arg_238507 =
                                                mem_230937.mem;
                                    unsigned int shared_offset_238494 = 0;
                                    unsigned int shared_offset_238496 = 0 +
                                                 (shared_sizze_238493 + (8 -
                                                                         shared_sizze_238493 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_221604 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221603 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_221604;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238490[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238494,
                                              &shared_offset_238496, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_221604,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &segment_sizze_nonzzero_235516,
                                              &kernel_arg_238497,
                                              &kernel_arg_238498,
                                              &kernel_arg_238499,
                                              &kernel_arg_238500,
                                              &kernel_arg_238501,
                                              &kernel_arg_238502,
                                              &kernel_arg_238503,
                                              &kernel_arg_238504,
                                              &kernel_arg_238505,
                                              &kernel_arg_238506,
                                              &kernel_arg_238507};
                                        int64_t time_start_238491 = 0,
                                                time_end_238492 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_221611",
                                                    (long) num_groups_221604,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221603,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238493 +
                                                            (8 -
                                                             shared_sizze_238493 %
                                                             8) % 8) +
                                                           (shared_sizze_238495 +
                                                            (8 -
                                                             shared_sizze_238495 %
                                                             8) % 8)));
                                            time_start_238491 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_221611_runs,
                                                                &ctx->mainzisegred_small_221611_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_221611,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221603,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238493 +
                                                                               (8 -
                                                                                shared_sizze_238493 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238495 +
                                                                               (8 -
                                                                                shared_sizze_238495 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238490,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238492 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221611",
                                                    time_end_238492 -
                                                    time_start_238491);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235551 =
                                            sdiv_up64(num_groups_221604,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             l_n_m_203733));
                                    int64_t elements_per_thread_235552 =
                                            sdiv_up64(q_l_203577,
                                                      segred_group_sizze_221603 *
                                                      groups_per_segment_235551);
                                    int64_t virt_num_groups_235553 =
                                            groups_per_segment_235551 *
                                            (partition_sizze_203667 *
                                             l_n_m_203733);
                                    int64_t num_threads_235554 =
                                            num_groups_221604 *
                                            segred_group_sizze_221603;
                                    int64_t threads_per_segment_235555 =
                                            groups_per_segment_235551 *
                                            segred_group_sizze_221603;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             l_n_m_203733),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203577, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235553,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221604,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221603,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235552,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235551,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235556;
                                    
                                    segred_tmp_mem_235556.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235556,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235553,
                                                              "segred_tmp_mem_235556")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235558;
                                    
                                    segred_tmp_mem_235558.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235558,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235553,
                                                              "segred_tmp_mem_235558")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235560 =
                                    ctx->mainzicounter_mem_235560;
                                    unsigned int shared_sizze_238512 = 1;
                                    unsigned int shared_sizze_238514 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221603;
                                    unsigned int shared_sizze_238516 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_221603;
                                    CUdeviceptr kernel_arg_238518 =
                                                ext_mem_229519.mem;
                                    CUdeviceptr kernel_arg_238519 =
                                                ext_mem_229520.mem;
                                    CUdeviceptr kernel_arg_238520 =
                                                mem_param_229601.mem;
                                    CUdeviceptr kernel_arg_238521 =
                                                mem_230659.mem;
                                    CUdeviceptr kernel_arg_238522 =
                                                mem_230912.mem;
                                    CUdeviceptr kernel_arg_238523 =
                                                mem_230916.mem;
                                    CUdeviceptr kernel_arg_238524 =
                                                mem_230920.mem;
                                    CUdeviceptr kernel_arg_238525 =
                                                mem_230924.mem;
                                    CUdeviceptr kernel_arg_238526 =
                                                mem_230928.mem;
                                    CUdeviceptr kernel_arg_238527 =
                                                mem_230933.mem;
                                    CUdeviceptr kernel_arg_238528 =
                                                mem_230937.mem;
                                    CUdeviceptr kernel_arg_238529 =
                                                segred_tmp_mem_235556.mem;
                                    CUdeviceptr kernel_arg_238530 =
                                                segred_tmp_mem_235558.mem;
                                    CUdeviceptr kernel_arg_238531 =
                                                mainzicounter_mem_235560.mem;
                                    unsigned int shared_offset_238513 = 0;
                                    unsigned int shared_offset_238515 = 0 +
                                                 (shared_sizze_238512 + (8 -
                                                                         shared_sizze_238512 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238517 = 0 +
                                                 (shared_sizze_238512 + (8 -
                                                                         shared_sizze_238512 %
                                                                         8) %
                                                  8) + (shared_sizze_238514 +
                                                        (8 -
                                                         shared_sizze_238514 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_221604 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_221603 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_221604;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238509[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238513,
                                              &shared_offset_238515,
                                              &shared_offset_238517, &n_203572,
                                              &q_l_203577, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &l_n_m_203733, &i_203760,
                                              &num_groups_221604,
                                              &ctx_param_ext_229596,
                                              &ctx_param_ext_229597,
                                              &ctx_param_ext_229599,
                                              &groups_per_segment_235551,
                                              &elements_per_thread_235552,
                                              &virt_num_groups_235553,
                                              &threads_per_segment_235555,
                                              &kernel_arg_238518,
                                              &kernel_arg_238519,
                                              &kernel_arg_238520,
                                              &kernel_arg_238521,
                                              &kernel_arg_238522,
                                              &kernel_arg_238523,
                                              &kernel_arg_238524,
                                              &kernel_arg_238525,
                                              &kernel_arg_238526,
                                              &kernel_arg_238527,
                                              &kernel_arg_238528,
                                              &kernel_arg_238529,
                                              &kernel_arg_238530,
                                              &kernel_arg_238531};
                                        int64_t time_start_238510 = 0,
                                                time_end_238511 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_221611",
                                                    (long) num_groups_221604,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_221603,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238512 +
                                                            (8 -
                                                             shared_sizze_238512 %
                                                             8) % 8) +
                                                           (shared_sizze_238514 +
                                                            (8 -
                                                             shared_sizze_238514 %
                                                             8) % 8) +
                                                           (shared_sizze_238516 +
                                                            (8 -
                                                             shared_sizze_238516 %
                                                             8) % 8)));
                                            time_start_238510 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_221611_runs,
                                                                &ctx->mainzisegred_large_221611_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_221611,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_221603,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238512 +
                                                                               (8 -
                                                                                shared_sizze_238512 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238514 +
                                                                               (8 -
                                                                                shared_sizze_238514 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238516 +
                                                                               (8 -
                                                                                shared_sizze_238516 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238509,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238511 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221611",
                                                    time_end_238511 -
                                                    time_start_238510);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235558,
                                                              "segred_tmp_mem_235558") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235556,
                                                              "segred_tmp_mem_235556") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230912,
                                                          "mem_230912") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230916,
                                                          "mem_230916") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230924,
                                                          "mem_230924") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230928,
                                                          "mem_230928") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230939,
                                                        &mem_230933,
                                                        "mem_230933") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230938,
                                                        &mem_230937,
                                                        "mem_230937") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230937,
                                                          "mem_230937") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230933,
                                                          "mem_230933") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230928,
                                                          "mem_230928") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230924,
                                                          "mem_230924") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230916,
                                                          "mem_230916") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230912,
                                                          "mem_230912") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230907,
                                                          "mem_230907") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230903,
                                                          "mem_230903") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230899,
                                                          "mem_230899") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230895,
                                                          "mem_230895") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230891,
                                                          "mem_230891") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230951,
                                                    &ext_mem_230939,
                                                    "ext_mem_230939") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230950,
                                                    &ext_mem_230938,
                                                    "ext_mem_230938") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230938,
                                                      "ext_mem_230938") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230939,
                                                      "ext_mem_230939") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230953,
                                                &ext_mem_230951,
                                                "ext_mem_230951") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230952,
                                                &ext_mem_230950,
                                                "ext_mem_230950") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230950,
                                                  "ext_mem_230950") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230951,
                                                  "ext_mem_230951") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230955,
                                            &ext_mem_230953,
                                            "ext_mem_230953") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230954,
                                            &ext_mem_230952,
                                            "ext_mem_230952") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230952,
                                              "ext_mem_230952") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230953,
                                              "ext_mem_230953") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231016, &ext_mem_230955,
                                        "ext_mem_230955") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231015, &ext_mem_230954,
                                        "ext_mem_230954") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230954,
                                          "ext_mem_230954") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230955,
                                          "ext_mem_230955") != 0)
                    return 1;
            } else {
                bool match_lit_205574 = (int64_t) 0 == d_l_203580;
                int64_t binop_y_230962 = (int64_t) 8 * q_l_203577;
                int64_t bytes_230963 = smax64((int64_t) 0, binop_y_230962);
                struct memblock_device ext_mem_231014;
                
                ext_mem_231014.references = NULL;
                
                struct memblock_device ext_mem_231013;
                
                ext_mem_231013.references = NULL;
                if (match_lit_205574) {
                    struct memblock_device mem_230959;
                    
                    mem_230959.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230959, bytes_229486,
                                              "mem_230959")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230959,
                                                      partition_sizze_203667 *
                                                      l_n_m_203733, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230959,
                                                  "mem_230959") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231013,
                                                  "ext_mem_231013") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231014,
                                                  "ext_mem_231014") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230969;
                    
                    mem_230969.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230969, bytes_229486,
                                              "mem_230969")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_238535 = (int64_t) 8 * q_l_203577;
                    unsigned int shared_sizze_238537 = (int64_t) 8 * q_l_203577;
                    unsigned int shared_sizze_238539 = bytes_230963;
                    CUdeviceptr kernel_arg_238541 = ext_mem_229519.mem;
                    CUdeviceptr kernel_arg_238542 = ext_mem_229520.mem;
                    CUdeviceptr kernel_arg_238543 = mem_param_229601.mem;
                    CUdeviceptr kernel_arg_238544 = mem_230659.mem;
                    CUdeviceptr kernel_arg_238545 = mem_230969.mem;
                    unsigned int shared_offset_238536 = 0;
                    unsigned int shared_offset_238538 = 0 +
                                 (shared_sizze_238535 + (8 -
                                                         shared_sizze_238535 %
                                                         8) % 8);
                    unsigned int shared_offset_238540 = 0 +
                                 (shared_sizze_238535 + (8 -
                                                         shared_sizze_238535 %
                                                         8) % 8) +
                                 (shared_sizze_238537 + (8 -
                                                         shared_sizze_238537 %
                                                         8) % 8);
                    
                    if ((((((1 && nest_sizze_209582 != 0) && 1 != 0) && 1 !=
                           0) && q_l_203577 != 0) && 1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = nest_sizze_209582;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_238532[] = {&ctx->global_failure,
                                                      &shared_offset_238536,
                                                      &shared_offset_238538,
                                                      &shared_offset_238540,
                                                      &n_203572, &q_l_203577,
                                                      &jump_t_203582,
                                                      &partition_sizze_203667,
                                                      &l_n_m_203733, &i_203760,
                                                      &ctx_param_ext_229596,
                                                      &ctx_param_ext_229597,
                                                      &ctx_param_ext_229599,
                                                      &kernel_arg_238541,
                                                      &kernel_arg_238542,
                                                      &kernel_arg_238543,
                                                      &kernel_arg_238544,
                                                      &kernel_arg_238545};
                        int64_t time_start_238533 = 0, time_end_238534 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segmap_intragroup_221759",
                                    (long) nest_sizze_209582, (long) 1,
                                    (long) 1, (long) q_l_203577, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_238535 +
                                                          (8 -
                                                           shared_sizze_238535 %
                                                           8) % 8) +
                                                     (shared_sizze_238537 + (8 -
                                                                             shared_sizze_238537 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_238539 + (8 -
                                                                             shared_sizze_238539 %
                                                                             8) %
                                                      8)));
                            time_start_238533 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_221759_runs,
                                                      &ctx->mainzisegmap_intragroup_221759_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_221759,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              q_l_203577, 1, 1,
                                                              0 +
                                                              (shared_sizze_238535 +
                                                               (8 -
                                                                shared_sizze_238535 %
                                                                8) % 8) +
                                                              (shared_sizze_238537 +
                                                               (8 -
                                                                shared_sizze_238537 %
                                                                8) % 8) +
                                                              (shared_sizze_238539 +
                                                               (8 -
                                                                shared_sizze_238539 %
                                                                8) % 8), NULL,
                                                              kernel_args_238532,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_238534 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_221759",
                                    time_end_238534 - time_start_238533);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_231014, &mem_230969,
                                            "mem_230969") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231013, &mem_230959,
                                            "mem_230959") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230969, "mem_230969") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230959, "mem_230959") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205629 = (int64_t) 1 == d_l_203580;
                    struct memblock_device ext_mem_231012;
                    
                    ext_mem_231012.references = NULL;
                    
                    struct memblock_device ext_mem_231011;
                    
                    ext_mem_231011.references = NULL;
                    if (match_lit_205629) {
                        struct memblock_device mem_230982;
                        
                        mem_230982.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230982,
                                                  bytes_229486, "mem_230982")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230986;
                        
                        mem_230986.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230986,
                                                  bytes_229486, "mem_230986")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238549 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238551 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238553 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238555 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238557 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238559 = bytes_230963;
                        unsigned int shared_sizze_238561 = bytes_230963;
                        CUdeviceptr kernel_arg_238563 = ext_mem_229519.mem;
                        CUdeviceptr kernel_arg_238564 = ext_mem_229520.mem;
                        CUdeviceptr kernel_arg_238565 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_238566 = mem_230659.mem;
                        CUdeviceptr kernel_arg_238567 = mem_230982.mem;
                        CUdeviceptr kernel_arg_238568 = mem_230986.mem;
                        unsigned int shared_offset_238550 = 0;
                        unsigned int shared_offset_238552 = 0 +
                                     (shared_sizze_238549 + (8 -
                                                             shared_sizze_238549 %
                                                             8) % 8);
                        unsigned int shared_offset_238554 = 0 +
                                     (shared_sizze_238549 + (8 -
                                                             shared_sizze_238549 %
                                                             8) % 8) +
                                     (shared_sizze_238551 + (8 -
                                                             shared_sizze_238551 %
                                                             8) % 8);
                        unsigned int shared_offset_238556 = 0 +
                                     (shared_sizze_238549 + (8 -
                                                             shared_sizze_238549 %
                                                             8) % 8) +
                                     (shared_sizze_238551 + (8 -
                                                             shared_sizze_238551 %
                                                             8) % 8) +
                                     (shared_sizze_238553 + (8 -
                                                             shared_sizze_238553 %
                                                             8) % 8);
                        unsigned int shared_offset_238558 = 0 +
                                     (shared_sizze_238549 + (8 -
                                                             shared_sizze_238549 %
                                                             8) % 8) +
                                     (shared_sizze_238551 + (8 -
                                                             shared_sizze_238551 %
                                                             8) % 8) +
                                     (shared_sizze_238553 + (8 -
                                                             shared_sizze_238553 %
                                                             8) % 8) +
                                     (shared_sizze_238555 + (8 -
                                                             shared_sizze_238555 %
                                                             8) % 8);
                        unsigned int shared_offset_238560 = 0 +
                                     (shared_sizze_238549 + (8 -
                                                             shared_sizze_238549 %
                                                             8) % 8) +
                                     (shared_sizze_238551 + (8 -
                                                             shared_sizze_238551 %
                                                             8) % 8) +
                                     (shared_sizze_238553 + (8 -
                                                             shared_sizze_238553 %
                                                             8) % 8) +
                                     (shared_sizze_238555 + (8 -
                                                             shared_sizze_238555 %
                                                             8) % 8) +
                                     (shared_sizze_238557 + (8 -
                                                             shared_sizze_238557 %
                                                             8) % 8);
                        unsigned int shared_offset_238562 = 0 +
                                     (shared_sizze_238549 + (8 -
                                                             shared_sizze_238549 %
                                                             8) % 8) +
                                     (shared_sizze_238551 + (8 -
                                                             shared_sizze_238551 %
                                                             8) % 8) +
                                     (shared_sizze_238553 + (8 -
                                                             shared_sizze_238553 %
                                                             8) % 8) +
                                     (shared_sizze_238555 + (8 -
                                                             shared_sizze_238555 %
                                                             8) % 8) +
                                     (shared_sizze_238557 + (8 -
                                                             shared_sizze_238557 %
                                                             8) % 8) +
                                     (shared_sizze_238559 + (8 -
                                                             shared_sizze_238559 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_209582 != 0) && 1 != 0) && 1 !=
                               0) && q_l_203577 != 0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = nest_sizze_209582;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238546[] = {&ctx->global_failure,
                                                          &shared_offset_238550,
                                                          &shared_offset_238552,
                                                          &shared_offset_238554,
                                                          &shared_offset_238556,
                                                          &shared_offset_238558,
                                                          &shared_offset_238560,
                                                          &shared_offset_238562,
                                                          &n_203572,
                                                          &q_l_203577,
                                                          &jump_t_203582,
                                                          &partition_sizze_203667,
                                                          &l_n_m_203733,
                                                          &i_203760,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_238563,
                                                          &kernel_arg_238564,
                                                          &kernel_arg_238565,
                                                          &kernel_arg_238566,
                                                          &kernel_arg_238567,
                                                          &kernel_arg_238568};
                            int64_t time_start_238547 = 0, time_end_238548 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_intragroup_221926",
                                        (long) nest_sizze_209582, (long) 1,
                                        (long) 1, (long) q_l_203577, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238549 +
                                                          (8 -
                                                           shared_sizze_238549 %
                                                           8) % 8) +
                                                         (shared_sizze_238551 +
                                                          (8 -
                                                           shared_sizze_238551 %
                                                           8) % 8) +
                                                         (shared_sizze_238553 +
                                                          (8 -
                                                           shared_sizze_238553 %
                                                           8) % 8) +
                                                         (shared_sizze_238555 +
                                                          (8 -
                                                           shared_sizze_238555 %
                                                           8) % 8) +
                                                         (shared_sizze_238557 +
                                                          (8 -
                                                           shared_sizze_238557 %
                                                           8) % 8) +
                                                         (shared_sizze_238559 +
                                                          (8 -
                                                           shared_sizze_238559 %
                                                           8) % 8) +
                                                         (shared_sizze_238561 +
                                                          (8 -
                                                           shared_sizze_238561 %
                                                           8) % 8)));
                                time_start_238547 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_221926_runs,
                                                          &ctx->mainzisegmap_intragroup_221926_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_221926,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_l_203577, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238549 +
                                                                   (8 -
                                                                    shared_sizze_238549 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238551 +
                                                                   (8 -
                                                                    shared_sizze_238551 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238553 +
                                                                   (8 -
                                                                    shared_sizze_238553 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238555 +
                                                                   (8 -
                                                                    shared_sizze_238555 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238557 +
                                                                   (8 -
                                                                    shared_sizze_238557 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238559 +
                                                                   (8 -
                                                                    shared_sizze_238559 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238561 +
                                                                   (8 -
                                                                    shared_sizze_238561 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238546,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238548 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_221926",
                                        time_end_238548 - time_start_238547);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_231012,
                                                &mem_230982, "mem_230982") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231011,
                                                &mem_230986, "mem_230986") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230986,
                                                  "mem_230986") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230982,
                                                  "mem_230982") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_231006;
                        
                        mem_231006.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231006,
                                                  bytes_229486, "mem_231006")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231010;
                        
                        mem_231010.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231010,
                                                  bytes_229486, "mem_231010")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_238572 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238574 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238576 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238578 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238580 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238582 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238584 = (int64_t) 8 *
                                     q_l_203577;
                        unsigned int shared_sizze_238586 = bytes_230963;
                        unsigned int shared_sizze_238588 = bytes_230963;
                        unsigned int shared_sizze_238590 = bytes_230963;
                        unsigned int shared_sizze_238592 = bytes_230963;
                        CUdeviceptr kernel_arg_238594 = ext_mem_229519.mem;
                        CUdeviceptr kernel_arg_238595 = ext_mem_229520.mem;
                        CUdeviceptr kernel_arg_238596 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_238597 = mem_230659.mem;
                        CUdeviceptr kernel_arg_238598 = mem_231006.mem;
                        CUdeviceptr kernel_arg_238599 = mem_231010.mem;
                        unsigned int shared_offset_238573 = 0;
                        unsigned int shared_offset_238575 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8);
                        unsigned int shared_offset_238577 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8);
                        unsigned int shared_offset_238579 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8);
                        unsigned int shared_offset_238581 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8);
                        unsigned int shared_offset_238583 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8) +
                                     (shared_sizze_238580 + (8 -
                                                             shared_sizze_238580 %
                                                             8) % 8);
                        unsigned int shared_offset_238585 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8) +
                                     (shared_sizze_238580 + (8 -
                                                             shared_sizze_238580 %
                                                             8) % 8) +
                                     (shared_sizze_238582 + (8 -
                                                             shared_sizze_238582 %
                                                             8) % 8);
                        unsigned int shared_offset_238587 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8) +
                                     (shared_sizze_238580 + (8 -
                                                             shared_sizze_238580 %
                                                             8) % 8) +
                                     (shared_sizze_238582 + (8 -
                                                             shared_sizze_238582 %
                                                             8) % 8) +
                                     (shared_sizze_238584 + (8 -
                                                             shared_sizze_238584 %
                                                             8) % 8);
                        unsigned int shared_offset_238589 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8) +
                                     (shared_sizze_238580 + (8 -
                                                             shared_sizze_238580 %
                                                             8) % 8) +
                                     (shared_sizze_238582 + (8 -
                                                             shared_sizze_238582 %
                                                             8) % 8) +
                                     (shared_sizze_238584 + (8 -
                                                             shared_sizze_238584 %
                                                             8) % 8) +
                                     (shared_sizze_238586 + (8 -
                                                             shared_sizze_238586 %
                                                             8) % 8);
                        unsigned int shared_offset_238591 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8) +
                                     (shared_sizze_238580 + (8 -
                                                             shared_sizze_238580 %
                                                             8) % 8) +
                                     (shared_sizze_238582 + (8 -
                                                             shared_sizze_238582 %
                                                             8) % 8) +
                                     (shared_sizze_238584 + (8 -
                                                             shared_sizze_238584 %
                                                             8) % 8) +
                                     (shared_sizze_238586 + (8 -
                                                             shared_sizze_238586 %
                                                             8) % 8) +
                                     (shared_sizze_238588 + (8 -
                                                             shared_sizze_238588 %
                                                             8) % 8);
                        unsigned int shared_offset_238593 = 0 +
                                     (shared_sizze_238572 + (8 -
                                                             shared_sizze_238572 %
                                                             8) % 8) +
                                     (shared_sizze_238574 + (8 -
                                                             shared_sizze_238574 %
                                                             8) % 8) +
                                     (shared_sizze_238576 + (8 -
                                                             shared_sizze_238576 %
                                                             8) % 8) +
                                     (shared_sizze_238578 + (8 -
                                                             shared_sizze_238578 %
                                                             8) % 8) +
                                     (shared_sizze_238580 + (8 -
                                                             shared_sizze_238580 %
                                                             8) % 8) +
                                     (shared_sizze_238582 + (8 -
                                                             shared_sizze_238582 %
                                                             8) % 8) +
                                     (shared_sizze_238584 + (8 -
                                                             shared_sizze_238584 %
                                                             8) % 8) +
                                     (shared_sizze_238586 + (8 -
                                                             shared_sizze_238586 %
                                                             8) % 8) +
                                     (shared_sizze_238588 + (8 -
                                                             shared_sizze_238588 %
                                                             8) % 8) +
                                     (shared_sizze_238590 + (8 -
                                                             shared_sizze_238590 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_209582 != 0) && 1 != 0) && 1 !=
                               0) && q_l_203577 != 0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = nest_sizze_209582;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238569[] = {&ctx->global_failure,
                                                          &shared_offset_238573,
                                                          &shared_offset_238575,
                                                          &shared_offset_238577,
                                                          &shared_offset_238579,
                                                          &shared_offset_238581,
                                                          &shared_offset_238583,
                                                          &shared_offset_238585,
                                                          &shared_offset_238587,
                                                          &shared_offset_238589,
                                                          &shared_offset_238591,
                                                          &shared_offset_238593,
                                                          &n_203572,
                                                          &q_l_203577,
                                                          &jump_t_203582,
                                                          &partition_sizze_203667,
                                                          &l_n_m_203733,
                                                          &i_203760,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_238594,
                                                          &kernel_arg_238595,
                                                          &kernel_arg_238596,
                                                          &kernel_arg_238597,
                                                          &kernel_arg_238598,
                                                          &kernel_arg_238599};
                            int64_t time_start_238570 = 0, time_end_238571 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_intragroup_222183",
                                        (long) nest_sizze_209582, (long) 1,
                                        (long) 1, (long) q_l_203577, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_238572 +
                                                          (8 -
                                                           shared_sizze_238572 %
                                                           8) % 8) +
                                                         (shared_sizze_238574 +
                                                          (8 -
                                                           shared_sizze_238574 %
                                                           8) % 8) +
                                                         (shared_sizze_238576 +
                                                          (8 -
                                                           shared_sizze_238576 %
                                                           8) % 8) +
                                                         (shared_sizze_238578 +
                                                          (8 -
                                                           shared_sizze_238578 %
                                                           8) % 8) +
                                                         (shared_sizze_238580 +
                                                          (8 -
                                                           shared_sizze_238580 %
                                                           8) % 8) +
                                                         (shared_sizze_238582 +
                                                          (8 -
                                                           shared_sizze_238582 %
                                                           8) % 8) +
                                                         (shared_sizze_238584 +
                                                          (8 -
                                                           shared_sizze_238584 %
                                                           8) % 8) +
                                                         (shared_sizze_238586 +
                                                          (8 -
                                                           shared_sizze_238586 %
                                                           8) % 8) +
                                                         (shared_sizze_238588 +
                                                          (8 -
                                                           shared_sizze_238588 %
                                                           8) % 8) +
                                                         (shared_sizze_238590 +
                                                          (8 -
                                                           shared_sizze_238590 %
                                                           8) % 8) +
                                                         (shared_sizze_238592 +
                                                          (8 -
                                                           shared_sizze_238592 %
                                                           8) % 8)));
                                time_start_238570 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_222183_runs,
                                                          &ctx->mainzisegmap_intragroup_222183_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_222183,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_l_203577, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_238572 +
                                                                   (8 -
                                                                    shared_sizze_238572 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238574 +
                                                                   (8 -
                                                                    shared_sizze_238574 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238576 +
                                                                   (8 -
                                                                    shared_sizze_238576 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238578 +
                                                                   (8 -
                                                                    shared_sizze_238578 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238580 +
                                                                   (8 -
                                                                    shared_sizze_238580 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238582 +
                                                                   (8 -
                                                                    shared_sizze_238582 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238584 +
                                                                   (8 -
                                                                    shared_sizze_238584 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238586 +
                                                                   (8 -
                                                                    shared_sizze_238586 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238588 +
                                                                   (8 -
                                                                    shared_sizze_238588 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238590 +
                                                                   (8 -
                                                                    shared_sizze_238590 %
                                                                    8) % 8) +
                                                                  (shared_sizze_238592 +
                                                                   (8 -
                                                                    shared_sizze_238592 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_238569,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238571 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_222183",
                                        time_end_238571 - time_start_238570);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_231012,
                                                &mem_231006, "mem_231006") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231011,
                                                &mem_231010, "mem_231010") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231010,
                                                  "mem_231010") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231006,
                                                  "mem_231006") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231014,
                                            &ext_mem_231012,
                                            "ext_mem_231012") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231013,
                                            &ext_mem_231011,
                                            "ext_mem_231011") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231011,
                                              "ext_mem_231011") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231012,
                                              "ext_mem_231012") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231016, &ext_mem_231014,
                                        "ext_mem_231014") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231015, &ext_mem_231013,
                                        "ext_mem_231013") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231013,
                                          "ext_mem_231013") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231014,
                                          "ext_mem_231014") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_231022;
            
            ext_mem_231022.references = NULL;
            if (cond_204197) {
                bool zzero_205873 = jump_l_203583 == (int64_t) 0;
                bool nonzzero_205874 = !zzero_205873;
                bool nonzzero_cert_205875;
                
                if (!nonzzero_205874) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:547:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:546:3-550:9\n   #5  stl.fut:252:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:250:15-253:43\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_205876 = sub64(l_n_m_203733, (int64_t) 1);
                int64_t segmap_group_sizze_222434;
                
                segmap_group_sizze_222434 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_222316;
                
                int64_t segmap_usable_groups_222435 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_222434);
                struct memblock_device mem_231021;
                
                mem_231021.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231021, bytes_229285,
                                          "mem_231021")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_238603 = ext_mem_231015.mem;
                CUdeviceptr kernel_arg_238604 = ext_mem_231016.mem;
                CUdeviceptr kernel_arg_238605 = mem_231021.mem;
                
                if ((((((1 && segmap_usable_groups_222435 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_222434 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_222435;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_238600[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_203572, &jump_l_203583,
                                                  &partition_sizze_203667,
                                                  &l_n_m_203733, &i_203760,
                                                  &y_205876, &kernel_arg_238603,
                                                  &kernel_arg_238604,
                                                  &kernel_arg_238605};
                    int64_t time_start_238601 = 0, time_end_238602 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_222439",
                                (long) segmap_usable_groups_222435, (long) 1,
                                (long) 1, (long) segmap_group_sizze_222434,
                                (long) 1, (long) 1, (int) 0);
                        time_start_238601 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_222439_runs,
                                                  &ctx->mainzisegmap_222439_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_222439,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_222434,
                                                          1, 1, 0, NULL,
                                                          kernel_args_238600,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_238602 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_222439", time_end_238602 -
                                time_start_238601);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231022, &mem_231021,
                                        "mem_231021") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231021, "mem_231021") != 0)
                    return 1;
            } else {
                bool dim_match_205928 = n_203572 == l_n_m_203733;
                bool empty_or_match_cert_205929;
                
                if (!dim_match_205928) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) partition_sizze_203667, ", ",
                                  (long long) l_n_m_203733,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203667, "][",
                                  (long long) n_203572, "]t`.",
                                  "-> #0  stl.fut:255:15-36\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_231022, &ext_mem_231016,
                                        "ext_mem_231016") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231015, "ext_mem_231015") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231016, "ext_mem_231016") !=
                0)
                return 1;
            
            struct memblock_device mem_231028;
            
            mem_231028.references = NULL;
            if (memblock_alloc_device(ctx, &mem_231028, bytes_229285,
                                      "mem_231028")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_238609 = mem_230608.mem;
            CUdeviceptr kernel_arg_238610 = ext_mem_231022.mem;
            CUdeviceptr kernel_arg_238611 = mem_231028.mem;
            
            if ((((((1 && segmap_usable_groups_222530 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_222529 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_222530;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_238606[] = {&ctx->global_failure, &n_203572,
                                              &n_p_203574,
                                              &partition_sizze_203667,
                                              &C_len_203724, &ext_231023,
                                              &kernel_arg_238609,
                                              &kernel_arg_238610,
                                              &kernel_arg_238611};
                int64_t time_start_238607 = 0, time_end_238608 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_222534",
                            (long) segmap_usable_groups_222530, (long) 1,
                            (long) 1, (long) segmap_group_sizze_222529,
                            (long) 1, (long) 1, (int) 0);
                    time_start_238607 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_222534_runs,
                                              &ctx->mainzisegmap_222534_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_222534,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_222529,
                                                      1, 1, 0, NULL,
                                                      kernel_args_238606,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_238608 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_222534", time_end_238608 -
                            time_start_238607);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_231022, "ext_mem_231022") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_231613;
            
            ext_mem_231613.references = NULL;
            
            struct memblock_device ext_mem_231612;
            
            ext_mem_231612.references = NULL;
            if (cond_204255) {
                bool match_lit_205941 = (int64_t) 0 == d_t_203579;
                struct memblock_device ext_mem_231510;
                
                ext_mem_231510.references = NULL;
                
                struct memblock_device ext_mem_231509;
                
                ext_mem_231509.references = NULL;
                if (match_lit_205941) {
                    struct memblock_device mem_231032;
                    
                    mem_231032.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231032, bytes_229535,
                                              "mem_231032")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_231032,
                                                      partition_sizze_203667 *
                                                      t_n_m_203740, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_231032,
                                                  "mem_231032") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231509,
                                                  "ext_mem_231509") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231510,
                                                  "ext_mem_231510") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231612,
                                                  "ext_mem_231612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231613,
                                                  "ext_mem_231613") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231028,
                                                  "mem_231028") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231022,
                                                  "ext_mem_231022") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_222540;
                    
                    suff_outer_par_222540 =
                        *ctx->tuning_params.mainzisuff_outer_par_28 <=
                        partition_sizze_203667;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_28",
                                (long) partition_sizze_203667,
                                suff_outer_par_222540 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_222636;
                    
                    segmap_group_sizze_222636 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222544;
                    
                    int64_t num_groups_222637;
                    int32_t max_num_groups_235700;
                    
                    max_num_groups_235700 =
                        *ctx->tuning_params.mainzisegmap_num_groups_222546;
                    num_groups_222637 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203667,
                                                                             segmap_group_sizze_222636),
                                                                   sext_i32_i64(max_num_groups_235700))));
                    
                    int64_t segmap_group_sizze_223152;
                    
                    segmap_group_sizze_223152 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_223126;
                    
                    int64_t segmap_group_sizze_223168;
                    
                    segmap_group_sizze_223168 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_223070;
                    
                    int64_t segmap_group_sizze_223193;
                    
                    segmap_group_sizze_223193 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222733;
                    
                    bool suff_outer_par_223197;
                    
                    suff_outer_par_223197 =
                        *ctx->tuning_params.mainzisuff_outer_par_29 <=
                        nest_sizze_210208;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_29",
                                (long) nest_sizze_210208,
                                suff_outer_par_223197 ? "true" : "false");
                    
                    int64_t nest_sizze_223279 = q_t_203576 * nest_sizze_210208;
                    int64_t segred_group_sizze_223280;
                    
                    segred_group_sizze_223280 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222884;
                    
                    int64_t num_groups_223281;
                    int32_t max_num_groups_235701;
                    
                    max_num_groups_235701 =
                        *ctx->tuning_params.mainzisegred_num_groups_222886;
                    num_groups_223281 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223279,
                                                                             segred_group_sizze_223280),
                                                                   sext_i32_i64(max_num_groups_235701))));
                    
                    int64_t segmap_group_sizze_223321;
                    
                    segmap_group_sizze_223321 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222871;
                    
                    int64_t segred_group_sizze_223332;
                    
                    segred_group_sizze_223332 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222814;
                    
                    int64_t num_groups_223333;
                    int32_t max_num_groups_235702;
                    
                    max_num_groups_235702 =
                        *ctx->tuning_params.mainzisegred_num_groups_222816;
                    num_groups_223333 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223279,
                                                                             segred_group_sizze_223332),
                                                                   sext_i32_i64(max_num_groups_235702))));
                    
                    int64_t maxSubHelper_232150 = umax64(bytes_229277,
                                                         bytes_229528);
                    int64_t num_threads_232294 = segmap_group_sizze_222636 *
                            num_groups_222637;
                    int64_t total_sizze_232295 = maxSubHelper_232150 *
                            num_threads_232294;
                    int64_t total_sizze_232296 = bytes_229277 *
                            num_threads_232294;
                    int64_t total_sizze_232297 = bytes_229277 *
                            num_threads_232294;
                    struct memblock_device ext_mem_231152;
                    
                    ext_mem_231152.references = NULL;
                    
                    int32_t local_memory_capacity_235921;
                    
                    local_memory_capacity_235921 = ctx->cuda.max_shared_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235921)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235921))) &&
                        suff_outer_par_222540) {
                        struct memblock_device mem_231035;
                        
                        mem_231035.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231035,
                                                  binop_y_229284,
                                                  "mem_231035")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231035,
                                                                  (int64_t) 0,
                                                                  mem_231028,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203572,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231038;
                        
                        mem_231038.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231038,
                                                  binop_y_229284,
                                                  "mem_231038")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_231038,
                                                                  (int64_t) 0,
                                                                  ext_mem_229305,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203572,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231041;
                        
                        mem_231041.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231041,
                                                  binop_y_229534,
                                                  "mem_231041")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_231041,
                                                                  (int64_t) 0,
                                                                  ext_mem_229569,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203740,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231041,
                                                      "mem_231041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231044;
                        
                        mem_231044.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231044,
                                                  binop_y_229534,
                                                  "mem_231044")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231044,
                                                                  (int64_t) 0,
                                                                  ext_mem_229568,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203740,
                                                                  partition_sizze_203667) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231044,
                                                      "mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231041,
                                                      "mem_231041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231047;
                        
                        mem_231047.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231047,
                                                  binop_y_229284,
                                                  "mem_231047")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_235706;
                        
                        group_sizze_235706 =
                            *ctx->tuning_params.mainzigroup_sizze_235706;
                        
                        int64_t num_groups_235707 =
                                sdiv_up64(partition_sizze_203667 * n_203572,
                                          group_sizze_235706);
                        CUdeviceptr kernel_arg_238615 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_238616 = mem_231047.mem;
                        
                        if ((((((1 && num_groups_235707 != 0) && 1 != 0) && 1 !=
                               0) && group_sizze_235706 != 0) && 1 != 0) && 1 !=
                            0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = num_groups_235707;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238612[] = {&n_203572,
                                                          &partition_sizze_203667,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_238615,
                                                          &kernel_arg_238616};
                            int64_t time_start_238613 = 0, time_end_238614 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.copy_235703",
                                        (long) num_groups_235707, (long) 1,
                                        (long) 1, (long) group_sizze_235706,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238613 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzicopy_235703_runs,
                                                          &ctx->mainzicopy_235703_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235703,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  group_sizze_235706,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238612,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238614 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.copy_235703", time_end_238614 -
                                        time_start_238613);
                            }
                        }
                        
                        struct memblock_device mem_231111;
                        
                        mem_231111.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231111,
                                                  binop_y_229534,
                                                  "mem_231111")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232151;
                        
                        color_232151.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232151,
                                                  total_sizze_232295,
                                                  "color_232151")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232152;
                        
                        color_232152.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232152,
                                                  total_sizze_232296,
                                                  "color_232152")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232153;
                        
                        color_232153.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232153,
                                                  total_sizze_232297,
                                                  "color_232153")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238620 = mem_229269.mem;
                        CUdeviceptr kernel_arg_238621 = ext_mem_229304.mem;
                        CUdeviceptr kernel_arg_238622 = mem_231035.mem;
                        CUdeviceptr kernel_arg_238623 = mem_231038.mem;
                        CUdeviceptr kernel_arg_238624 = mem_231041.mem;
                        CUdeviceptr kernel_arg_238625 = mem_231044.mem;
                        CUdeviceptr kernel_arg_238626 = mem_231047.mem;
                        CUdeviceptr kernel_arg_238627 = mem_231111.mem;
                        CUdeviceptr kernel_arg_238628 = color_232151.mem;
                        CUdeviceptr kernel_arg_238629 = color_232152.mem;
                        CUdeviceptr kernel_arg_238630 = color_232153.mem;
                        
                        if ((((((1 && num_groups_222637 != 0) && 1 != 0) && 1 !=
                               0) && segmap_group_sizze_222636 != 0) && 1 !=
                             0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = num_groups_222637;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238617[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203572,
                                                          &q_t_203576,
                                                          &jump_t_203582,
                                                          &partition_sizze_203667,
                                                          &t_n_m_203740,
                                                          &i_203760,
                                                          &num_groups_222637,
                                                          &num_threads_232294,
                                                          &kernel_arg_238620,
                                                          &kernel_arg_238621,
                                                          &kernel_arg_238622,
                                                          &kernel_arg_238623,
                                                          &kernel_arg_238624,
                                                          &kernel_arg_238625,
                                                          &kernel_arg_238626,
                                                          &kernel_arg_238627,
                                                          &kernel_arg_238628,
                                                          &kernel_arg_238629,
                                                          &kernel_arg_238630};
                            int64_t time_start_238618 = 0, time_end_238619 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_222641",
                                        (long) num_groups_222637, (long) 1,
                                        (long) 1,
                                        (long) segmap_group_sizze_222636,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238618 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_222641_runs,
                                                          &ctx->mainzisegmap_222641_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_222641,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_222636,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238617,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238619 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_222641", time_end_238619 -
                                        time_start_238618);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231035,
                                                  "mem_231035") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231038,
                                                  "mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231041,
                                                  "mem_231041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231044,
                                                  "mem_231044") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231047,
                                                  "mem_231047") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232151,
                                                  "color_232151") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232152,
                                                  "color_232152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232153,
                                                  "color_232153") != 0)
                            return 1;
                        
                        struct memblock_device mem_231150;
                        
                        mem_231150.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231150,
                                                  bytes_229535, "mem_231150")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231150,
                                                                  (int64_t) 0,
                                                                  mem_231111,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203667,
                                                                  t_n_m_203740) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231150,
                                                      "mem_231150") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232153,
                                                      "color_232153") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232152,
                                                      "color_232152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232151,
                                                      "color_232151") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231111,
                                                      "mem_231111") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231047,
                                                      "mem_231047") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231044,
                                                      "mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231041,
                                                      "mem_231041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231038,
                                                      "mem_231038") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231035,
                                                      "mem_231035") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231152,
                                                      "ext_mem_231152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231509,
                                                      "ext_mem_231509") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231510,
                                                      "ext_mem_231510") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231612,
                                                      "ext_mem_231612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231613,
                                                      "ext_mem_231613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231028,
                                                      "mem_231028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231022,
                                                      "ext_mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231015,
                                                      "ext_mem_231015") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231016,
                                                      "ext_mem_231016") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230654,
                                                      "ext_mem_230654") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230637,
                                                      "ext_mem_230637") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230620,
                                                      "ext_mem_230620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230602,
                                                      "ext_mem_230602") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230594,
                                                      "ext_mem_230594") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230595,
                                                      "ext_mem_230595") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229623,
                                                      "mem_param_229623") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229615,
                                                      "mem_param_229615") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231625,
                                                      "ext_mem_231625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231626,
                                                      "ext_mem_231626") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229601,
                                                      "mem_param_229601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229593,
                                                      "mem_param_229593") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229585,
                                                      "mem_param_229585") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231968,
                                                      "ext_mem_231968") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231969,
                                                      "ext_mem_231969") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231970,
                                                      "ext_mem_231970") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230642,
                                                      "mem_230642") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230608,
                                                      "mem_230608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229639,
                                                      "mem_229639") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229634,
                                                      "mem_229634") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229577,
                                                      "mem_229577") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229573,
                                                      "mem_229573") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229568,
                                                      "ext_mem_229568") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229569,
                                                      "ext_mem_229569") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229519,
                                                      "ext_mem_229519") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229520,
                                                      "ext_mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229470,
                                                      "ext_mem_229470") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229471,
                                                      "ext_mem_229471") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229372,
                                                      "ext_mem_229372") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229373,
                                                      "ext_mem_229373") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229314,
                                                      "mem_229314") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229308,
                                                      "mem_229308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229304,
                                                      "ext_mem_229304") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229305,
                                                      "ext_mem_229305") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229272,
                                                      "mem_229272") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229269,
                                                      "mem_229269") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232074,
                                                      "color_232074") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229265,
                                                      "mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229263,
                                                      "mem_229263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229260,
                                                      "mem_229260") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229242,
                                                      "mem_229242") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232361,
                                                      "mem_out_232361") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232360,
                                                      "mem_out_232360") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232359,
                                                      "mem_out_232359") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_231111,
                                                  "mem_231111") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231152,
                                                &mem_231150, "mem_231150") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231150,
                                                  "mem_231150") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232153,
                                                  "color_232153") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232152,
                                                  "color_232152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232151,
                                                  "color_232151") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231111,
                                                  "mem_231111") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231047,
                                                  "mem_231047") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231044,
                                                  "mem_231044") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231041,
                                                  "mem_231041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231038,
                                                  "mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231035,
                                                  "mem_231035") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_223153 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_223152);
                        struct memblock_device mem_231116;
                        
                        mem_231116.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231116,
                                                  bytes_229285, "mem_231116")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238634 = mem_229269.mem;
                        CUdeviceptr kernel_arg_238635 = mem_231028.mem;
                        CUdeviceptr kernel_arg_238636 = mem_231116.mem;
                        
                        if ((((((1 && segmap_usable_groups_223153 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_223152 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = segmap_usable_groups_223153;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238631[] = {&ctx->global_failure,
                                                          &n_203572,
                                                          &partition_sizze_203667,
                                                          &kernel_arg_238634,
                                                          &kernel_arg_238635,
                                                          &kernel_arg_238636};
                            int64_t time_start_238632 = 0, time_end_238633 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_223157",
                                        (long) segmap_usable_groups_223153,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_223152,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238632 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_223157_runs,
                                                          &ctx->mainzisegmap_223157_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223157,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_223152,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238631,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238633 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_223157", time_end_238633 -
                                        time_start_238632);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_usable_groups_223169 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_223168);
                        struct memblock_device mem_231121;
                        
                        mem_231121.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231121,
                                                  bytes_229285, "mem_231121")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231125;
                        
                        mem_231125.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231125,
                                                  bytes_229285, "mem_231125")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_238640 = ext_mem_229305.mem;
                        CUdeviceptr kernel_arg_238641 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_238642 = mem_231116.mem;
                        CUdeviceptr kernel_arg_238643 = mem_231121.mem;
                        CUdeviceptr kernel_arg_238644 = mem_231125.mem;
                        
                        if ((((((1 && segmap_usable_groups_223169 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_223168 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = segmap_usable_groups_223169;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_238637[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203572,
                                                          &partition_sizze_203667,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_238640,
                                                          &kernel_arg_238641,
                                                          &kernel_arg_238642,
                                                          &kernel_arg_238643,
                                                          &kernel_arg_238644};
                            int64_t time_start_238638 = 0, time_end_238639 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_223174",
                                        (long) segmap_usable_groups_223169,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_223168,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_238638 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_223174_runs,
                                                          &ctx->mainzisegmap_223174_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223174,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_223168,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_238637,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_238639 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_223174", time_end_238639 -
                                        time_start_238638);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231116,
                                                  "mem_231116") != 0)
                            return 1;
                        
                        int64_t segmap_usable_groups_223194 =
                                sdiv_up64(nest_sizze_210208,
                                          segmap_group_sizze_223193);
                        struct memblock_device ext_mem_231146;
                        
                        ext_mem_231146.references = NULL;
                        
                        int32_t local_memory_capacity_235920;
                        
                        local_memory_capacity_235920 =
                            ctx->cuda.max_shared_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_235920)) &&
                            suff_outer_par_223197) {
                            struct memblock_device mem_231130;
                            
                            mem_231130.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231130,
                                                      bytes_229535,
                                                      "mem_231130")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238648 = ext_mem_229304.mem;
                            CUdeviceptr kernel_arg_238649 = ext_mem_229305.mem;
                            CUdeviceptr kernel_arg_238650 = ext_mem_229568.mem;
                            CUdeviceptr kernel_arg_238651 = ext_mem_229569.mem;
                            CUdeviceptr kernel_arg_238652 = mem_231121.mem;
                            CUdeviceptr kernel_arg_238653 = mem_231125.mem;
                            CUdeviceptr kernel_arg_238654 = mem_231130.mem;
                            
                            if ((((((1 && segmap_usable_groups_223194 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_223193 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_223194;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238645[] =
                                     {&ctx->global_failure, &n_203572,
                                      &q_t_203576, &jump_t_203582,
                                      &partition_sizze_203667, &t_n_m_203740,
                                      &i_203760, &kernel_arg_238648,
                                      &kernel_arg_238649, &kernel_arg_238650,
                                      &kernel_arg_238651, &kernel_arg_238652,
                                      &kernel_arg_238653, &kernel_arg_238654};
                                int64_t time_start_238646 = 0, time_end_238647 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_223202",
                                            (long) segmap_usable_groups_223194,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_223193,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238646 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_223202_runs,
                                                              &ctx->mainzisegmap_223202_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223202,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_223193,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238645,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238647 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_223202",
                                            time_end_238647 -
                                            time_start_238646);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231146,
                                                    &mem_231130,
                                                    "mem_231130") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231130,
                                                      "mem_231130") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231135;
                            
                            mem_231135.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231135,
                                                      bytes_229535,
                                                      "mem_231135")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203576 * (int64_t) 2,
                                      segred_group_sizze_223280)) {
                                int64_t segment_sizze_nonzzero_235766 =
                                        smax64((int64_t) 1, q_t_203576);
                                int64_t num_threads_235767 = num_groups_223281 *
                                        segred_group_sizze_223280;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223280,
                                                                segment_sizze_nonzzero_235766),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               t_n_m_203740,
                                                                               squot64(segred_group_sizze_223280,
                                                                                       segment_sizze_nonzzero_235766))),
                                            '\n');
                                
                                unsigned int shared_sizze_238658 = (int64_t) 8 *
                                             segred_group_sizze_223280;
                                CUdeviceptr kernel_arg_238660 =
                                            ext_mem_229304.mem;
                                CUdeviceptr kernel_arg_238661 =
                                            ext_mem_229305.mem;
                                CUdeviceptr kernel_arg_238662 =
                                            ext_mem_229568.mem;
                                CUdeviceptr kernel_arg_238663 =
                                            ext_mem_229569.mem;
                                CUdeviceptr kernel_arg_238664 = mem_231121.mem;
                                CUdeviceptr kernel_arg_238665 = mem_231135.mem;
                                unsigned int shared_offset_238659 = 0;
                                
                                if ((((((1 && num_groups_223281 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223280 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_223281;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238655[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238659, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760,
                                          &num_groups_223281,
                                          &segment_sizze_nonzzero_235766,
                                          &kernel_arg_238660,
                                          &kernel_arg_238661,
                                          &kernel_arg_238662,
                                          &kernel_arg_238663,
                                          &kernel_arg_238664,
                                          &kernel_arg_238665};
                                    int64_t time_start_238656 = 0,
                                            time_end_238657 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_small_223287",
                                                (long) num_groups_223281,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223280,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238658 +
                                                                            (8 -
                                                                             shared_sizze_238658 %
                                                                             8) %
                                                                            8)));
                                        time_start_238656 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_223287_runs,
                                                                  &ctx->mainzisegred_small_223287_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_223287,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223280,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238658 +
                                                                           (8 -
                                                                            shared_sizze_238658 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238655,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238657 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_223287",
                                                time_end_238657 -
                                                time_start_238656);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235795 =
                                        sdiv_up64(num_groups_223281,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         t_n_m_203740));
                                int64_t elements_per_thread_235796 =
                                        sdiv_up64(q_t_203576,
                                                  segred_group_sizze_223280 *
                                                  groups_per_segment_235795);
                                int64_t virt_num_groups_235797 =
                                        groups_per_segment_235795 *
                                        (partition_sizze_203667 * t_n_m_203740);
                                int64_t num_threads_235798 = num_groups_223281 *
                                        segred_group_sizze_223280;
                                int64_t threads_per_segment_235799 =
                                        groups_per_segment_235795 *
                                        segred_group_sizze_223280;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235797,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223281,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223280,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235796,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235795,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235800;
                                
                                segred_tmp_mem_235800.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235800,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235797,
                                                          "segred_tmp_mem_235800")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235802
                                                       =
                                                       ctx->mainzicounter_mem_235802;
                                unsigned int shared_sizze_238670 = 1;
                                unsigned int shared_sizze_238672 = (int64_t) 8 *
                                             segred_group_sizze_223280;
                                CUdeviceptr kernel_arg_238674 =
                                            ext_mem_229304.mem;
                                CUdeviceptr kernel_arg_238675 =
                                            ext_mem_229305.mem;
                                CUdeviceptr kernel_arg_238676 =
                                            ext_mem_229568.mem;
                                CUdeviceptr kernel_arg_238677 =
                                            ext_mem_229569.mem;
                                CUdeviceptr kernel_arg_238678 = mem_231121.mem;
                                CUdeviceptr kernel_arg_238679 = mem_231135.mem;
                                CUdeviceptr kernel_arg_238680 =
                                            segred_tmp_mem_235800.mem;
                                CUdeviceptr kernel_arg_238681 =
                                            mainzicounter_mem_235802.mem;
                                unsigned int shared_offset_238671 = 0;
                                unsigned int shared_offset_238673 = 0 +
                                             (shared_sizze_238670 + (8 -
                                                                     shared_sizze_238670 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_223281 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223280 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_223281;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238667[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238671,
                                          &shared_offset_238673, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760,
                                          &num_groups_223281,
                                          &groups_per_segment_235795,
                                          &elements_per_thread_235796,
                                          &virt_num_groups_235797,
                                          &threads_per_segment_235799,
                                          &kernel_arg_238674,
                                          &kernel_arg_238675,
                                          &kernel_arg_238676,
                                          &kernel_arg_238677,
                                          &kernel_arg_238678,
                                          &kernel_arg_238679,
                                          &kernel_arg_238680,
                                          &kernel_arg_238681};
                                    int64_t time_start_238668 = 0,
                                            time_end_238669 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_large_223287",
                                                (long) num_groups_223281,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223280,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238670 +
                                                                            (8 -
                                                                             shared_sizze_238670 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238672 +
                                                                            (8 -
                                                                             shared_sizze_238672 %
                                                                             8) %
                                                                            8)));
                                        time_start_238668 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_223287_runs,
                                                                  &ctx->mainzisegred_large_223287_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_223287,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223280,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238670 +
                                                                           (8 -
                                                                            shared_sizze_238670 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238672 +
                                                                           (8 -
                                                                            shared_sizze_238672 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238667,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238669 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_223287",
                                                time_end_238669 -
                                                time_start_238668);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235800,
                                                          "segred_tmp_mem_235800") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_223322 =
                                    sdiv_up64(nest_sizze_210208,
                                              segmap_group_sizze_223321);
                            struct memblock_device mem_231140;
                            
                            mem_231140.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231140,
                                                      bytes_229535,
                                                      "mem_231140")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238685 = mem_231135.mem;
                            CUdeviceptr kernel_arg_238686 = mem_231140.mem;
                            
                            if ((((((1 && segmap_usable_groups_223322 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_223321 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_223322;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238682[] =
                                     {&ctx->global_failure,
                                      &partition_sizze_203667, &t_n_m_203740,
                                      &kernel_arg_238685, &kernel_arg_238686};
                                int64_t time_start_238683 = 0, time_end_238684 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_223326",
                                            (long) segmap_usable_groups_223322,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_223321,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238683 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_223326_runs,
                                                              &ctx->mainzisegmap_223326_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223326,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_223321,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238682,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238684 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_223326",
                                            time_end_238684 -
                                            time_start_238683);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231135,
                                                      "mem_231135") != 0)
                                return 1;
                            
                            struct memblock_device mem_231145;
                            
                            mem_231145.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231145,
                                                      bytes_229535,
                                                      "mem_231145")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203576 * (int64_t) 2,
                                      segred_group_sizze_223332)) {
                                int64_t segment_sizze_nonzzero_235848 =
                                        smax64((int64_t) 1, q_t_203576);
                                int64_t num_threads_235849 = num_groups_223333 *
                                        segred_group_sizze_223332;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-small");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223332,
                                                                segment_sizze_nonzzero_235848),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                               t_n_m_203740,
                                                                               squot64(segred_group_sizze_223332,
                                                                                       segment_sizze_nonzzero_235848))),
                                            '\n');
                                
                                unsigned int shared_sizze_238690 = (int64_t) 8 *
                                             segred_group_sizze_223332;
                                CUdeviceptr kernel_arg_238692 =
                                            ext_mem_229304.mem;
                                CUdeviceptr kernel_arg_238693 =
                                            ext_mem_229305.mem;
                                CUdeviceptr kernel_arg_238694 =
                                            ext_mem_229568.mem;
                                CUdeviceptr kernel_arg_238695 =
                                            ext_mem_229569.mem;
                                CUdeviceptr kernel_arg_238696 = mem_231121.mem;
                                CUdeviceptr kernel_arg_238697 = mem_231125.mem;
                                CUdeviceptr kernel_arg_238698 = mem_231140.mem;
                                CUdeviceptr kernel_arg_238699 = mem_231145.mem;
                                unsigned int shared_offset_238691 = 0;
                                
                                if ((((((1 && num_groups_223333 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223332 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_223333;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238687[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238691, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760,
                                          &num_groups_223333,
                                          &segment_sizze_nonzzero_235848,
                                          &kernel_arg_238692,
                                          &kernel_arg_238693,
                                          &kernel_arg_238694,
                                          &kernel_arg_238695,
                                          &kernel_arg_238696,
                                          &kernel_arg_238697,
                                          &kernel_arg_238698,
                                          &kernel_arg_238699};
                                    int64_t time_start_238688 = 0,
                                            time_end_238689 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_small_223339",
                                                (long) num_groups_223333,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223332,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238690 +
                                                                            (8 -
                                                                             shared_sizze_238690 %
                                                                             8) %
                                                                            8)));
                                        time_start_238688 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_small_223339_runs,
                                                                  &ctx->mainzisegred_small_223339_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_223339,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223332,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238690 +
                                                                           (8 -
                                                                            shared_sizze_238690 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238687,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238689 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_small_223339",
                                                time_end_238689 -
                                                time_start_238688);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235877 =
                                        sdiv_up64(num_groups_223333,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203667 *
                                                         t_n_m_203740));
                                int64_t elements_per_thread_235878 =
                                        sdiv_up64(q_t_203576,
                                                  segred_group_sizze_223332 *
                                                  groups_per_segment_235877);
                                int64_t virt_num_groups_235879 =
                                        groups_per_segment_235877 *
                                        (partition_sizze_203667 * t_n_m_203740);
                                int64_t num_threads_235880 = num_groups_223333 *
                                        segred_group_sizze_223332;
                                int64_t threads_per_segment_235881 =
                                        groups_per_segment_235877 *
                                        segred_group_sizze_223332;
                                
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n",
                                            "\n# SegRed-large");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_segments",
                                            (long long) (partition_sizze_203667 *
                                                         t_n_m_203740), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203576, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235879,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223333,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223332,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235878,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235877,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235882;
                                
                                segred_tmp_mem_235882.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235882,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235879,
                                                          "segred_tmp_mem_235882")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235884
                                                       =
                                                       ctx->mainzicounter_mem_235884;
                                unsigned int shared_sizze_238704 = 1;
                                unsigned int shared_sizze_238706 = (int64_t) 8 *
                                             segred_group_sizze_223332;
                                CUdeviceptr kernel_arg_238708 =
                                            ext_mem_229304.mem;
                                CUdeviceptr kernel_arg_238709 =
                                            ext_mem_229305.mem;
                                CUdeviceptr kernel_arg_238710 =
                                            ext_mem_229568.mem;
                                CUdeviceptr kernel_arg_238711 =
                                            ext_mem_229569.mem;
                                CUdeviceptr kernel_arg_238712 = mem_231121.mem;
                                CUdeviceptr kernel_arg_238713 = mem_231125.mem;
                                CUdeviceptr kernel_arg_238714 = mem_231140.mem;
                                CUdeviceptr kernel_arg_238715 = mem_231145.mem;
                                CUdeviceptr kernel_arg_238716 =
                                            segred_tmp_mem_235882.mem;
                                CUdeviceptr kernel_arg_238717 =
                                            mainzicounter_mem_235884.mem;
                                unsigned int shared_offset_238705 = 0;
                                unsigned int shared_offset_238707 = 0 +
                                             (shared_sizze_238704 + (8 -
                                                                     shared_sizze_238704 %
                                                                     8) % 8);
                                
                                if ((((((1 && num_groups_223333 != 0) && 1 !=
                                        0) && 1 != 0) &&
                                      segred_group_sizze_223332 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = num_groups_223333;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238701[] =
                                         {&ctx->global_failure,
                                          &shared_offset_238705,
                                          &shared_offset_238707, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760,
                                          &num_groups_223333,
                                          &groups_per_segment_235877,
                                          &elements_per_thread_235878,
                                          &virt_num_groups_235879,
                                          &threads_per_segment_235881,
                                          &kernel_arg_238708,
                                          &kernel_arg_238709,
                                          &kernel_arg_238710,
                                          &kernel_arg_238711,
                                          &kernel_arg_238712,
                                          &kernel_arg_238713,
                                          &kernel_arg_238714,
                                          &kernel_arg_238715,
                                          &kernel_arg_238716,
                                          &kernel_arg_238717};
                                    int64_t time_start_238702 = 0,
                                            time_end_238703 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segred_large_223339",
                                                (long) num_groups_223333,
                                                (long) 1, (long) 1,
                                                (long) segred_group_sizze_223332,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_238704 +
                                                                            (8 -
                                                                             shared_sizze_238704 %
                                                                             8) %
                                                                            8) +
                                                                           (shared_sizze_238706 +
                                                                            (8 -
                                                                             shared_sizze_238706 %
                                                                             8) %
                                                                            8)));
                                        time_start_238702 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegred_large_223339_runs,
                                                                  &ctx->mainzisegred_large_223339_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_223339,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segred_group_sizze_223332,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_238704 +
                                                                           (8 -
                                                                            shared_sizze_238704 %
                                                                            8) %
                                                                           8) +
                                                                          (shared_sizze_238706 +
                                                                           (8 -
                                                                            shared_sizze_238706 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_238701,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238703 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segred_large_223339",
                                                time_end_238703 -
                                                time_start_238702);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235882,
                                                          "segred_tmp_mem_235882") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231140,
                                                      "mem_231140") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231146,
                                                    &mem_231145,
                                                    "mem_231145") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231145,
                                                      "mem_231145") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231140,
                                                      "mem_231140") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231135,
                                                      "mem_231135") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231121,
                                                  "mem_231121") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231125,
                                                  "mem_231125") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231152,
                                                &ext_mem_231146,
                                                "ext_mem_231146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231146,
                                                  "ext_mem_231146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231125,
                                                  "mem_231125") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231121,
                                                  "mem_231121") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231116,
                                                  "mem_231116") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231510,
                                            &ext_mem_231152,
                                            "ext_mem_231152") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231509, &mem_231032,
                                            "mem_231032") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231152,
                                              "ext_mem_231152") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231032, "mem_231032") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_206033 = (int64_t) 1 == d_t_203579;
                    struct memblock_device ext_mem_231508;
                    
                    ext_mem_231508.references = NULL;
                    
                    struct memblock_device ext_mem_231507;
                    
                    ext_mem_231507.references = NULL;
                    if (match_lit_206033) {
                        bool suff_outer_par_223382;
                        
                        suff_outer_par_223382 =
                            *ctx->tuning_params.mainzisuff_outer_par_30 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_30",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_223382 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_223507;
                        
                        segmap_group_sizze_223507 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223386;
                        
                        int64_t num_groups_223508;
                        int32_t max_num_groups_235922;
                        
                        max_num_groups_235922 =
                            *ctx->tuning_params.mainzisegmap_num_groups_223388;
                        num_groups_223508 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_223507),
                                                                       sext_i32_i64(max_num_groups_235922))));
                        
                        int64_t segmap_group_sizze_224158;
                        
                        segmap_group_sizze_224158 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224132;
                        
                        int64_t segmap_group_sizze_224174;
                        
                        segmap_group_sizze_224174 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224076;
                        
                        int64_t segmap_group_sizze_224199;
                        
                        segmap_group_sizze_224199 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223634;
                        
                        bool suff_outer_par_224203;
                        
                        suff_outer_par_224203 =
                            *ctx->tuning_params.mainzisuff_outer_par_31 <=
                            nest_sizze_210208;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_31",
                                    (long) nest_sizze_210208,
                                    suff_outer_par_224203 ? "true" : "false");
                        
                        int64_t nest_sizze_224315 = q_t_203576 *
                                nest_sizze_210208;
                        int64_t segred_group_sizze_224316;
                        
                        segred_group_sizze_224316 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223845;
                        
                        int64_t num_groups_224317;
                        int32_t max_num_groups_235923;
                        
                        max_num_groups_235923 =
                            *ctx->tuning_params.mainzisegred_num_groups_223847;
                        num_groups_224317 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224315,
                                                                                 segred_group_sizze_224316),
                                                                       sext_i32_i64(max_num_groups_235923))));
                        
                        int64_t segmap_group_sizze_224367;
                        
                        segmap_group_sizze_224367 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223823;
                        
                        int64_t segred_group_sizze_224389;
                        
                        segred_group_sizze_224389 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223748;
                        
                        int64_t num_groups_224390;
                        int32_t max_num_groups_235924;
                        
                        max_num_groups_235924 =
                            *ctx->tuning_params.mainzisegred_num_groups_223750;
                        num_groups_224390 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224315,
                                                                                 segred_group_sizze_224389),
                                                                       sext_i32_i64(max_num_groups_235924))));
                        
                        int64_t maxSubHelper_232154 = umax64(bytes_229277,
                                                             bytes_229528);
                        int64_t num_threads_232304 = segmap_group_sizze_223507 *
                                num_groups_223508;
                        int64_t total_sizze_232305 = maxSubHelper_232154 *
                                num_threads_232304;
                        int64_t total_sizze_232306 = bytes_229528 *
                                num_threads_232304;
                        int64_t total_sizze_232307 = bytes_229277 *
                                num_threads_232304;
                        int64_t total_sizze_232308 = bytes_229277 *
                                num_threads_232304;
                        struct memblock_device ext_mem_231321;
                        
                        ext_mem_231321.references = NULL;
                        
                        struct memblock_device ext_mem_231320;
                        
                        ext_mem_231320.references = NULL;
                        
                        int32_t local_memory_capacity_236194;
                        
                        local_memory_capacity_236194 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236194)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236194))) &&
                            suff_outer_par_223382) {
                            struct memblock_device mem_231155;
                            
                            mem_231155.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231155,
                                                      binop_y_229284,
                                                      "mem_231155")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231155,
                                                                      (int64_t) 0,
                                                                      mem_231028,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231158;
                            
                            mem_231158.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231158,
                                                      binop_y_229284,
                                                      "mem_231158")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231158,
                                                                      (int64_t) 0,
                                                                      ext_mem_229305,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231161;
                            
                            mem_231161.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231161,
                                                      binop_y_229534,
                                                      "mem_231161")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231161,
                                                                      (int64_t) 0,
                                                                      ext_mem_229569,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231164;
                            
                            mem_231164.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231164,
                                                      binop_y_229534,
                                                      "mem_231164")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231164,
                                                                      (int64_t) 0,
                                                                      ext_mem_229568,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231167;
                            
                            mem_231167.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231167,
                                                      binop_y_229284,
                                                      "mem_231167")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235928;
                            
                            group_sizze_235928 =
                                *ctx->tuning_params.mainzigroup_sizze_235928;
                            
                            int64_t num_groups_235929 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_235928);
                            CUdeviceptr kernel_arg_238721 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238722 = mem_231167.mem;
                            
                            if ((((((1 && num_groups_235929 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_235928 != 0) && 1 !=
                                 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_235929;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238718[] = {&n_203572,
                                                              &partition_sizze_203667,
                                                              &ctx_param_ext_229596,
                                                              &ctx_param_ext_229597,
                                                              &ctx_param_ext_229599,
                                                              &kernel_arg_238721,
                                                              &kernel_arg_238722};
                                int64_t time_start_238719 = 0, time_end_238720 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.copy_235925",
                                            (long) num_groups_235929, (long) 1,
                                            (long) 1, (long) group_sizze_235928,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238719 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_235925_runs,
                                                              &ctx->mainzicopy_235925_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_235925,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_235928,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238718,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238720 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_235925",
                                            time_end_238720 -
                                            time_start_238719);
                                }
                            }
                            
                            struct memblock_device mem_231246;
                            
                            mem_231246.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231246,
                                                      binop_y_229534,
                                                      "mem_231246")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231249;
                            
                            mem_231249.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231249,
                                                      binop_y_229534,
                                                      "mem_231249")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232155;
                            
                            color_232155.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232155,
                                                      total_sizze_232305,
                                                      "color_232155")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232156;
                            
                            color_232156.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232156,
                                                      total_sizze_232306,
                                                      "color_232156")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232157;
                            
                            color_232157.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232157,
                                                      total_sizze_232307,
                                                      "color_232157")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232158;
                            
                            color_232158.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232158,
                                                      total_sizze_232308,
                                                      "color_232158")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238726 = mem_229269.mem;
                            CUdeviceptr kernel_arg_238727 = ext_mem_229304.mem;
                            CUdeviceptr kernel_arg_238728 = mem_231155.mem;
                            CUdeviceptr kernel_arg_238729 = mem_231158.mem;
                            CUdeviceptr kernel_arg_238730 = mem_231161.mem;
                            CUdeviceptr kernel_arg_238731 = mem_231164.mem;
                            CUdeviceptr kernel_arg_238732 = mem_231167.mem;
                            CUdeviceptr kernel_arg_238733 = mem_231246.mem;
                            CUdeviceptr kernel_arg_238734 = mem_231249.mem;
                            CUdeviceptr kernel_arg_238735 = color_232155.mem;
                            CUdeviceptr kernel_arg_238736 = color_232156.mem;
                            CUdeviceptr kernel_arg_238737 = color_232157.mem;
                            CUdeviceptr kernel_arg_238738 = color_232158.mem;
                            
                            if ((((((1 && num_groups_223508 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_223507 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_223508;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238723[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203572,
                                      &q_t_203576, &jump_t_203582,
                                      &partition_sizze_203667, &t_n_m_203740,
                                      &i_203760, &num_groups_223508,
                                      &num_threads_232304, &kernel_arg_238726,
                                      &kernel_arg_238727, &kernel_arg_238728,
                                      &kernel_arg_238729, &kernel_arg_238730,
                                      &kernel_arg_238731, &kernel_arg_238732,
                                      &kernel_arg_238733, &kernel_arg_238734,
                                      &kernel_arg_238735, &kernel_arg_238736,
                                      &kernel_arg_238737, &kernel_arg_238738};
                                int64_t time_start_238724 = 0, time_end_238725 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_223513",
                                            (long) num_groups_223508, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_223507,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238724 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_223513_runs,
                                                              &ctx->mainzisegmap_223513_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_223513,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_223507,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238723,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238725 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_223513",
                                            time_end_238725 -
                                            time_start_238724);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231158,
                                                      "mem_231158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231161,
                                                      "mem_231161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231164,
                                                      "mem_231164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231167,
                                                      "mem_231167") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232155,
                                                      "color_232155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232156,
                                                      "color_232156") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232157,
                                                      "color_232157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232158,
                                                      "color_232158") != 0)
                                return 1;
                            
                            struct memblock_device mem_231313;
                            
                            mem_231313.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231313,
                                                      bytes_229535,
                                                      "mem_231313")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231313,
                                                                      (int64_t) 0,
                                                                      mem_231246,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231313,
                                                          "mem_231313") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232158,
                                                          "color_232158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232157,
                                                          "color_232157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232156,
                                                          "color_232156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232155,
                                                          "color_232155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231249,
                                                          "mem_231249") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231246,
                                                          "mem_231246") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231167,
                                                          "mem_231167") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231246,
                                                      "mem_231246") != 0)
                                return 1;
                            
                            struct memblock_device mem_231318;
                            
                            mem_231318.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231318,
                                                      bytes_229535,
                                                      "mem_231318")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231318,
                                                                      (int64_t) 0,
                                                                      mem_231249,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231318,
                                                          "mem_231318") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231313,
                                                          "mem_231313") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232158,
                                                          "color_232158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232157,
                                                          "color_232157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232156,
                                                          "color_232156") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232155,
                                                          "color_232155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231249,
                                                          "mem_231249") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231246,
                                                          "mem_231246") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231167,
                                                          "mem_231167") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231161,
                                                          "mem_231161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231158,
                                                          "mem_231158") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231155,
                                                          "mem_231155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231320,
                                                          "ext_mem_231320") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231321,
                                                          "ext_mem_231321") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231249,
                                                      "mem_231249") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231321,
                                                    &mem_231313,
                                                    "mem_231313") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231320,
                                                    &mem_231318,
                                                    "mem_231318") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231318,
                                                      "mem_231318") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231313,
                                                      "mem_231313") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232158,
                                                      "color_232158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232157,
                                                      "color_232157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232156,
                                                      "color_232156") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232155,
                                                      "color_232155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231249,
                                                      "mem_231249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231246,
                                                      "mem_231246") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231167,
                                                      "mem_231167") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231164,
                                                      "mem_231164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231161,
                                                      "mem_231161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231158,
                                                      "mem_231158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_224159 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_224158);
                            struct memblock_device mem_231254;
                            
                            mem_231254.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231254,
                                                      bytes_229285,
                                                      "mem_231254")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238742 = mem_229269.mem;
                            CUdeviceptr kernel_arg_238743 = mem_231028.mem;
                            CUdeviceptr kernel_arg_238744 = mem_231254.mem;
                            
                            if ((((((1 && segmap_usable_groups_224159 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_224158 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_224159;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238739[] =
                                     {&ctx->global_failure, &n_203572,
                                      &partition_sizze_203667,
                                      &kernel_arg_238742, &kernel_arg_238743,
                                      &kernel_arg_238744};
                                int64_t time_start_238740 = 0, time_end_238741 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_224163",
                                            (long) segmap_usable_groups_224159,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_224158,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238740 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_224163_runs,
                                                              &ctx->mainzisegmap_224163_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224163,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_224158,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238739,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238741 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_224163",
                                            time_end_238741 -
                                            time_start_238740);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_224175 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_224174);
                            struct memblock_device mem_231259;
                            
                            mem_231259.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231259,
                                                      bytes_229285,
                                                      "mem_231259")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231263;
                            
                            mem_231263.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231263,
                                                      bytes_229285,
                                                      "mem_231263")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238748 = ext_mem_229305.mem;
                            CUdeviceptr kernel_arg_238749 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238750 = mem_231254.mem;
                            CUdeviceptr kernel_arg_238751 = mem_231259.mem;
                            CUdeviceptr kernel_arg_238752 = mem_231263.mem;
                            
                            if ((((((1 && segmap_usable_groups_224175 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_224174 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_224175;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238745[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203572,
                                      &partition_sizze_203667,
                                      &ctx_param_ext_229596,
                                      &ctx_param_ext_229597,
                                      &ctx_param_ext_229599, &kernel_arg_238748,
                                      &kernel_arg_238749, &kernel_arg_238750,
                                      &kernel_arg_238751, &kernel_arg_238752};
                                int64_t time_start_238746 = 0, time_end_238747 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_224180",
                                            (long) segmap_usable_groups_224175,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_224174,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238746 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_224180_runs,
                                                              &ctx->mainzisegmap_224180_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224180,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_224174,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238745,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238747 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_224180",
                                            time_end_238747 -
                                            time_start_238746);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231254,
                                                      "mem_231254") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_224200 =
                                    sdiv_up64(nest_sizze_210208,
                                              segmap_group_sizze_224199);
                            struct memblock_device ext_mem_231309;
                            
                            ext_mem_231309.references = NULL;
                            
                            struct memblock_device ext_mem_231308;
                            
                            ext_mem_231308.references = NULL;
                            
                            int32_t local_memory_capacity_236193;
                            
                            local_memory_capacity_236193 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_236193)) &&
                                suff_outer_par_224203) {
                                struct memblock_device mem_231268;
                                
                                mem_231268.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231268,
                                                          bytes_229535,
                                                          "mem_231268")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231272;
                                
                                mem_231272.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231272,
                                                          bytes_229535,
                                                          "mem_231272")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238756 =
                                            ext_mem_229304.mem;
                                CUdeviceptr kernel_arg_238757 =
                                            ext_mem_229305.mem;
                                CUdeviceptr kernel_arg_238758 =
                                            ext_mem_229568.mem;
                                CUdeviceptr kernel_arg_238759 =
                                            ext_mem_229569.mem;
                                CUdeviceptr kernel_arg_238760 = mem_231259.mem;
                                CUdeviceptr kernel_arg_238761 = mem_231263.mem;
                                CUdeviceptr kernel_arg_238762 = mem_231268.mem;
                                CUdeviceptr kernel_arg_238763 = mem_231272.mem;
                                
                                if ((((((1 && segmap_usable_groups_224200 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_224199 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_224200;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238753[] =
                                         {&ctx->global_failure, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760,
                                          &kernel_arg_238756,
                                          &kernel_arg_238757,
                                          &kernel_arg_238758,
                                          &kernel_arg_238759,
                                          &kernel_arg_238760,
                                          &kernel_arg_238761,
                                          &kernel_arg_238762,
                                          &kernel_arg_238763};
                                    int64_t time_start_238754 = 0,
                                            time_end_238755 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_224210",
                                                (long) segmap_usable_groups_224200,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_224199,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238754 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_224210_runs,
                                                                  &ctx->mainzisegmap_224210_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224210,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_224199,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238753,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238755 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_224210",
                                                time_end_238755 -
                                                time_start_238754);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231309,
                                                        &mem_231268,
                                                        "mem_231268") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231308,
                                                        &mem_231272,
                                                        "mem_231272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231272,
                                                          "mem_231272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231268,
                                                          "mem_231268") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231277;
                                
                                mem_231277.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231277,
                                                          bytes_229535,
                                                          "mem_231277")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231281;
                                
                                mem_231281.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231281,
                                                          bytes_229535,
                                                          "mem_231281")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231285;
                                
                                mem_231285.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231285,
                                                          bytes_229535,
                                                          "mem_231285")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_224316)) {
                                    int64_t segment_sizze_nonzzero_235997 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_235998 =
                                            num_groups_224317 *
                                            segred_group_sizze_224316;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224316,
                                                                    segment_sizze_nonzzero_235997),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_224316,
                                                                                           segment_sizze_nonzzero_235997))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238767 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224316;
                                    unsigned int shared_sizze_238769 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224316;
                                    unsigned int shared_sizze_238771 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224316;
                                    CUdeviceptr kernel_arg_238773 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238774 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238775 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238776 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238777 =
                                                mem_231259.mem;
                                    CUdeviceptr kernel_arg_238778 =
                                                mem_231277.mem;
                                    CUdeviceptr kernel_arg_238779 =
                                                mem_231281.mem;
                                    CUdeviceptr kernel_arg_238780 =
                                                mem_231285.mem;
                                    unsigned int shared_offset_238768 = 0;
                                    unsigned int shared_offset_238770 = 0 +
                                                 (shared_sizze_238767 + (8 -
                                                                         shared_sizze_238767 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238772 = 0 +
                                                 (shared_sizze_238767 + (8 -
                                                                         shared_sizze_238767 %
                                                                         8) %
                                                  8) + (shared_sizze_238769 +
                                                        (8 -
                                                         shared_sizze_238769 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_224317 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224316 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_224317;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238764[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238768,
                                              &shared_offset_238770,
                                              &shared_offset_238772, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_224317,
                                              &segment_sizze_nonzzero_235997,
                                              &kernel_arg_238773,
                                              &kernel_arg_238774,
                                              &kernel_arg_238775,
                                              &kernel_arg_238776,
                                              &kernel_arg_238777,
                                              &kernel_arg_238778,
                                              &kernel_arg_238779,
                                              &kernel_arg_238780};
                                        int64_t time_start_238765 = 0,
                                                time_end_238766 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_224325",
                                                    (long) num_groups_224317,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224316,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238767 +
                                                            (8 -
                                                             shared_sizze_238767 %
                                                             8) % 8) +
                                                           (shared_sizze_238769 +
                                                            (8 -
                                                             shared_sizze_238769 %
                                                             8) % 8) +
                                                           (shared_sizze_238771 +
                                                            (8 -
                                                             shared_sizze_238771 %
                                                             8) % 8)));
                                            time_start_238765 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_224325_runs,
                                                                &ctx->mainzisegred_small_224325_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_224325,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224316,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238767 +
                                                                               (8 -
                                                                                shared_sizze_238767 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238769 +
                                                                               (8 -
                                                                                shared_sizze_238769 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238771 +
                                                                               (8 -
                                                                                shared_sizze_238771 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238764,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238766 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_224325",
                                                    time_end_238766 -
                                                    time_start_238765);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236038 =
                                            sdiv_up64(num_groups_224317,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_236039 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_224316 *
                                                      groups_per_segment_236038);
                                    int64_t virt_num_groups_236040 =
                                            groups_per_segment_236038 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_236041 =
                                            num_groups_224317 *
                                            segred_group_sizze_224316;
                                    int64_t threads_per_segment_236042 =
                                            groups_per_segment_236038 *
                                            segred_group_sizze_224316;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236040,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224317,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224316,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236039,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236038,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236043;
                                    
                                    segred_tmp_mem_236043.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236043,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236040,
                                                              "segred_tmp_mem_236043")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236045;
                                    
                                    segred_tmp_mem_236045.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236045,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236040,
                                                              "segred_tmp_mem_236045")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236047;
                                    
                                    segred_tmp_mem_236047.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236047,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236040,
                                                              "segred_tmp_mem_236047")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236049 =
                                    ctx->mainzicounter_mem_236049;
                                    unsigned int shared_sizze_238785 = 1;
                                    unsigned int shared_sizze_238787 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224316;
                                    unsigned int shared_sizze_238789 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224316;
                                    unsigned int shared_sizze_238791 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224316;
                                    CUdeviceptr kernel_arg_238793 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238794 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238795 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238796 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238797 =
                                                mem_231259.mem;
                                    CUdeviceptr kernel_arg_238798 =
                                                mem_231277.mem;
                                    CUdeviceptr kernel_arg_238799 =
                                                mem_231281.mem;
                                    CUdeviceptr kernel_arg_238800 =
                                                mem_231285.mem;
                                    CUdeviceptr kernel_arg_238801 =
                                                segred_tmp_mem_236043.mem;
                                    CUdeviceptr kernel_arg_238802 =
                                                segred_tmp_mem_236045.mem;
                                    CUdeviceptr kernel_arg_238803 =
                                                segred_tmp_mem_236047.mem;
                                    CUdeviceptr kernel_arg_238804 =
                                                mainzicounter_mem_236049.mem;
                                    unsigned int shared_offset_238786 = 0;
                                    unsigned int shared_offset_238788 = 0 +
                                                 (shared_sizze_238785 + (8 -
                                                                         shared_sizze_238785 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238790 = 0 +
                                                 (shared_sizze_238785 + (8 -
                                                                         shared_sizze_238785 %
                                                                         8) %
                                                  8) + (shared_sizze_238787 +
                                                        (8 -
                                                         shared_sizze_238787 %
                                                         8) % 8);
                                    unsigned int shared_offset_238792 = 0 +
                                                 (shared_sizze_238785 + (8 -
                                                                         shared_sizze_238785 %
                                                                         8) %
                                                  8) + (shared_sizze_238787 +
                                                        (8 -
                                                         shared_sizze_238787 %
                                                         8) % 8) +
                                                 (shared_sizze_238789 + (8 -
                                                                         shared_sizze_238789 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_224317 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224316 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_224317;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238782[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238786,
                                              &shared_offset_238788,
                                              &shared_offset_238790,
                                              &shared_offset_238792, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_224317,
                                              &groups_per_segment_236038,
                                              &elements_per_thread_236039,
                                              &virt_num_groups_236040,
                                              &threads_per_segment_236042,
                                              &kernel_arg_238793,
                                              &kernel_arg_238794,
                                              &kernel_arg_238795,
                                              &kernel_arg_238796,
                                              &kernel_arg_238797,
                                              &kernel_arg_238798,
                                              &kernel_arg_238799,
                                              &kernel_arg_238800,
                                              &kernel_arg_238801,
                                              &kernel_arg_238802,
                                              &kernel_arg_238803,
                                              &kernel_arg_238804};
                                        int64_t time_start_238783 = 0,
                                                time_end_238784 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_224325",
                                                    (long) num_groups_224317,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224316,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238785 +
                                                            (8 -
                                                             shared_sizze_238785 %
                                                             8) % 8) +
                                                           (shared_sizze_238787 +
                                                            (8 -
                                                             shared_sizze_238787 %
                                                             8) % 8) +
                                                           (shared_sizze_238789 +
                                                            (8 -
                                                             shared_sizze_238789 %
                                                             8) % 8) +
                                                           (shared_sizze_238791 +
                                                            (8 -
                                                             shared_sizze_238791 %
                                                             8) % 8)));
                                            time_start_238783 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_224325_runs,
                                                                &ctx->mainzisegred_large_224325_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_224325,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224316,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238785 +
                                                                               (8 -
                                                                                shared_sizze_238785 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238787 +
                                                                               (8 -
                                                                                shared_sizze_238787 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238789 +
                                                                               (8 -
                                                                                shared_sizze_238789 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238791 +
                                                                               (8 -
                                                                                shared_sizze_238791 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238782,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238784 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224325",
                                                    time_end_238784 -
                                                    time_start_238783);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236047,
                                                              "segred_tmp_mem_236047") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236045,
                                                              "segred_tmp_mem_236045") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236043,
                                                              "segred_tmp_mem_236043") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_224368 =
                                        sdiv_up64(nest_sizze_210208,
                                                  segmap_group_sizze_224367);
                                struct memblock_device mem_231290;
                                
                                mem_231290.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231290,
                                                          bytes_229535,
                                                          "mem_231290")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231294;
                                
                                mem_231294.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231294,
                                                          bytes_229535,
                                                          "mem_231294")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231298;
                                
                                mem_231298.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231298,
                                                          bytes_229535,
                                                          "mem_231298")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238808 = mem_231277.mem;
                                CUdeviceptr kernel_arg_238809 = mem_231281.mem;
                                CUdeviceptr kernel_arg_238810 = mem_231285.mem;
                                CUdeviceptr kernel_arg_238811 = mem_231290.mem;
                                CUdeviceptr kernel_arg_238812 = mem_231294.mem;
                                CUdeviceptr kernel_arg_238813 = mem_231298.mem;
                                
                                if ((((((1 && segmap_usable_groups_224368 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_224367 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_224368;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238805[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &kernel_arg_238808,
                                          &kernel_arg_238809,
                                          &kernel_arg_238810,
                                          &kernel_arg_238811,
                                          &kernel_arg_238812,
                                          &kernel_arg_238813};
                                    int64_t time_start_238806 = 0,
                                            time_end_238807 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_224374",
                                                (long) segmap_usable_groups_224368,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_224367,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238806 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_224374_runs,
                                                                  &ctx->mainzisegmap_224374_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224374,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_224367,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238805,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238807 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_224374",
                                                time_end_238807 -
                                                time_start_238806);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231277,
                                                          "mem_231277") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231281,
                                                          "mem_231281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231285,
                                                          "mem_231285") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231303;
                                
                                mem_231303.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231303,
                                                          bytes_229535,
                                                          "mem_231303")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231307;
                                
                                mem_231307.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231307,
                                                          bytes_229535,
                                                          "mem_231307")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_224389)) {
                                    int64_t segment_sizze_nonzzero_236107 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_236108 =
                                            num_groups_224390 *
                                            segred_group_sizze_224389;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224389,
                                                                    segment_sizze_nonzzero_236107),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_224389,
                                                                                           segment_sizze_nonzzero_236107))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238817 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224389;
                                    unsigned int shared_sizze_238819 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224389;
                                    CUdeviceptr kernel_arg_238821 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238822 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238823 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238824 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238825 =
                                                mem_231259.mem;
                                    CUdeviceptr kernel_arg_238826 =
                                                mem_231263.mem;
                                    CUdeviceptr kernel_arg_238827 =
                                                mem_231290.mem;
                                    CUdeviceptr kernel_arg_238828 =
                                                mem_231294.mem;
                                    CUdeviceptr kernel_arg_238829 =
                                                mem_231298.mem;
                                    CUdeviceptr kernel_arg_238830 =
                                                mem_231303.mem;
                                    CUdeviceptr kernel_arg_238831 =
                                                mem_231307.mem;
                                    unsigned int shared_offset_238818 = 0;
                                    unsigned int shared_offset_238820 = 0 +
                                                 (shared_sizze_238817 + (8 -
                                                                         shared_sizze_238817 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_224390 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224389 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_224390;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238814[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238818,
                                              &shared_offset_238820, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_224390,
                                              &segment_sizze_nonzzero_236107,
                                              &kernel_arg_238821,
                                              &kernel_arg_238822,
                                              &kernel_arg_238823,
                                              &kernel_arg_238824,
                                              &kernel_arg_238825,
                                              &kernel_arg_238826,
                                              &kernel_arg_238827,
                                              &kernel_arg_238828,
                                              &kernel_arg_238829,
                                              &kernel_arg_238830,
                                              &kernel_arg_238831};
                                        int64_t time_start_238815 = 0,
                                                time_end_238816 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_224397",
                                                    (long) num_groups_224390,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224389,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238817 +
                                                            (8 -
                                                             shared_sizze_238817 %
                                                             8) % 8) +
                                                           (shared_sizze_238819 +
                                                            (8 -
                                                             shared_sizze_238819 %
                                                             8) % 8)));
                                            time_start_238815 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_224397_runs,
                                                                &ctx->mainzisegred_small_224397_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_224397,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224389,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238817 +
                                                                               (8 -
                                                                                shared_sizze_238817 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238819 +
                                                                               (8 -
                                                                                shared_sizze_238819 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238814,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238816 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_224397",
                                                    time_end_238816 -
                                                    time_start_238815);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236142 =
                                            sdiv_up64(num_groups_224390,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_236143 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_224389 *
                                                      groups_per_segment_236142);
                                    int64_t virt_num_groups_236144 =
                                            groups_per_segment_236142 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_236145 =
                                            num_groups_224390 *
                                            segred_group_sizze_224389;
                                    int64_t threads_per_segment_236146 =
                                            groups_per_segment_236142 *
                                            segred_group_sizze_224389;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236144,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224390,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224389,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236143,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236142,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236147;
                                    
                                    segred_tmp_mem_236147.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236147,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236144,
                                                              "segred_tmp_mem_236147")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236149;
                                    
                                    segred_tmp_mem_236149.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236149,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236144,
                                                              "segred_tmp_mem_236149")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236151 =
                                    ctx->mainzicounter_mem_236151;
                                    unsigned int shared_sizze_238836 = 1;
                                    unsigned int shared_sizze_238838 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224389;
                                    unsigned int shared_sizze_238840 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_224389;
                                    CUdeviceptr kernel_arg_238842 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238843 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238844 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238845 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238846 =
                                                mem_231259.mem;
                                    CUdeviceptr kernel_arg_238847 =
                                                mem_231263.mem;
                                    CUdeviceptr kernel_arg_238848 =
                                                mem_231290.mem;
                                    CUdeviceptr kernel_arg_238849 =
                                                mem_231294.mem;
                                    CUdeviceptr kernel_arg_238850 =
                                                mem_231298.mem;
                                    CUdeviceptr kernel_arg_238851 =
                                                mem_231303.mem;
                                    CUdeviceptr kernel_arg_238852 =
                                                mem_231307.mem;
                                    CUdeviceptr kernel_arg_238853 =
                                                segred_tmp_mem_236147.mem;
                                    CUdeviceptr kernel_arg_238854 =
                                                segred_tmp_mem_236149.mem;
                                    CUdeviceptr kernel_arg_238855 =
                                                mainzicounter_mem_236151.mem;
                                    unsigned int shared_offset_238837 = 0;
                                    unsigned int shared_offset_238839 = 0 +
                                                 (shared_sizze_238836 + (8 -
                                                                         shared_sizze_238836 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238841 = 0 +
                                                 (shared_sizze_238836 + (8 -
                                                                         shared_sizze_238836 %
                                                                         8) %
                                                  8) + (shared_sizze_238838 +
                                                        (8 -
                                                         shared_sizze_238838 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_224390 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_224389 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_224390;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238833[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238837,
                                              &shared_offset_238839,
                                              &shared_offset_238841, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_224390,
                                              &groups_per_segment_236142,
                                              &elements_per_thread_236143,
                                              &virt_num_groups_236144,
                                              &threads_per_segment_236146,
                                              &kernel_arg_238842,
                                              &kernel_arg_238843,
                                              &kernel_arg_238844,
                                              &kernel_arg_238845,
                                              &kernel_arg_238846,
                                              &kernel_arg_238847,
                                              &kernel_arg_238848,
                                              &kernel_arg_238849,
                                              &kernel_arg_238850,
                                              &kernel_arg_238851,
                                              &kernel_arg_238852,
                                              &kernel_arg_238853,
                                              &kernel_arg_238854,
                                              &kernel_arg_238855};
                                        int64_t time_start_238834 = 0,
                                                time_end_238835 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_224397",
                                                    (long) num_groups_224390,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_224389,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238836 +
                                                            (8 -
                                                             shared_sizze_238836 %
                                                             8) % 8) +
                                                           (shared_sizze_238838 +
                                                            (8 -
                                                             shared_sizze_238838 %
                                                             8) % 8) +
                                                           (shared_sizze_238840 +
                                                            (8 -
                                                             shared_sizze_238840 %
                                                             8) % 8)));
                                            time_start_238834 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_224397_runs,
                                                                &ctx->mainzisegred_large_224397_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_224397,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_224389,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238836 +
                                                                               (8 -
                                                                                shared_sizze_238836 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238838 +
                                                                               (8 -
                                                                                shared_sizze_238838 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238840 +
                                                                               (8 -
                                                                                shared_sizze_238840 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238833,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238835 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224397",
                                                    time_end_238835 -
                                                    time_start_238834);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236149,
                                                              "segred_tmp_mem_236149") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236147,
                                                              "segred_tmp_mem_236147") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231290,
                                                          "mem_231290") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231294,
                                                          "mem_231294") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231298,
                                                          "mem_231298") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231309,
                                                        &mem_231303,
                                                        "mem_231303") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231308,
                                                        &mem_231307,
                                                        "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231307,
                                                          "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231303,
                                                          "mem_231303") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231298,
                                                          "mem_231298") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231294,
                                                          "mem_231294") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231290,
                                                          "mem_231290") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231285,
                                                          "mem_231285") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231281,
                                                          "mem_231281") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231277,
                                                          "mem_231277") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231259,
                                                      "mem_231259") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231263,
                                                      "mem_231263") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231321,
                                                    &ext_mem_231309,
                                                    "ext_mem_231309") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231320,
                                                    &ext_mem_231308,
                                                    "ext_mem_231308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231308,
                                                      "ext_mem_231308") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231309,
                                                      "ext_mem_231309") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231263,
                                                      "mem_231263") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231259,
                                                      "mem_231259") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231254,
                                                      "mem_231254") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231508,
                                                &ext_mem_231321,
                                                "ext_mem_231321") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231507,
                                                &ext_mem_231320,
                                                "ext_mem_231320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231320,
                                                  "ext_mem_231320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231321,
                                                  "ext_mem_231321") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_224456;
                        
                        suff_outer_par_224456 =
                            *ctx->tuning_params.mainzisuff_outer_par_32 <=
                            partition_sizze_203667;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_32",
                                    (long) partition_sizze_203667,
                                    suff_outer_par_224456 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_224613;
                        
                        segmap_group_sizze_224613 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224460;
                        
                        int64_t num_groups_224614;
                        int32_t max_num_groups_236195;
                        
                        max_num_groups_236195 =
                            *ctx->tuning_params.mainzisegmap_num_groups_224462;
                        num_groups_224614 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203667,
                                                                                 segmap_group_sizze_224613),
                                                                       sext_i32_i64(max_num_groups_236195))));
                        
                        int64_t segmap_group_sizze_225412;
                        
                        segmap_group_sizze_225412 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225386;
                        
                        int64_t segmap_group_sizze_225428;
                        
                        segmap_group_sizze_225428 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225330;
                        
                        int64_t segmap_group_sizze_225453;
                        
                        segmap_group_sizze_225453 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224772;
                        
                        bool suff_outer_par_225457;
                        
                        suff_outer_par_225457 =
                            *ctx->tuning_params.mainzisuff_outer_par_33 <=
                            nest_sizze_210208;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_33",
                                    (long) nest_sizze_210208,
                                    suff_outer_par_225457 ? "true" : "false");
                        
                        int64_t nest_sizze_225601 = q_t_203576 *
                                nest_sizze_210208;
                        int64_t segred_group_sizze_225602;
                        
                        segred_group_sizze_225602 =
                            *ctx->tuning_params.mainzisegred_group_sizze_225051;
                        
                        int64_t num_groups_225603;
                        int32_t max_num_groups_236196;
                        
                        max_num_groups_236196 =
                            *ctx->tuning_params.mainzisegred_num_groups_225053;
                        num_groups_225603 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225601,
                                                                                 segred_group_sizze_225602),
                                                                       sext_i32_i64(max_num_groups_236196))));
                        
                        int64_t segmap_group_sizze_225663;
                        
                        segmap_group_sizze_225663 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225010;
                        
                        int64_t segred_group_sizze_225706;
                        
                        segred_group_sizze_225706 =
                            *ctx->tuning_params.mainzisegred_group_sizze_224922;
                        
                        int64_t num_groups_225707;
                        int32_t max_num_groups_236197;
                        
                        max_num_groups_236197 =
                            *ctx->tuning_params.mainzisegred_num_groups_224924;
                        num_groups_225707 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225601,
                                                                                 segred_group_sizze_225706),
                                                                       sext_i32_i64(max_num_groups_236197))));
                        
                        int64_t maxSubHelper_232159 = umax64(bytes_229277,
                                                             bytes_229528);
                        int64_t num_threads_232315 = segmap_group_sizze_224613 *
                                num_groups_224614;
                        int64_t total_sizze_232316 = maxSubHelper_232159 *
                                num_threads_232315;
                        int64_t total_sizze_232317 = bytes_229528 *
                                num_threads_232315;
                        int64_t total_sizze_232318 = bytes_229277 *
                                num_threads_232315;
                        int64_t total_sizze_232319 = bytes_229277 *
                                num_threads_232315;
                        struct memblock_device ext_mem_231506;
                        
                        ext_mem_231506.references = NULL;
                        
                        struct memblock_device ext_mem_231505;
                        
                        ext_mem_231505.references = NULL;
                        
                        int32_t local_memory_capacity_236499;
                        
                        local_memory_capacity_236499 =
                            ctx->cuda.max_shared_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236499)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236499))) &&
                            suff_outer_par_224456) {
                            struct memblock_device mem_231324;
                            
                            mem_231324.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231324,
                                                      binop_y_229284,
                                                      "mem_231324")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231324,
                                                                      (int64_t) 0,
                                                                      mem_231028,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231327;
                            
                            mem_231327.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231327,
                                                      binop_y_229284,
                                                      "mem_231327")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231327,
                                                                      (int64_t) 0,
                                                                      ext_mem_229305,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203572,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231330;
                            
                            mem_231330.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231330,
                                                      binop_y_229534,
                                                      "mem_231330")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231330,
                                                                      (int64_t) 0,
                                                                      ext_mem_229569,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231333;
                            
                            mem_231333.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231333,
                                                      binop_y_229534,
                                                      "mem_231333")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231333,
                                                                      (int64_t) 0,
                                                                      ext_mem_229568,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203740,
                                                                      partition_sizze_203667) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231336;
                            
                            mem_231336.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231336,
                                                      binop_y_229284,
                                                      "mem_231336")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_236201;
                            
                            group_sizze_236201 =
                                *ctx->tuning_params.mainzigroup_sizze_236201;
                            
                            int64_t num_groups_236202 =
                                    sdiv_up64(partition_sizze_203667 * n_203572,
                                              group_sizze_236201);
                            CUdeviceptr kernel_arg_238859 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238860 = mem_231336.mem;
                            
                            if ((((((1 && num_groups_236202 != 0) && 1 != 0) &&
                                   1 != 0) && group_sizze_236201 != 0) && 1 !=
                                 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_236202;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238856[] = {&n_203572,
                                                              &partition_sizze_203667,
                                                              &ctx_param_ext_229596,
                                                              &ctx_param_ext_229597,
                                                              &ctx_param_ext_229599,
                                                              &kernel_arg_238859,
                                                              &kernel_arg_238860};
                                int64_t time_start_238857 = 0, time_end_238858 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.copy_236198",
                                            (long) num_groups_236202, (long) 1,
                                            (long) 1, (long) group_sizze_236201,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238857 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzicopy_236198_runs,
                                                              &ctx->mainzicopy_236198_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzicopy_236198,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      group_sizze_236201,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238856,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238858 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.copy_236198",
                                            time_end_238858 -
                                            time_start_238857);
                                }
                            }
                            
                            struct memblock_device mem_231415;
                            
                            mem_231415.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231415,
                                                      binop_y_229534,
                                                      "mem_231415")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231418;
                            
                            mem_231418.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231418,
                                                      binop_y_229534,
                                                      "mem_231418")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232160;
                            
                            color_232160.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232160,
                                                      total_sizze_232316,
                                                      "color_232160")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232161;
                            
                            color_232161.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232161,
                                                      total_sizze_232317,
                                                      "color_232161")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232162;
                            
                            color_232162.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232162,
                                                      total_sizze_232318,
                                                      "color_232162")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232163;
                            
                            color_232163.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232163,
                                                      total_sizze_232319,
                                                      "color_232163")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238864 = mem_229269.mem;
                            CUdeviceptr kernel_arg_238865 = ext_mem_229304.mem;
                            CUdeviceptr kernel_arg_238866 = mem_231324.mem;
                            CUdeviceptr kernel_arg_238867 = mem_231327.mem;
                            CUdeviceptr kernel_arg_238868 = mem_231330.mem;
                            CUdeviceptr kernel_arg_238869 = mem_231333.mem;
                            CUdeviceptr kernel_arg_238870 = mem_231336.mem;
                            CUdeviceptr kernel_arg_238871 = mem_231415.mem;
                            CUdeviceptr kernel_arg_238872 = mem_231418.mem;
                            CUdeviceptr kernel_arg_238873 = color_232160.mem;
                            CUdeviceptr kernel_arg_238874 = color_232161.mem;
                            CUdeviceptr kernel_arg_238875 = color_232162.mem;
                            CUdeviceptr kernel_arg_238876 = color_232163.mem;
                            
                            if ((((((1 && num_groups_224614 != 0) && 1 != 0) &&
                                   1 != 0) && segmap_group_sizze_224613 != 0) &&
                                 1 != 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = num_groups_224614;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238861[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203572,
                                      &q_t_203576, &jump_t_203582,
                                      &partition_sizze_203667, &t_n_m_203740,
                                      &i_203760, &num_groups_224614,
                                      &num_threads_232315, &kernel_arg_238864,
                                      &kernel_arg_238865, &kernel_arg_238866,
                                      &kernel_arg_238867, &kernel_arg_238868,
                                      &kernel_arg_238869, &kernel_arg_238870,
                                      &kernel_arg_238871, &kernel_arg_238872,
                                      &kernel_arg_238873, &kernel_arg_238874,
                                      &kernel_arg_238875, &kernel_arg_238876};
                                int64_t time_start_238862 = 0, time_end_238863 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_224619",
                                            (long) num_groups_224614, (long) 1,
                                            (long) 1,
                                            (long) segmap_group_sizze_224613,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238862 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_224619_runs,
                                                              &ctx->mainzisegmap_224619_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_224619,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_224613,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238861,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238863 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_224619",
                                            time_end_238863 -
                                            time_start_238862);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231327,
                                                      "mem_231327") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231330,
                                                      "mem_231330") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231333,
                                                      "mem_231333") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231336,
                                                      "mem_231336") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232160,
                                                      "color_232160") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232161,
                                                      "color_232161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232162,
                                                      "color_232162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232163,
                                                      "color_232163") != 0)
                                return 1;
                            
                            struct memblock_device mem_231498;
                            
                            mem_231498.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231498,
                                                      bytes_229535,
                                                      "mem_231498")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231498,
                                                                      (int64_t) 0,
                                                                      mem_231415,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231498,
                                                          "mem_231498") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232163,
                                                          "color_232163") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232162,
                                                          "color_232162") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232161,
                                                          "color_232161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232160,
                                                          "color_232160") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231418,
                                                          "mem_231418") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231415,
                                                          "mem_231415") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231336,
                                                          "mem_231336") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231415,
                                                      "mem_231415") != 0)
                                return 1;
                            
                            struct memblock_device mem_231503;
                            
                            mem_231503.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231503,
                                                      bytes_229535,
                                                      "mem_231503")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231503,
                                                                      (int64_t) 0,
                                                                      mem_231418,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203667,
                                                                      t_n_m_203740) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231503,
                                                          "mem_231503") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231498,
                                                          "mem_231498") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232163,
                                                          "color_232163") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232162,
                                                          "color_232162") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232161,
                                                          "color_232161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232160,
                                                          "color_232160") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231418,
                                                          "mem_231418") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231415,
                                                          "mem_231415") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231336,
                                                          "mem_231336") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231330,
                                                          "mem_231330") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231327,
                                                          "mem_231327") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231324,
                                                          "mem_231324") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231506,
                                                          "ext_mem_231506") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231507,
                                                          "ext_mem_231507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231508,
                                                          "ext_mem_231508") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231509,
                                                          "ext_mem_231509") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231510,
                                                          "ext_mem_231510") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231612,
                                                          "ext_mem_231612") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231613,
                                                          "ext_mem_231613") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231028,
                                                          "mem_231028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231022,
                                                          "ext_mem_231022") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231015,
                                                          "ext_mem_231015") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231016,
                                                          "ext_mem_231016") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230654,
                                                          "ext_mem_230654") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230637,
                                                          "ext_mem_230637") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230620,
                                                          "ext_mem_230620") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230602,
                                                          "ext_mem_230602") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230594,
                                                          "ext_mem_230594") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230595,
                                                          "ext_mem_230595") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229623,
                                                          "mem_param_229623") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229615,
                                                          "mem_param_229615") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231625,
                                                          "ext_mem_231625") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231626,
                                                          "ext_mem_231626") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229601,
                                                          "mem_param_229601") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229593,
                                                          "mem_param_229593") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229585,
                                                          "mem_param_229585") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231968,
                                                          "ext_mem_231968") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231969,
                                                          "ext_mem_231969") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231970,
                                                          "ext_mem_231970") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230642,
                                                          "mem_230642") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230608,
                                                          "mem_230608") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229639,
                                                          "mem_229639") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229634,
                                                          "mem_229634") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229577,
                                                          "mem_229577") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229573,
                                                          "mem_229573") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229568,
                                                          "ext_mem_229568") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229569,
                                                          "ext_mem_229569") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229519,
                                                          "ext_mem_229519") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229520,
                                                          "ext_mem_229520") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229470,
                                                          "ext_mem_229470") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229471,
                                                          "ext_mem_229471") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229372,
                                                          "ext_mem_229372") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229373,
                                                          "ext_mem_229373") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229314,
                                                          "mem_229314") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229308,
                                                          "mem_229308") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229304,
                                                          "ext_mem_229304") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229305,
                                                          "ext_mem_229305") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229272,
                                                          "mem_229272") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229269,
                                                          "mem_229269") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232074,
                                                          "color_232074") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229265,
                                                          "mem_229265") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229263,
                                                          "mem_229263") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229260,
                                                          "mem_229260") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229242,
                                                          "mem_229242") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232361,
                                                          "mem_out_232361") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232360,
                                                          "mem_out_232360") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232359,
                                                          "mem_out_232359") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231418,
                                                      "mem_231418") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231506,
                                                    &mem_231498,
                                                    "mem_231498") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231505,
                                                    &mem_231503,
                                                    "mem_231503") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231503,
                                                      "mem_231503") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231498,
                                                      "mem_231498") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232163,
                                                      "color_232163") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232162,
                                                      "color_232162") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232161,
                                                      "color_232161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232160,
                                                      "color_232160") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231418,
                                                      "mem_231418") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231415,
                                                      "mem_231415") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231336,
                                                      "mem_231336") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231333,
                                                      "mem_231333") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231330,
                                                      "mem_231330") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231327,
                                                      "mem_231327") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_225413 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_225412);
                            struct memblock_device mem_231423;
                            
                            mem_231423.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231423,
                                                      bytes_229285,
                                                      "mem_231423")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238880 = mem_229269.mem;
                            CUdeviceptr kernel_arg_238881 = mem_231028.mem;
                            CUdeviceptr kernel_arg_238882 = mem_231423.mem;
                            
                            if ((((((1 && segmap_usable_groups_225413 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_225412 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_225413;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238877[] =
                                     {&ctx->global_failure, &n_203572,
                                      &partition_sizze_203667,
                                      &kernel_arg_238880, &kernel_arg_238881,
                                      &kernel_arg_238882};
                                int64_t time_start_238878 = 0, time_end_238879 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_225417",
                                            (long) segmap_usable_groups_225413,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_225412,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238878 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_225417_runs,
                                                              &ctx->mainzisegmap_225417_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225417,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_225412,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238877,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238879 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_225417",
                                            time_end_238879 -
                                            time_start_238878);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_225429 =
                                    sdiv_up64(nest_sizze_207090,
                                              segmap_group_sizze_225428);
                            struct memblock_device mem_231428;
                            
                            mem_231428.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231428,
                                                      bytes_229285,
                                                      "mem_231428")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231432;
                            
                            mem_231432.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231432,
                                                      bytes_229285,
                                                      "mem_231432")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_238886 = ext_mem_229305.mem;
                            CUdeviceptr kernel_arg_238887 =
                                        mem_param_229601.mem;
                            CUdeviceptr kernel_arg_238888 = mem_231423.mem;
                            CUdeviceptr kernel_arg_238889 = mem_231428.mem;
                            CUdeviceptr kernel_arg_238890 = mem_231432.mem;
                            
                            if ((((((1 && segmap_usable_groups_225429 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_225428 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_225429;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_238883[] =
                                     {&ctx->global_failure,
                                      &ctx->failure_is_an_option,
                                      &ctx->global_failure_args, &n_203572,
                                      &partition_sizze_203667,
                                      &ctx_param_ext_229596,
                                      &ctx_param_ext_229597,
                                      &ctx_param_ext_229599, &kernel_arg_238886,
                                      &kernel_arg_238887, &kernel_arg_238888,
                                      &kernel_arg_238889, &kernel_arg_238890};
                                int64_t time_start_238884 = 0, time_end_238885 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_225434",
                                            (long) segmap_usable_groups_225429,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_225428,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_238884 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_225434_runs,
                                                              &ctx->mainzisegmap_225434_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225434,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_225428,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_238883,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_238885 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_225434",
                                            time_end_238885 -
                                            time_start_238884);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231423,
                                                      "mem_231423") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_225454 =
                                    sdiv_up64(nest_sizze_210208,
                                              segmap_group_sizze_225453);
                            struct memblock_device ext_mem_231494;
                            
                            ext_mem_231494.references = NULL;
                            
                            struct memblock_device ext_mem_231493;
                            
                            ext_mem_231493.references = NULL;
                            
                            int32_t local_memory_capacity_236498;
                            
                            local_memory_capacity_236498 =
                                ctx->cuda.max_shared_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_236498)) &&
                                suff_outer_par_225457) {
                                struct memblock_device mem_231437;
                                
                                mem_231437.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231437,
                                                          bytes_229535,
                                                          "mem_231437")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231441;
                                
                                mem_231441.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231441,
                                                          bytes_229535,
                                                          "mem_231441")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238894 =
                                            ext_mem_229304.mem;
                                CUdeviceptr kernel_arg_238895 =
                                            ext_mem_229305.mem;
                                CUdeviceptr kernel_arg_238896 =
                                            ext_mem_229568.mem;
                                CUdeviceptr kernel_arg_238897 =
                                            ext_mem_229569.mem;
                                CUdeviceptr kernel_arg_238898 = mem_231428.mem;
                                CUdeviceptr kernel_arg_238899 = mem_231432.mem;
                                CUdeviceptr kernel_arg_238900 = mem_231437.mem;
                                CUdeviceptr kernel_arg_238901 = mem_231441.mem;
                                
                                if ((((((1 && segmap_usable_groups_225454 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_225453 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_225454;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238891[] =
                                         {&ctx->global_failure, &n_203572,
                                          &q_t_203576, &jump_t_203582,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &i_203760,
                                          &kernel_arg_238894,
                                          &kernel_arg_238895,
                                          &kernel_arg_238896,
                                          &kernel_arg_238897,
                                          &kernel_arg_238898,
                                          &kernel_arg_238899,
                                          &kernel_arg_238900,
                                          &kernel_arg_238901};
                                    int64_t time_start_238892 = 0,
                                            time_end_238893 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_225464",
                                                (long) segmap_usable_groups_225454,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_225453,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238892 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_225464_runs,
                                                                  &ctx->mainzisegmap_225464_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225464,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_225453,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238891,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238893 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_225464",
                                                time_end_238893 -
                                                time_start_238892);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231494,
                                                        &mem_231437,
                                                        "mem_231437") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231493,
                                                        &mem_231441,
                                                        "mem_231441") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231441,
                                                          "mem_231441") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231437,
                                                          "mem_231437") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231446;
                                
                                mem_231446.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231446,
                                                          bytes_229535,
                                                          "mem_231446")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231450;
                                
                                mem_231450.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231450,
                                                          bytes_229535,
                                                          "mem_231450")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231454;
                                
                                mem_231454.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231454,
                                                          bytes_229535,
                                                          "mem_231454")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231458;
                                
                                mem_231458.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231458,
                                                          bytes_229535,
                                                          "mem_231458")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231462;
                                
                                mem_231462.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231462,
                                                          bytes_229535,
                                                          "mem_231462")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_225602)) {
                                    int64_t segment_sizze_nonzzero_236274 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_236275 =
                                            num_groups_225603 *
                                            segred_group_sizze_225602;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225602,
                                                                    segment_sizze_nonzzero_236274),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_225602,
                                                                                           segment_sizze_nonzzero_236274))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238905 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238907 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238909 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238911 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238913 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    CUdeviceptr kernel_arg_238915 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238916 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238917 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238918 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238919 =
                                                mem_231428.mem;
                                    CUdeviceptr kernel_arg_238920 =
                                                mem_231446.mem;
                                    CUdeviceptr kernel_arg_238921 =
                                                mem_231450.mem;
                                    CUdeviceptr kernel_arg_238922 =
                                                mem_231454.mem;
                                    CUdeviceptr kernel_arg_238923 =
                                                mem_231458.mem;
                                    CUdeviceptr kernel_arg_238924 =
                                                mem_231462.mem;
                                    unsigned int shared_offset_238906 = 0;
                                    unsigned int shared_offset_238908 = 0 +
                                                 (shared_sizze_238905 + (8 -
                                                                         shared_sizze_238905 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238910 = 0 +
                                                 (shared_sizze_238905 + (8 -
                                                                         shared_sizze_238905 %
                                                                         8) %
                                                  8) + (shared_sizze_238907 +
                                                        (8 -
                                                         shared_sizze_238907 %
                                                         8) % 8);
                                    unsigned int shared_offset_238912 = 0 +
                                                 (shared_sizze_238905 + (8 -
                                                                         shared_sizze_238905 %
                                                                         8) %
                                                  8) + (shared_sizze_238907 +
                                                        (8 -
                                                         shared_sizze_238907 %
                                                         8) % 8) +
                                                 (shared_sizze_238909 + (8 -
                                                                         shared_sizze_238909 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238914 = 0 +
                                                 (shared_sizze_238905 + (8 -
                                                                         shared_sizze_238905 %
                                                                         8) %
                                                  8) + (shared_sizze_238907 +
                                                        (8 -
                                                         shared_sizze_238907 %
                                                         8) % 8) +
                                                 (shared_sizze_238909 + (8 -
                                                                         shared_sizze_238909 %
                                                                         8) %
                                                  8) + (shared_sizze_238911 +
                                                        (8 -
                                                         shared_sizze_238911 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_225603 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225602 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_225603;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238902[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238906,
                                              &shared_offset_238908,
                                              &shared_offset_238910,
                                              &shared_offset_238912,
                                              &shared_offset_238914, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_225603,
                                              &segment_sizze_nonzzero_236274,
                                              &kernel_arg_238915,
                                              &kernel_arg_238916,
                                              &kernel_arg_238917,
                                              &kernel_arg_238918,
                                              &kernel_arg_238919,
                                              &kernel_arg_238920,
                                              &kernel_arg_238921,
                                              &kernel_arg_238922,
                                              &kernel_arg_238923,
                                              &kernel_arg_238924};
                                        int64_t time_start_238903 = 0,
                                                time_end_238904 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_225613",
                                                    (long) num_groups_225603,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225602,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238905 +
                                                            (8 -
                                                             shared_sizze_238905 %
                                                             8) % 8) +
                                                           (shared_sizze_238907 +
                                                            (8 -
                                                             shared_sizze_238907 %
                                                             8) % 8) +
                                                           (shared_sizze_238909 +
                                                            (8 -
                                                             shared_sizze_238909 %
                                                             8) % 8) +
                                                           (shared_sizze_238911 +
                                                            (8 -
                                                             shared_sizze_238911 %
                                                             8) % 8) +
                                                           (shared_sizze_238913 +
                                                            (8 -
                                                             shared_sizze_238913 %
                                                             8) % 8)));
                                            time_start_238903 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_225613_runs,
                                                                &ctx->mainzisegred_small_225613_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_225613,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225602,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238905 +
                                                                               (8 -
                                                                                shared_sizze_238905 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238907 +
                                                                               (8 -
                                                                                shared_sizze_238907 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238909 +
                                                                               (8 -
                                                                                shared_sizze_238909 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238911 +
                                                                               (8 -
                                                                                shared_sizze_238911 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238913 +
                                                                               (8 -
                                                                                shared_sizze_238913 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238902,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238904 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225613",
                                                    time_end_238904 -
                                                    time_start_238903);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236327 =
                                            sdiv_up64(num_groups_225603,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_236328 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_225602 *
                                                      groups_per_segment_236327);
                                    int64_t virt_num_groups_236329 =
                                            groups_per_segment_236327 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_236330 =
                                            num_groups_225603 *
                                            segred_group_sizze_225602;
                                    int64_t threads_per_segment_236331 =
                                            groups_per_segment_236327 *
                                            segred_group_sizze_225602;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236329,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225603,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225602,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236328,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236327,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236332;
                                    
                                    segred_tmp_mem_236332.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236332,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236329,
                                                              "segred_tmp_mem_236332")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236334;
                                    
                                    segred_tmp_mem_236334.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236334,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236329,
                                                              "segred_tmp_mem_236334")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236336;
                                    
                                    segred_tmp_mem_236336.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236336,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236329,
                                                              "segred_tmp_mem_236336")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236338;
                                    
                                    segred_tmp_mem_236338.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236338,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236329,
                                                              "segred_tmp_mem_236338")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236340;
                                    
                                    segred_tmp_mem_236340.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236340,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236329,
                                                              "segred_tmp_mem_236340")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236342 =
                                    ctx->mainzicounter_mem_236342;
                                    unsigned int shared_sizze_238929 = 1;
                                    unsigned int shared_sizze_238931 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238933 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238935 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238937 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    unsigned int shared_sizze_238939 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225602;
                                    CUdeviceptr kernel_arg_238941 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238942 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238943 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238944 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238945 =
                                                mem_231428.mem;
                                    CUdeviceptr kernel_arg_238946 =
                                                mem_231446.mem;
                                    CUdeviceptr kernel_arg_238947 =
                                                mem_231450.mem;
                                    CUdeviceptr kernel_arg_238948 =
                                                mem_231454.mem;
                                    CUdeviceptr kernel_arg_238949 =
                                                mem_231458.mem;
                                    CUdeviceptr kernel_arg_238950 =
                                                mem_231462.mem;
                                    CUdeviceptr kernel_arg_238951 =
                                                segred_tmp_mem_236332.mem;
                                    CUdeviceptr kernel_arg_238952 =
                                                segred_tmp_mem_236334.mem;
                                    CUdeviceptr kernel_arg_238953 =
                                                segred_tmp_mem_236336.mem;
                                    CUdeviceptr kernel_arg_238954 =
                                                segred_tmp_mem_236338.mem;
                                    CUdeviceptr kernel_arg_238955 =
                                                segred_tmp_mem_236340.mem;
                                    CUdeviceptr kernel_arg_238956 =
                                                mainzicounter_mem_236342.mem;
                                    unsigned int shared_offset_238930 = 0;
                                    unsigned int shared_offset_238932 = 0 +
                                                 (shared_sizze_238929 + (8 -
                                                                         shared_sizze_238929 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238934 = 0 +
                                                 (shared_sizze_238929 + (8 -
                                                                         shared_sizze_238929 %
                                                                         8) %
                                                  8) + (shared_sizze_238931 +
                                                        (8 -
                                                         shared_sizze_238931 %
                                                         8) % 8);
                                    unsigned int shared_offset_238936 = 0 +
                                                 (shared_sizze_238929 + (8 -
                                                                         shared_sizze_238929 %
                                                                         8) %
                                                  8) + (shared_sizze_238931 +
                                                        (8 -
                                                         shared_sizze_238931 %
                                                         8) % 8) +
                                                 (shared_sizze_238933 + (8 -
                                                                         shared_sizze_238933 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238938 = 0 +
                                                 (shared_sizze_238929 + (8 -
                                                                         shared_sizze_238929 %
                                                                         8) %
                                                  8) + (shared_sizze_238931 +
                                                        (8 -
                                                         shared_sizze_238931 %
                                                         8) % 8) +
                                                 (shared_sizze_238933 + (8 -
                                                                         shared_sizze_238933 %
                                                                         8) %
                                                  8) + (shared_sizze_238935 +
                                                        (8 -
                                                         shared_sizze_238935 %
                                                         8) % 8);
                                    unsigned int shared_offset_238940 = 0 +
                                                 (shared_sizze_238929 + (8 -
                                                                         shared_sizze_238929 %
                                                                         8) %
                                                  8) + (shared_sizze_238931 +
                                                        (8 -
                                                         shared_sizze_238931 %
                                                         8) % 8) +
                                                 (shared_sizze_238933 + (8 -
                                                                         shared_sizze_238933 %
                                                                         8) %
                                                  8) + (shared_sizze_238935 +
                                                        (8 -
                                                         shared_sizze_238935 %
                                                         8) % 8) +
                                                 (shared_sizze_238937 + (8 -
                                                                         shared_sizze_238937 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_225603 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225602 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_225603;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238926[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238930,
                                              &shared_offset_238932,
                                              &shared_offset_238934,
                                              &shared_offset_238936,
                                              &shared_offset_238938,
                                              &shared_offset_238940, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_225603,
                                              &groups_per_segment_236327,
                                              &elements_per_thread_236328,
                                              &virt_num_groups_236329,
                                              &threads_per_segment_236331,
                                              &kernel_arg_238941,
                                              &kernel_arg_238942,
                                              &kernel_arg_238943,
                                              &kernel_arg_238944,
                                              &kernel_arg_238945,
                                              &kernel_arg_238946,
                                              &kernel_arg_238947,
                                              &kernel_arg_238948,
                                              &kernel_arg_238949,
                                              &kernel_arg_238950,
                                              &kernel_arg_238951,
                                              &kernel_arg_238952,
                                              &kernel_arg_238953,
                                              &kernel_arg_238954,
                                              &kernel_arg_238955,
                                              &kernel_arg_238956};
                                        int64_t time_start_238927 = 0,
                                                time_end_238928 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_225613",
                                                    (long) num_groups_225603,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225602,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238929 +
                                                            (8 -
                                                             shared_sizze_238929 %
                                                             8) % 8) +
                                                           (shared_sizze_238931 +
                                                            (8 -
                                                             shared_sizze_238931 %
                                                             8) % 8) +
                                                           (shared_sizze_238933 +
                                                            (8 -
                                                             shared_sizze_238933 %
                                                             8) % 8) +
                                                           (shared_sizze_238935 +
                                                            (8 -
                                                             shared_sizze_238935 %
                                                             8) % 8) +
                                                           (shared_sizze_238937 +
                                                            (8 -
                                                             shared_sizze_238937 %
                                                             8) % 8) +
                                                           (shared_sizze_238939 +
                                                            (8 -
                                                             shared_sizze_238939 %
                                                             8) % 8)));
                                            time_start_238927 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_225613_runs,
                                                                &ctx->mainzisegred_large_225613_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_225613,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225602,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238929 +
                                                                               (8 -
                                                                                shared_sizze_238929 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238931 +
                                                                               (8 -
                                                                                shared_sizze_238931 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238933 +
                                                                               (8 -
                                                                                shared_sizze_238933 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238935 +
                                                                               (8 -
                                                                                shared_sizze_238935 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238937 +
                                                                               (8 -
                                                                                shared_sizze_238937 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238939 +
                                                                               (8 -
                                                                                shared_sizze_238939 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238926,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238928 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225613",
                                                    time_end_238928 -
                                                    time_start_238927);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236340,
                                                              "segred_tmp_mem_236340") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236338,
                                                              "segred_tmp_mem_236338") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236336,
                                                              "segred_tmp_mem_236336") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236334,
                                                              "segred_tmp_mem_236334") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236332,
                                                              "segred_tmp_mem_236332") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_225664 =
                                        sdiv_up64(nest_sizze_210208,
                                                  segmap_group_sizze_225663);
                                struct memblock_device mem_231467;
                                
                                mem_231467.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231467,
                                                          bytes_229535,
                                                          "mem_231467")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231471;
                                
                                mem_231471.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231471,
                                                          bytes_229535,
                                                          "mem_231471")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231475;
                                
                                mem_231475.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231475,
                                                          bytes_229535,
                                                          "mem_231475")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231479;
                                
                                mem_231479.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231479,
                                                          bytes_229535,
                                                          "mem_231479")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231483;
                                
                                mem_231483.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231483,
                                                          bytes_229535,
                                                          "mem_231483")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                
                                CUdeviceptr kernel_arg_238960 = mem_231446.mem;
                                CUdeviceptr kernel_arg_238961 = mem_231450.mem;
                                CUdeviceptr kernel_arg_238962 = mem_231454.mem;
                                CUdeviceptr kernel_arg_238963 = mem_231458.mem;
                                CUdeviceptr kernel_arg_238964 = mem_231462.mem;
                                CUdeviceptr kernel_arg_238965 = mem_231467.mem;
                                CUdeviceptr kernel_arg_238966 = mem_231471.mem;
                                CUdeviceptr kernel_arg_238967 = mem_231475.mem;
                                CUdeviceptr kernel_arg_238968 = mem_231479.mem;
                                CUdeviceptr kernel_arg_238969 = mem_231483.mem;
                                
                                if ((((((1 && segmap_usable_groups_225664 !=
                                         0) && 1 != 0) && 1 != 0) &&
                                      segmap_group_sizze_225663 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] = segmap_usable_groups_225664;
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_238957[] =
                                         {&ctx->global_failure,
                                          &partition_sizze_203667,
                                          &t_n_m_203740, &kernel_arg_238960,
                                          &kernel_arg_238961,
                                          &kernel_arg_238962,
                                          &kernel_arg_238963,
                                          &kernel_arg_238964,
                                          &kernel_arg_238965,
                                          &kernel_arg_238966,
                                          &kernel_arg_238967,
                                          &kernel_arg_238968,
                                          &kernel_arg_238969};
                                    int64_t time_start_238958 = 0,
                                            time_end_238959 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segmap_225672",
                                                (long) segmap_usable_groups_225664,
                                                (long) 1, (long) 1,
                                                (long) segmap_group_sizze_225663,
                                                (long) 1, (long) 1, (int) 0);
                                        time_start_238958 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegmap_225672_runs,
                                                                  &ctx->mainzisegmap_225672_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225672,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segmap_group_sizze_225663,
                                                                          1, 1,
                                                                          0,
                                                                          NULL,
                                                                          kernel_args_238957,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_238959 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segmap_225672",
                                                time_end_238959 -
                                                time_start_238958);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231446,
                                                          "mem_231446") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231450,
                                                          "mem_231450") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231454,
                                                          "mem_231454") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231458,
                                                          "mem_231458") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231462,
                                                          "mem_231462") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231488;
                                
                                mem_231488.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231488,
                                                          bytes_229535,
                                                          "mem_231488")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231492;
                                
                                mem_231492.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231492,
                                                          bytes_229535,
                                                          "mem_231492")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203576 * (int64_t) 2,
                                          segred_group_sizze_225706)) {
                                    int64_t segment_sizze_nonzzero_236412 =
                                            smax64((int64_t) 1, q_t_203576);
                                    int64_t num_threads_236413 =
                                            num_groups_225707 *
                                            segred_group_sizze_225706;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-small");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225706,
                                                                    segment_sizze_nonzzero_236412),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667 *
                                                                                   t_n_m_203740,
                                                                                   squot64(segred_group_sizze_225706,
                                                                                           segment_sizze_nonzzero_236412))),
                                                '\n');
                                    
                                    unsigned int shared_sizze_238973 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225706;
                                    unsigned int shared_sizze_238975 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225706;
                                    CUdeviceptr kernel_arg_238977 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_238978 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_238979 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_238980 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_238981 =
                                                mem_231428.mem;
                                    CUdeviceptr kernel_arg_238982 =
                                                mem_231432.mem;
                                    CUdeviceptr kernel_arg_238983 =
                                                mem_231467.mem;
                                    CUdeviceptr kernel_arg_238984 =
                                                mem_231471.mem;
                                    CUdeviceptr kernel_arg_238985 =
                                                mem_231475.mem;
                                    CUdeviceptr kernel_arg_238986 =
                                                mem_231479.mem;
                                    CUdeviceptr kernel_arg_238987 =
                                                mem_231483.mem;
                                    CUdeviceptr kernel_arg_238988 =
                                                mem_231488.mem;
                                    CUdeviceptr kernel_arg_238989 =
                                                mem_231492.mem;
                                    unsigned int shared_offset_238974 = 0;
                                    unsigned int shared_offset_238976 = 0 +
                                                 (shared_sizze_238973 + (8 -
                                                                         shared_sizze_238973 %
                                                                         8) %
                                                  8);
                                    
                                    if ((((((1 && num_groups_225707 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225706 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_225707;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238970[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238974,
                                              &shared_offset_238976, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_225707,
                                              &segment_sizze_nonzzero_236412,
                                              &kernel_arg_238977,
                                              &kernel_arg_238978,
                                              &kernel_arg_238979,
                                              &kernel_arg_238980,
                                              &kernel_arg_238981,
                                              &kernel_arg_238982,
                                              &kernel_arg_238983,
                                              &kernel_arg_238984,
                                              &kernel_arg_238985,
                                              &kernel_arg_238986,
                                              &kernel_arg_238987,
                                              &kernel_arg_238988,
                                              &kernel_arg_238989};
                                        int64_t time_start_238971 = 0,
                                                time_end_238972 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_small_225714",
                                                    (long) num_groups_225707,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225706,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238973 +
                                                            (8 -
                                                             shared_sizze_238973 %
                                                             8) % 8) +
                                                           (shared_sizze_238975 +
                                                            (8 -
                                                             shared_sizze_238975 %
                                                             8) % 8)));
                                            time_start_238971 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_small_225714_runs,
                                                                &ctx->mainzisegred_small_225714_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_225714,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225706,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238973 +
                                                                               (8 -
                                                                                shared_sizze_238973 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238975 +
                                                                               (8 -
                                                                                shared_sizze_238975 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238970,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238972 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225714",
                                                    time_end_238972 -
                                                    time_start_238971);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236447 =
                                            sdiv_up64(num_groups_225707,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203667 *
                                                             t_n_m_203740));
                                    int64_t elements_per_thread_236448 =
                                            sdiv_up64(q_t_203576,
                                                      segred_group_sizze_225706 *
                                                      groups_per_segment_236447);
                                    int64_t virt_num_groups_236449 =
                                            groups_per_segment_236447 *
                                            (partition_sizze_203667 *
                                             t_n_m_203740);
                                    int64_t num_threads_236450 =
                                            num_groups_225707 *
                                            segred_group_sizze_225706;
                                    int64_t threads_per_segment_236451 =
                                            groups_per_segment_236447 *
                                            segred_group_sizze_225706;
                                    
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n",
                                                "\n# SegRed-large");
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_segments",
                                                (long long) (partition_sizze_203667 *
                                                             t_n_m_203740),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203576, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236449,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225707,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225706,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236448,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236447,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236452;
                                    
                                    segred_tmp_mem_236452.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236452,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236449,
                                                              "segred_tmp_mem_236452")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236454;
                                    
                                    segred_tmp_mem_236454.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236454,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236449,
                                                              "segred_tmp_mem_236454")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236456 =
                                    ctx->mainzicounter_mem_236456;
                                    unsigned int shared_sizze_238994 = 1;
                                    unsigned int shared_sizze_238996 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225706;
                                    unsigned int shared_sizze_238998 =
                                                 (int64_t) 8 *
                                                 segred_group_sizze_225706;
                                    CUdeviceptr kernel_arg_239000 =
                                                ext_mem_229304.mem;
                                    CUdeviceptr kernel_arg_239001 =
                                                ext_mem_229305.mem;
                                    CUdeviceptr kernel_arg_239002 =
                                                ext_mem_229568.mem;
                                    CUdeviceptr kernel_arg_239003 =
                                                ext_mem_229569.mem;
                                    CUdeviceptr kernel_arg_239004 =
                                                mem_231428.mem;
                                    CUdeviceptr kernel_arg_239005 =
                                                mem_231432.mem;
                                    CUdeviceptr kernel_arg_239006 =
                                                mem_231467.mem;
                                    CUdeviceptr kernel_arg_239007 =
                                                mem_231471.mem;
                                    CUdeviceptr kernel_arg_239008 =
                                                mem_231475.mem;
                                    CUdeviceptr kernel_arg_239009 =
                                                mem_231479.mem;
                                    CUdeviceptr kernel_arg_239010 =
                                                mem_231483.mem;
                                    CUdeviceptr kernel_arg_239011 =
                                                mem_231488.mem;
                                    CUdeviceptr kernel_arg_239012 =
                                                mem_231492.mem;
                                    CUdeviceptr kernel_arg_239013 =
                                                segred_tmp_mem_236452.mem;
                                    CUdeviceptr kernel_arg_239014 =
                                                segred_tmp_mem_236454.mem;
                                    CUdeviceptr kernel_arg_239015 =
                                                mainzicounter_mem_236456.mem;
                                    unsigned int shared_offset_238995 = 0;
                                    unsigned int shared_offset_238997 = 0 +
                                                 (shared_sizze_238994 + (8 -
                                                                         shared_sizze_238994 %
                                                                         8) %
                                                  8);
                                    unsigned int shared_offset_238999 = 0 +
                                                 (shared_sizze_238994 + (8 -
                                                                         shared_sizze_238994 %
                                                                         8) %
                                                  8) + (shared_sizze_238996 +
                                                        (8 -
                                                         shared_sizze_238996 %
                                                         8) % 8);
                                    
                                    if ((((((1 && num_groups_225707 != 0) &&
                                            1 != 0) && 1 != 0) &&
                                          segred_group_sizze_225706 != 0) &&
                                         1 != 0) && 1 != 0) {
                                        int perm[3] = {0, 1, 2};
                                        
                                        if (1 >= 1 << 16) {
                                            perm[1] = perm[0];
                                            perm[0] = 1;
                                        }
                                        if (1 >= 1 << 16) {
                                            perm[2] = perm[0];
                                            perm[0] = 2;
                                        }
                                        
                                        size_t grid[3];
                                        
                                        grid[perm[0]] = num_groups_225707;
                                        grid[perm[1]] = 1;
                                        grid[perm[2]] = 1;
                                        
                                        void *kernel_args_238991[] =
                                             {&ctx->global_failure,
                                              &shared_offset_238995,
                                              &shared_offset_238997,
                                              &shared_offset_238999, &n_203572,
                                              &q_t_203576, &jump_t_203582,
                                              &partition_sizze_203667,
                                              &t_n_m_203740, &i_203760,
                                              &num_groups_225707,
                                              &groups_per_segment_236447,
                                              &elements_per_thread_236448,
                                              &virt_num_groups_236449,
                                              &threads_per_segment_236451,
                                              &kernel_arg_239000,
                                              &kernel_arg_239001,
                                              &kernel_arg_239002,
                                              &kernel_arg_239003,
                                              &kernel_arg_239004,
                                              &kernel_arg_239005,
                                              &kernel_arg_239006,
                                              &kernel_arg_239007,
                                              &kernel_arg_239008,
                                              &kernel_arg_239009,
                                              &kernel_arg_239010,
                                              &kernel_arg_239011,
                                              &kernel_arg_239012,
                                              &kernel_arg_239013,
                                              &kernel_arg_239014,
                                              &kernel_arg_239015};
                                        int64_t time_start_238992 = 0,
                                                time_end_238993 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                    "main.segred_large_225714",
                                                    (long) num_groups_225707,
                                                    (long) 1, (long) 1,
                                                    (long) segred_group_sizze_225706,
                                                    (long) 1, (long) 1,
                                                    (int) (0 +
                                                           (shared_sizze_238994 +
                                                            (8 -
                                                             shared_sizze_238994 %
                                                             8) % 8) +
                                                           (shared_sizze_238996 +
                                                            (8 -
                                                             shared_sizze_238996 %
                                                             8) % 8) +
                                                           (shared_sizze_238998 +
                                                            (8 -
                                                             shared_sizze_238998 %
                                                             8) % 8)));
                                            time_start_238992 = get_wall_time();
                                        }
                                        
                                        cudaEvent_t *pevents = NULL;
                                        
                                        if (ctx->profiling &&
                                            !ctx->profiling_paused) {
                                            pevents =
                                                cuda_get_events(&ctx->cuda,
                                                                &ctx->mainzisegred_large_225714_runs,
                                                                &ctx->mainzisegred_large_225714_total_runtime);
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                               0));
                                        }
                                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_225714,
                                                                              grid[0],
                                                                              grid[1],
                                                                              grid[2],
                                                                              segred_group_sizze_225706,
                                                                              1,
                                                                              1,
                                                                              0 +
                                                                              (shared_sizze_238994 +
                                                                               (8 -
                                                                                shared_sizze_238994 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238996 +
                                                                               (8 -
                                                                                shared_sizze_238996 %
                                                                                8) %
                                                                               8) +
                                                                              (shared_sizze_238998 +
                                                                               (8 -
                                                                                shared_sizze_238998 %
                                                                                8) %
                                                                               8),
                                                                              NULL,
                                                                              kernel_args_238991,
                                                                              NULL));
                                        if (pevents != NULL)
                                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                               0));
                                        if (ctx->debugging) {
                                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                            time_end_238993 = get_wall_time();
                                            fprintf(ctx->log,
                                                    "Kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225714",
                                                    time_end_238993 -
                                                    time_start_238992);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236454,
                                                              "segred_tmp_mem_236454") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236452,
                                                              "segred_tmp_mem_236452") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231467,
                                                          "mem_231467") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231471,
                                                          "mem_231471") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231475,
                                                          "mem_231475") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231479,
                                                          "mem_231479") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231483,
                                                          "mem_231483") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231494,
                                                        &mem_231488,
                                                        "mem_231488") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231493,
                                                        &mem_231492,
                                                        "mem_231492") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231492,
                                                          "mem_231492") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231488,
                                                          "mem_231488") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231483,
                                                          "mem_231483") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231479,
                                                          "mem_231479") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231475,
                                                          "mem_231475") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231471,
                                                          "mem_231471") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231467,
                                                          "mem_231467") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231462,
                                                          "mem_231462") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231458,
                                                          "mem_231458") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231454,
                                                          "mem_231454") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231450,
                                                          "mem_231450") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231446,
                                                          "mem_231446") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231428,
                                                      "mem_231428") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231432,
                                                      "mem_231432") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231506,
                                                    &ext_mem_231494,
                                                    "ext_mem_231494") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231505,
                                                    &ext_mem_231493,
                                                    "ext_mem_231493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231493,
                                                      "ext_mem_231493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231494,
                                                      "ext_mem_231494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231432,
                                                      "mem_231432") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231428,
                                                      "mem_231428") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231423,
                                                      "mem_231423") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231508,
                                                &ext_mem_231506,
                                                "ext_mem_231506") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231507,
                                                &ext_mem_231505,
                                                "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231505,
                                                  "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231506,
                                                  "ext_mem_231506") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231510,
                                            &ext_mem_231508,
                                            "ext_mem_231508") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231509,
                                            &ext_mem_231507,
                                            "ext_mem_231507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231507,
                                              "ext_mem_231507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231508,
                                              "ext_mem_231508") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231613, &ext_mem_231510,
                                        "ext_mem_231510") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231612, &ext_mem_231509,
                                        "ext_mem_231509") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231509,
                                          "ext_mem_231509") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231510,
                                          "ext_mem_231510") != 0)
                    return 1;
            } else {
                bool match_lit_206304 = (int64_t) 0 == d_t_203579;
                int64_t binop_y_231531 = (int64_t) 8 * q_t_203576;
                int64_t bytes_231532 = smax64((int64_t) 0, binop_y_231531);
                struct memblock_device ext_mem_231611;
                
                ext_mem_231611.references = NULL;
                
                struct memblock_device ext_mem_231610;
                
                ext_mem_231610.references = NULL;
                if (match_lit_206304) {
                    struct memblock_device mem_231514;
                    
                    mem_231514.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231514, bytes_229535,
                                              "mem_231514")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_231514,
                                                      partition_sizze_203667 *
                                                      t_n_m_203740, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_231514,
                                                  "mem_231514") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231610,
                                                  "ext_mem_231610") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231611,
                                                  "ext_mem_231611") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231612,
                                                  "ext_mem_231612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231613,
                                                  "ext_mem_231613") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231028,
                                                  "mem_231028") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231022,
                                                  "ext_mem_231022") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231015,
                                                  "ext_mem_231015") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231016,
                                                  "ext_mem_231016") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230654,
                                                  "ext_mem_230654") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230637,
                                                  "ext_mem_230637") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230620,
                                                  "ext_mem_230620") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230602,
                                                  "ext_mem_230602") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230594,
                                                  "ext_mem_230594") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230595,
                                                  "ext_mem_230595") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229623,
                                                  "mem_param_229623") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229615,
                                                  "mem_param_229615") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231625,
                                                  "ext_mem_231625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231626,
                                                  "ext_mem_231626") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229601,
                                                  "mem_param_229601") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229593,
                                                  "mem_param_229593") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229585,
                                                  "mem_param_229585") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231968,
                                                  "ext_mem_231968") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231969,
                                                  "ext_mem_231969") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231970,
                                                  "ext_mem_231970") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230659,
                                                  "mem_230659") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230642,
                                                  "mem_230642") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230625,
                                                  "mem_230625") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230608,
                                                  "mem_230608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229639,
                                                  "mem_229639") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229634,
                                                  "mem_229634") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229628,
                                                  "mem_229628") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229577,
                                                  "mem_229577") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229573,
                                                  "mem_229573") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229568,
                                                  "ext_mem_229568") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229569,
                                                  "ext_mem_229569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229519,
                                                  "ext_mem_229519") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229520,
                                                  "ext_mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229470,
                                                  "ext_mem_229470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229471,
                                                  "ext_mem_229471") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229372,
                                                  "ext_mem_229372") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229373,
                                                  "ext_mem_229373") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229314,
                                                  "mem_229314") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229308,
                                                  "mem_229308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229304,
                                                  "ext_mem_229304") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229305,
                                                  "ext_mem_229305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229272,
                                                  "mem_229272") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229269,
                                                  "mem_229269") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232074,
                                                  "color_232074") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229265,
                                                  "mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229263,
                                                  "mem_229263") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229260,
                                                  "mem_229260") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229242,
                                                  "mem_229242") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232361,
                                                  "mem_out_232361") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232360,
                                                  "mem_out_232360") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232359,
                                                  "mem_out_232359") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_group_sizze_225958;
                    
                    segmap_group_sizze_225958 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225932;
                    
                    int64_t segmap_usable_groups_225959 =
                            sdiv_up64(nest_sizze_207090,
                                      segmap_group_sizze_225958);
                    struct memblock_device mem_231519;
                    
                    mem_231519.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231519, bytes_229285,
                                              "mem_231519")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_239019 = mem_229269.mem;
                    CUdeviceptr kernel_arg_239020 = mem_231028.mem;
                    CUdeviceptr kernel_arg_239021 = mem_231519.mem;
                    
                    if ((((((1 && segmap_usable_groups_225959 != 0) && 1 !=
                            0) && 1 != 0) && segmap_group_sizze_225958 != 0) &&
                         1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = segmap_usable_groups_225959;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239016[] = {&ctx->global_failure,
                                                      &n_203572,
                                                      &partition_sizze_203667,
                                                      &kernel_arg_239019,
                                                      &kernel_arg_239020,
                                                      &kernel_arg_239021};
                        int64_t time_start_239017 = 0, time_end_239018 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segmap_225963",
                                    (long) segmap_usable_groups_225959,
                                    (long) 1, (long) 1,
                                    (long) segmap_group_sizze_225958, (long) 1,
                                    (long) 1, (int) 0);
                            time_start_239017 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_225963_runs,
                                                      &ctx->mainzisegmap_225963_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225963,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_225958,
                                                              1, 1, 0, NULL,
                                                              kernel_args_239016,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239018 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_225963", time_end_239018 -
                                    time_start_239017);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_group_sizze_225974;
                    
                    segmap_group_sizze_225974 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225876;
                    
                    int64_t segmap_usable_groups_225975 =
                            sdiv_up64(nest_sizze_207090,
                                      segmap_group_sizze_225974);
                    struct memblock_device mem_231524;
                    
                    mem_231524.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231524, bytes_229285,
                                              "mem_231524")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_231528;
                    
                    mem_231528.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231528, bytes_229285,
                                              "mem_231528")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    CUdeviceptr kernel_arg_239025 = ext_mem_229305.mem;
                    CUdeviceptr kernel_arg_239026 = mem_param_229601.mem;
                    CUdeviceptr kernel_arg_239027 = mem_231519.mem;
                    CUdeviceptr kernel_arg_239028 = mem_231524.mem;
                    CUdeviceptr kernel_arg_239029 = mem_231528.mem;
                    
                    if ((((((1 && segmap_usable_groups_225975 != 0) && 1 !=
                            0) && 1 != 0) && segmap_group_sizze_225974 != 0) &&
                         1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = segmap_usable_groups_225975;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239022[] = {&ctx->global_failure,
                                                      &ctx->failure_is_an_option,
                                                      &ctx->global_failure_args,
                                                      &n_203572,
                                                      &partition_sizze_203667,
                                                      &ctx_param_ext_229596,
                                                      &ctx_param_ext_229597,
                                                      &ctx_param_ext_229599,
                                                      &kernel_arg_239025,
                                                      &kernel_arg_239026,
                                                      &kernel_arg_239027,
                                                      &kernel_arg_239028,
                                                      &kernel_arg_239029};
                        int64_t time_start_239023 = 0, time_end_239024 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segmap_225980",
                                    (long) segmap_usable_groups_225975,
                                    (long) 1, (long) 1,
                                    (long) segmap_group_sizze_225974, (long) 1,
                                    (long) 1, (int) 0);
                            time_start_239023 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_225980_runs,
                                                      &ctx->mainzisegmap_225980_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_225980,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segmap_group_sizze_225974,
                                                              1, 1, 0, NULL,
                                                              kernel_args_239022,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239024 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_225980", time_end_239024 -
                                    time_start_239023);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231519, "mem_231519") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_231538;
                    
                    mem_231538.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231538, bytes_229535,
                                              "mem_231538")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_239033 = (int64_t) 8 * q_t_203576;
                    unsigned int shared_sizze_239035 = (int64_t) 8 * q_t_203576;
                    unsigned int shared_sizze_239037 = bytes_231532;
                    CUdeviceptr kernel_arg_239039 = ext_mem_229304.mem;
                    CUdeviceptr kernel_arg_239040 = ext_mem_229305.mem;
                    CUdeviceptr kernel_arg_239041 = ext_mem_229568.mem;
                    CUdeviceptr kernel_arg_239042 = ext_mem_229569.mem;
                    CUdeviceptr kernel_arg_239043 = mem_231524.mem;
                    CUdeviceptr kernel_arg_239044 = mem_231528.mem;
                    CUdeviceptr kernel_arg_239045 = mem_231538.mem;
                    unsigned int shared_offset_239034 = 0;
                    unsigned int shared_offset_239036 = 0 +
                                 (shared_sizze_239033 + (8 -
                                                         shared_sizze_239033 %
                                                         8) % 8);
                    unsigned int shared_offset_239038 = 0 +
                                 (shared_sizze_239033 + (8 -
                                                         shared_sizze_239033 %
                                                         8) % 8) +
                                 (shared_sizze_239035 + (8 -
                                                         shared_sizze_239035 %
                                                         8) % 8);
                    
                    if ((((((1 && nest_sizze_210208 != 0) && 1 != 0) && 1 !=
                           0) && q_t_203576 != 0) && 1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = nest_sizze_210208;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239030[] = {&ctx->global_failure,
                                                      &shared_offset_239034,
                                                      &shared_offset_239036,
                                                      &shared_offset_239038,
                                                      &n_203572, &q_t_203576,
                                                      &jump_t_203582,
                                                      &partition_sizze_203667,
                                                      &t_n_m_203740, &i_203760,
                                                      &kernel_arg_239039,
                                                      &kernel_arg_239040,
                                                      &kernel_arg_239041,
                                                      &kernel_arg_239042,
                                                      &kernel_arg_239043,
                                                      &kernel_arg_239044,
                                                      &kernel_arg_239045};
                        int64_t time_start_239031 = 0, time_end_239032 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segmap_intragroup_226007",
                                    (long) nest_sizze_210208, (long) 1,
                                    (long) 1, (long) q_t_203576, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_239033 +
                                                          (8 -
                                                           shared_sizze_239033 %
                                                           8) % 8) +
                                                     (shared_sizze_239035 + (8 -
                                                                             shared_sizze_239035 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_239037 + (8 -
                                                                             shared_sizze_239037 %
                                                                             8) %
                                                      8)));
                            time_start_239031 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_226007_runs,
                                                      &ctx->mainzisegmap_intragroup_226007_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_226007,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              q_t_203576, 1, 1,
                                                              0 +
                                                              (shared_sizze_239033 +
                                                               (8 -
                                                                shared_sizze_239033 %
                                                                8) % 8) +
                                                              (shared_sizze_239035 +
                                                               (8 -
                                                                shared_sizze_239035 %
                                                                8) % 8) +
                                                              (shared_sizze_239037 +
                                                               (8 -
                                                                shared_sizze_239037 %
                                                                8) % 8), NULL,
                                                              kernel_args_239030,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239032 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_226007",
                                    time_end_239032 - time_start_239031);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231524, "mem_231524") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231528, "mem_231528") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231611, &mem_231538,
                                            "mem_231538") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231610, &mem_231514,
                                            "mem_231514") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231538, "mem_231538") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231528, "mem_231528") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231524, "mem_231524") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231519, "mem_231519") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231514, "mem_231514") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_206381 = (int64_t) 1 == d_t_203579;
                    struct memblock_device ext_mem_231609;
                    
                    ext_mem_231609.references = NULL;
                    
                    struct memblock_device ext_mem_231608;
                    
                    ext_mem_231608.references = NULL;
                    if (match_lit_206381) {
                        int64_t segmap_group_sizze_226270;
                        
                        segmap_group_sizze_226270 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226244;
                        
                        int64_t segmap_usable_groups_226271 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226270);
                        struct memblock_device mem_231543;
                        
                        mem_231543.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231543,
                                                  bytes_229285, "mem_231543")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_239049 = mem_229269.mem;
                        CUdeviceptr kernel_arg_239050 = mem_231028.mem;
                        CUdeviceptr kernel_arg_239051 = mem_231543.mem;
                        
                        if ((((((1 && segmap_usable_groups_226271 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226270 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = segmap_usable_groups_226271;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_239046[] = {&ctx->global_failure,
                                                          &n_203572,
                                                          &partition_sizze_203667,
                                                          &kernel_arg_239049,
                                                          &kernel_arg_239050,
                                                          &kernel_arg_239051};
                            int64_t time_start_239047 = 0, time_end_239048 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_226275",
                                        (long) segmap_usable_groups_226271,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226270,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_239047 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226275_runs,
                                                          &ctx->mainzisegmap_226275_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226275,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226270,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_239046,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_239048 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226275", time_end_239048 -
                                        time_start_239047);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226286;
                        
                        segmap_group_sizze_226286 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226188;
                        
                        int64_t segmap_usable_groups_226287 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226286);
                        struct memblock_device mem_231548;
                        
                        mem_231548.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231548,
                                                  bytes_229285, "mem_231548")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231552;
                        
                        mem_231552.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231552,
                                                  bytes_229285, "mem_231552")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_239055 = ext_mem_229305.mem;
                        CUdeviceptr kernel_arg_239056 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_239057 = mem_231543.mem;
                        CUdeviceptr kernel_arg_239058 = mem_231548.mem;
                        CUdeviceptr kernel_arg_239059 = mem_231552.mem;
                        
                        if ((((((1 && segmap_usable_groups_226287 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226286 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = segmap_usable_groups_226287;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_239052[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203572,
                                                          &partition_sizze_203667,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_239055,
                                                          &kernel_arg_239056,
                                                          &kernel_arg_239057,
                                                          &kernel_arg_239058,
                                                          &kernel_arg_239059};
                            int64_t time_start_239053 = 0, time_end_239054 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_226292",
                                        (long) segmap_usable_groups_226287,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226286,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_239053 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226292_runs,
                                                          &ctx->mainzisegmap_226292_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226292,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226286,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_239052,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_239054 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226292", time_end_239054 -
                                        time_start_239053);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231543,
                                                  "mem_231543") != 0)
                            return 1;
                        
                        struct memblock_device mem_231565;
                        
                        mem_231565.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231565,
                                                  bytes_229535, "mem_231565")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231569;
                        
                        mem_231569.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231569,
                                                  bytes_229535, "mem_231569")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_239063 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239065 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239067 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239069 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239071 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239073 = bytes_231532;
                        unsigned int shared_sizze_239075 = bytes_231532;
                        CUdeviceptr kernel_arg_239077 = ext_mem_229304.mem;
                        CUdeviceptr kernel_arg_239078 = ext_mem_229305.mem;
                        CUdeviceptr kernel_arg_239079 = ext_mem_229568.mem;
                        CUdeviceptr kernel_arg_239080 = ext_mem_229569.mem;
                        CUdeviceptr kernel_arg_239081 = mem_231548.mem;
                        CUdeviceptr kernel_arg_239082 = mem_231552.mem;
                        CUdeviceptr kernel_arg_239083 = mem_231565.mem;
                        CUdeviceptr kernel_arg_239084 = mem_231569.mem;
                        unsigned int shared_offset_239064 = 0;
                        unsigned int shared_offset_239066 = 0 +
                                     (shared_sizze_239063 + (8 -
                                                             shared_sizze_239063 %
                                                             8) % 8);
                        unsigned int shared_offset_239068 = 0 +
                                     (shared_sizze_239063 + (8 -
                                                             shared_sizze_239063 %
                                                             8) % 8) +
                                     (shared_sizze_239065 + (8 -
                                                             shared_sizze_239065 %
                                                             8) % 8);
                        unsigned int shared_offset_239070 = 0 +
                                     (shared_sizze_239063 + (8 -
                                                             shared_sizze_239063 %
                                                             8) % 8) +
                                     (shared_sizze_239065 + (8 -
                                                             shared_sizze_239065 %
                                                             8) % 8) +
                                     (shared_sizze_239067 + (8 -
                                                             shared_sizze_239067 %
                                                             8) % 8);
                        unsigned int shared_offset_239072 = 0 +
                                     (shared_sizze_239063 + (8 -
                                                             shared_sizze_239063 %
                                                             8) % 8) +
                                     (shared_sizze_239065 + (8 -
                                                             shared_sizze_239065 %
                                                             8) % 8) +
                                     (shared_sizze_239067 + (8 -
                                                             shared_sizze_239067 %
                                                             8) % 8) +
                                     (shared_sizze_239069 + (8 -
                                                             shared_sizze_239069 %
                                                             8) % 8);
                        unsigned int shared_offset_239074 = 0 +
                                     (shared_sizze_239063 + (8 -
                                                             shared_sizze_239063 %
                                                             8) % 8) +
                                     (shared_sizze_239065 + (8 -
                                                             shared_sizze_239065 %
                                                             8) % 8) +
                                     (shared_sizze_239067 + (8 -
                                                             shared_sizze_239067 %
                                                             8) % 8) +
                                     (shared_sizze_239069 + (8 -
                                                             shared_sizze_239069 %
                                                             8) % 8) +
                                     (shared_sizze_239071 + (8 -
                                                             shared_sizze_239071 %
                                                             8) % 8);
                        unsigned int shared_offset_239076 = 0 +
                                     (shared_sizze_239063 + (8 -
                                                             shared_sizze_239063 %
                                                             8) % 8) +
                                     (shared_sizze_239065 + (8 -
                                                             shared_sizze_239065 %
                                                             8) % 8) +
                                     (shared_sizze_239067 + (8 -
                                                             shared_sizze_239067 %
                                                             8) % 8) +
                                     (shared_sizze_239069 + (8 -
                                                             shared_sizze_239069 %
                                                             8) % 8) +
                                     (shared_sizze_239071 + (8 -
                                                             shared_sizze_239071 %
                                                             8) % 8) +
                                     (shared_sizze_239073 + (8 -
                                                             shared_sizze_239073 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_210208 != 0) && 1 != 0) && 1 !=
                               0) && q_t_203576 != 0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = nest_sizze_210208;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_239060[] = {&ctx->global_failure,
                                                          &shared_offset_239064,
                                                          &shared_offset_239066,
                                                          &shared_offset_239068,
                                                          &shared_offset_239070,
                                                          &shared_offset_239072,
                                                          &shared_offset_239074,
                                                          &shared_offset_239076,
                                                          &n_203572,
                                                          &q_t_203576,
                                                          &jump_t_203582,
                                                          &partition_sizze_203667,
                                                          &t_n_m_203740,
                                                          &i_203760,
                                                          &kernel_arg_239077,
                                                          &kernel_arg_239078,
                                                          &kernel_arg_239079,
                                                          &kernel_arg_239080,
                                                          &kernel_arg_239081,
                                                          &kernel_arg_239082,
                                                          &kernel_arg_239083,
                                                          &kernel_arg_239084};
                            int64_t time_start_239061 = 0, time_end_239062 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_intragroup_226320",
                                        (long) nest_sizze_210208, (long) 1,
                                        (long) 1, (long) q_t_203576, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_239063 +
                                                          (8 -
                                                           shared_sizze_239063 %
                                                           8) % 8) +
                                                         (shared_sizze_239065 +
                                                          (8 -
                                                           shared_sizze_239065 %
                                                           8) % 8) +
                                                         (shared_sizze_239067 +
                                                          (8 -
                                                           shared_sizze_239067 %
                                                           8) % 8) +
                                                         (shared_sizze_239069 +
                                                          (8 -
                                                           shared_sizze_239069 %
                                                           8) % 8) +
                                                         (shared_sizze_239071 +
                                                          (8 -
                                                           shared_sizze_239071 %
                                                           8) % 8) +
                                                         (shared_sizze_239073 +
                                                          (8 -
                                                           shared_sizze_239073 %
                                                           8) % 8) +
                                                         (shared_sizze_239075 +
                                                          (8 -
                                                           shared_sizze_239075 %
                                                           8) % 8)));
                                time_start_239061 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_226320_runs,
                                                          &ctx->mainzisegmap_intragroup_226320_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_226320,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_t_203576, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_239063 +
                                                                   (8 -
                                                                    shared_sizze_239063 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239065 +
                                                                   (8 -
                                                                    shared_sizze_239065 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239067 +
                                                                   (8 -
                                                                    shared_sizze_239067 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239069 +
                                                                   (8 -
                                                                    shared_sizze_239069 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239071 +
                                                                   (8 -
                                                                    shared_sizze_239071 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239073 +
                                                                   (8 -
                                                                    shared_sizze_239073 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239075 +
                                                                   (8 -
                                                                    shared_sizze_239075 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_239060,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_239062 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226320",
                                        time_end_239062 - time_start_239061);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231548,
                                                  "mem_231548") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231552,
                                                  "mem_231552") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231609,
                                                &mem_231565, "mem_231565") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231608,
                                                &mem_231569, "mem_231569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231569,
                                                  "mem_231569") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231565,
                                                  "mem_231565") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231552,
                                                  "mem_231552") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231548,
                                                  "mem_231548") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231543,
                                                  "mem_231543") != 0)
                            return 1;
                    } else {
                        int64_t segmap_group_sizze_226674;
                        
                        segmap_group_sizze_226674 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226648;
                        
                        int64_t segmap_usable_groups_226675 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226674);
                        struct memblock_device mem_231574;
                        
                        mem_231574.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231574,
                                                  bytes_229285, "mem_231574")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_239088 = mem_229269.mem;
                        CUdeviceptr kernel_arg_239089 = mem_231028.mem;
                        CUdeviceptr kernel_arg_239090 = mem_231574.mem;
                        
                        if ((((((1 && segmap_usable_groups_226675 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226674 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = segmap_usable_groups_226675;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_239085[] = {&ctx->global_failure,
                                                          &n_203572,
                                                          &partition_sizze_203667,
                                                          &kernel_arg_239088,
                                                          &kernel_arg_239089,
                                                          &kernel_arg_239090};
                            int64_t time_start_239086 = 0, time_end_239087 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_226679",
                                        (long) segmap_usable_groups_226675,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226674,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_239086 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226679_runs,
                                                          &ctx->mainzisegmap_226679_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226679,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226674,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_239085,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_239087 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226679", time_end_239087 -
                                        time_start_239086);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226690;
                        
                        segmap_group_sizze_226690 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226592;
                        
                        int64_t segmap_usable_groups_226691 =
                                sdiv_up64(nest_sizze_207090,
                                          segmap_group_sizze_226690);
                        struct memblock_device mem_231579;
                        
                        mem_231579.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231579,
                                                  bytes_229285, "mem_231579")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231583;
                        
                        mem_231583.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231583,
                                                  bytes_229285, "mem_231583")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        CUdeviceptr kernel_arg_239094 = ext_mem_229305.mem;
                        CUdeviceptr kernel_arg_239095 = mem_param_229601.mem;
                        CUdeviceptr kernel_arg_239096 = mem_231574.mem;
                        CUdeviceptr kernel_arg_239097 = mem_231579.mem;
                        CUdeviceptr kernel_arg_239098 = mem_231583.mem;
                        
                        if ((((((1 && segmap_usable_groups_226691 != 0) && 1 !=
                                0) && 1 != 0) && segmap_group_sizze_226690 !=
                              0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = segmap_usable_groups_226691;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_239091[] = {&ctx->global_failure,
                                                          &ctx->failure_is_an_option,
                                                          &ctx->global_failure_args,
                                                          &n_203572,
                                                          &partition_sizze_203667,
                                                          &ctx_param_ext_229596,
                                                          &ctx_param_ext_229597,
                                                          &ctx_param_ext_229599,
                                                          &kernel_arg_239094,
                                                          &kernel_arg_239095,
                                                          &kernel_arg_239096,
                                                          &kernel_arg_239097,
                                                          &kernel_arg_239098};
                            int64_t time_start_239092 = 0, time_end_239093 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_226696",
                                        (long) segmap_usable_groups_226691,
                                        (long) 1, (long) 1,
                                        (long) segmap_group_sizze_226690,
                                        (long) 1, (long) 1, (int) 0);
                                time_start_239092 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_226696_runs,
                                                          &ctx->mainzisegmap_226696_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226696,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  segmap_group_sizze_226690,
                                                                  1, 1, 0, NULL,
                                                                  kernel_args_239091,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_239093 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_226696", time_end_239093 -
                                        time_start_239092);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231574,
                                                  "mem_231574") != 0)
                            return 1;
                        
                        struct memblock_device mem_231603;
                        
                        mem_231603.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231603,
                                                  bytes_229535, "mem_231603")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231607;
                        
                        mem_231607.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231607,
                                                  bytes_229535, "mem_231607")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        
                        unsigned int shared_sizze_239102 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239104 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239106 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239108 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239110 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239112 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239114 = (int64_t) 8 *
                                     q_t_203576;
                        unsigned int shared_sizze_239116 = bytes_231532;
                        unsigned int shared_sizze_239118 = bytes_231532;
                        unsigned int shared_sizze_239120 = bytes_231532;
                        unsigned int shared_sizze_239122 = bytes_231532;
                        CUdeviceptr kernel_arg_239124 = ext_mem_229304.mem;
                        CUdeviceptr kernel_arg_239125 = ext_mem_229305.mem;
                        CUdeviceptr kernel_arg_239126 = ext_mem_229568.mem;
                        CUdeviceptr kernel_arg_239127 = ext_mem_229569.mem;
                        CUdeviceptr kernel_arg_239128 = mem_231579.mem;
                        CUdeviceptr kernel_arg_239129 = mem_231583.mem;
                        CUdeviceptr kernel_arg_239130 = mem_231603.mem;
                        CUdeviceptr kernel_arg_239131 = mem_231607.mem;
                        unsigned int shared_offset_239103 = 0;
                        unsigned int shared_offset_239105 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8);
                        unsigned int shared_offset_239107 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8);
                        unsigned int shared_offset_239109 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8);
                        unsigned int shared_offset_239111 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8);
                        unsigned int shared_offset_239113 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8) +
                                     (shared_sizze_239110 + (8 -
                                                             shared_sizze_239110 %
                                                             8) % 8);
                        unsigned int shared_offset_239115 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8) +
                                     (shared_sizze_239110 + (8 -
                                                             shared_sizze_239110 %
                                                             8) % 8) +
                                     (shared_sizze_239112 + (8 -
                                                             shared_sizze_239112 %
                                                             8) % 8);
                        unsigned int shared_offset_239117 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8) +
                                     (shared_sizze_239110 + (8 -
                                                             shared_sizze_239110 %
                                                             8) % 8) +
                                     (shared_sizze_239112 + (8 -
                                                             shared_sizze_239112 %
                                                             8) % 8) +
                                     (shared_sizze_239114 + (8 -
                                                             shared_sizze_239114 %
                                                             8) % 8);
                        unsigned int shared_offset_239119 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8) +
                                     (shared_sizze_239110 + (8 -
                                                             shared_sizze_239110 %
                                                             8) % 8) +
                                     (shared_sizze_239112 + (8 -
                                                             shared_sizze_239112 %
                                                             8) % 8) +
                                     (shared_sizze_239114 + (8 -
                                                             shared_sizze_239114 %
                                                             8) % 8) +
                                     (shared_sizze_239116 + (8 -
                                                             shared_sizze_239116 %
                                                             8) % 8);
                        unsigned int shared_offset_239121 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8) +
                                     (shared_sizze_239110 + (8 -
                                                             shared_sizze_239110 %
                                                             8) % 8) +
                                     (shared_sizze_239112 + (8 -
                                                             shared_sizze_239112 %
                                                             8) % 8) +
                                     (shared_sizze_239114 + (8 -
                                                             shared_sizze_239114 %
                                                             8) % 8) +
                                     (shared_sizze_239116 + (8 -
                                                             shared_sizze_239116 %
                                                             8) % 8) +
                                     (shared_sizze_239118 + (8 -
                                                             shared_sizze_239118 %
                                                             8) % 8);
                        unsigned int shared_offset_239123 = 0 +
                                     (shared_sizze_239102 + (8 -
                                                             shared_sizze_239102 %
                                                             8) % 8) +
                                     (shared_sizze_239104 + (8 -
                                                             shared_sizze_239104 %
                                                             8) % 8) +
                                     (shared_sizze_239106 + (8 -
                                                             shared_sizze_239106 %
                                                             8) % 8) +
                                     (shared_sizze_239108 + (8 -
                                                             shared_sizze_239108 %
                                                             8) % 8) +
                                     (shared_sizze_239110 + (8 -
                                                             shared_sizze_239110 %
                                                             8) % 8) +
                                     (shared_sizze_239112 + (8 -
                                                             shared_sizze_239112 %
                                                             8) % 8) +
                                     (shared_sizze_239114 + (8 -
                                                             shared_sizze_239114 %
                                                             8) % 8) +
                                     (shared_sizze_239116 + (8 -
                                                             shared_sizze_239116 %
                                                             8) % 8) +
                                     (shared_sizze_239118 + (8 -
                                                             shared_sizze_239118 %
                                                             8) % 8) +
                                     (shared_sizze_239120 + (8 -
                                                             shared_sizze_239120 %
                                                             8) % 8);
                        
                        if ((((((1 && nest_sizze_210208 != 0) && 1 != 0) && 1 !=
                               0) && q_t_203576 != 0) && 1 != 0) && 1 != 0) {
                            int perm[3] = {0, 1, 2};
                            
                            if (1 >= 1 << 16) {
                                perm[1] = perm[0];
                                perm[0] = 1;
                            }
                            if (1 >= 1 << 16) {
                                perm[2] = perm[0];
                                perm[0] = 2;
                            }
                            
                            size_t grid[3];
                            
                            grid[perm[0]] = nest_sizze_210208;
                            grid[perm[1]] = 1;
                            grid[perm[2]] = 1;
                            
                            void *kernel_args_239099[] = {&ctx->global_failure,
                                                          &shared_offset_239103,
                                                          &shared_offset_239105,
                                                          &shared_offset_239107,
                                                          &shared_offset_239109,
                                                          &shared_offset_239111,
                                                          &shared_offset_239113,
                                                          &shared_offset_239115,
                                                          &shared_offset_239117,
                                                          &shared_offset_239119,
                                                          &shared_offset_239121,
                                                          &shared_offset_239123,
                                                          &n_203572,
                                                          &q_t_203576,
                                                          &jump_t_203582,
                                                          &partition_sizze_203667,
                                                          &t_n_m_203740,
                                                          &i_203760,
                                                          &kernel_arg_239124,
                                                          &kernel_arg_239125,
                                                          &kernel_arg_239126,
                                                          &kernel_arg_239127,
                                                          &kernel_arg_239128,
                                                          &kernel_arg_239129,
                                                          &kernel_arg_239130,
                                                          &kernel_arg_239131};
                            int64_t time_start_239100 = 0, time_end_239101 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                        "main.segmap_intragroup_226724",
                                        (long) nest_sizze_210208, (long) 1,
                                        (long) 1, (long) q_t_203576, (long) 1,
                                        (long) 1, (int) (0 +
                                                         (shared_sizze_239102 +
                                                          (8 -
                                                           shared_sizze_239102 %
                                                           8) % 8) +
                                                         (shared_sizze_239104 +
                                                          (8 -
                                                           shared_sizze_239104 %
                                                           8) % 8) +
                                                         (shared_sizze_239106 +
                                                          (8 -
                                                           shared_sizze_239106 %
                                                           8) % 8) +
                                                         (shared_sizze_239108 +
                                                          (8 -
                                                           shared_sizze_239108 %
                                                           8) % 8) +
                                                         (shared_sizze_239110 +
                                                          (8 -
                                                           shared_sizze_239110 %
                                                           8) % 8) +
                                                         (shared_sizze_239112 +
                                                          (8 -
                                                           shared_sizze_239112 %
                                                           8) % 8) +
                                                         (shared_sizze_239114 +
                                                          (8 -
                                                           shared_sizze_239114 %
                                                           8) % 8) +
                                                         (shared_sizze_239116 +
                                                          (8 -
                                                           shared_sizze_239116 %
                                                           8) % 8) +
                                                         (shared_sizze_239118 +
                                                          (8 -
                                                           shared_sizze_239118 %
                                                           8) % 8) +
                                                         (shared_sizze_239120 +
                                                          (8 -
                                                           shared_sizze_239120 %
                                                           8) % 8) +
                                                         (shared_sizze_239122 +
                                                          (8 -
                                                           shared_sizze_239122 %
                                                           8) % 8)));
                                time_start_239100 = get_wall_time();
                            }
                            
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->mainzisegmap_intragroup_226724_runs,
                                                          &ctx->mainzisegmap_intragroup_226724_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_226724,
                                                                  grid[0],
                                                                  grid[1],
                                                                  grid[2],
                                                                  q_t_203576, 1,
                                                                  1, 0 +
                                                                  (shared_sizze_239102 +
                                                                   (8 -
                                                                    shared_sizze_239102 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239104 +
                                                                   (8 -
                                                                    shared_sizze_239104 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239106 +
                                                                   (8 -
                                                                    shared_sizze_239106 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239108 +
                                                                   (8 -
                                                                    shared_sizze_239108 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239110 +
                                                                   (8 -
                                                                    shared_sizze_239110 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239112 +
                                                                   (8 -
                                                                    shared_sizze_239112 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239114 +
                                                                   (8 -
                                                                    shared_sizze_239114 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239116 +
                                                                   (8 -
                                                                    shared_sizze_239116 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239118 +
                                                                   (8 -
                                                                    shared_sizze_239118 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239120 +
                                                                   (8 -
                                                                    shared_sizze_239120 %
                                                                    8) % 8) +
                                                                  (shared_sizze_239122 +
                                                                   (8 -
                                                                    shared_sizze_239122 %
                                                                    8) % 8),
                                                                  NULL,
                                                                  kernel_args_239099,
                                                                  NULL));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                            if (ctx->debugging) {
                                CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                time_end_239101 = get_wall_time();
                                fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226724",
                                        time_end_239101 - time_start_239100);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231579,
                                                  "mem_231579") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231583,
                                                  "mem_231583") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231609,
                                                &mem_231603, "mem_231603") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231608,
                                                &mem_231607, "mem_231607") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231607,
                                                  "mem_231607") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231603,
                                                  "mem_231603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231583,
                                                  "mem_231583") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231579,
                                                  "mem_231579") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231574,
                                                  "mem_231574") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231611,
                                            &ext_mem_231609,
                                            "ext_mem_231609") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231610,
                                            &ext_mem_231608,
                                            "ext_mem_231608") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231608,
                                              "ext_mem_231608") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231609,
                                              "ext_mem_231609") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231613, &ext_mem_231611,
                                        "ext_mem_231611") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231612, &ext_mem_231610,
                                        "ext_mem_231610") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231610,
                                          "ext_mem_231610") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231611,
                                          "ext_mem_231611") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_231619;
            
            ext_mem_231619.references = NULL;
            if (cond_204198) {
                bool zzero_206670 = jump_t_203582 == (int64_t) 0;
                bool nonzzero_206671 = !zzero_206670;
                bool nonzzero_cert_206672;
                
                if (!nonzzero_206671) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  loess.fut:547:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:546:3-550:9\n   #5  stl.fut:304:23-75\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:303:15-305:43\n   #9  stl.fut:415:61-429:75\n   #10 stl.fut:455:3-469:34\n   #11 stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231619,
                                              "ext_mem_231619") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231612,
                                              "ext_mem_231612") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231613,
                                              "ext_mem_231613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231028, "mem_231028") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_206673 = sub64(t_n_m_203740, (int64_t) 1);
                int64_t segmap_group_sizze_226979;
                
                segmap_group_sizze_226979 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_226861;
                
                int64_t segmap_usable_groups_226980 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_226979);
                struct memblock_device mem_231618;
                
                mem_231618.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231618, bytes_229285,
                                          "mem_231618")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239135 = ext_mem_231612.mem;
                CUdeviceptr kernel_arg_239136 = ext_mem_231613.mem;
                CUdeviceptr kernel_arg_239137 = mem_231618.mem;
                
                if ((((((1 && segmap_usable_groups_226980 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_226979 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_226980;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239132[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_203572, &jump_t_203582,
                                                  &partition_sizze_203667,
                                                  &t_n_m_203740, &i_203760,
                                                  &y_206673, &kernel_arg_239135,
                                                  &kernel_arg_239136,
                                                  &kernel_arg_239137};
                    int64_t time_start_239133 = 0, time_end_239134 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_226984",
                                (long) segmap_usable_groups_226980, (long) 1,
                                (long) 1, (long) segmap_group_sizze_226979,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239133 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_226984_runs,
                                                  &ctx->mainzisegmap_226984_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_226984,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_226979,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239132,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239134 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_226984", time_end_239134 -
                                time_start_239133);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231619, &mem_231618,
                                        "mem_231618") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231618, "mem_231618") != 0)
                    return 1;
            } else {
                bool dim_match_206726 = n_203572 == t_n_m_203740;
                bool empty_or_match_cert_206727;
                
                if (!dim_match_206726) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (",
                                  (long long) partition_sizze_203667, ", ",
                                  (long long) t_n_m_203740,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203667, "][",
                                  (long long) n_203572, "]t`.",
                                  "-> #0  stl.fut:307:15-36\n   #1  stl.fut:415:61-429:75\n   #2  stl.fut:455:3-469:34\n   #3  stl.fut:439:1-469:34\n");
                    if (memblock_unref_device(ctx, &ext_mem_231619,
                                              "ext_mem_231619") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231612,
                                              "ext_mem_231612") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231613,
                                              "ext_mem_231613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231028, "mem_231028") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231022,
                                              "ext_mem_231022") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231015,
                                              "ext_mem_231015") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231016,
                                              "ext_mem_231016") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230654,
                                              "ext_mem_230654") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230637,
                                              "ext_mem_230637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230620,
                                              "ext_mem_230620") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230602,
                                              "ext_mem_230602") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230594,
                                              "ext_mem_230594") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230595,
                                              "ext_mem_230595") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_231619, &ext_mem_231613,
                                        "ext_mem_231613") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231612, "ext_mem_231612") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231613, "ext_mem_231613") !=
                0)
                return 1;
            
            int64_t ctx_param_ext_tmp_233108 = ext_231620;
            int64_t ctx_param_ext_tmp_233109 = ext_231620;
            struct memblock_device mem_param_tmp_233110;
            
            mem_param_tmp_233110.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_233110, &mem_231028,
                                    "mem_231028") != 0)
                return 1;
            
            struct memblock_device mem_param_tmp_233111;
            
            mem_param_tmp_233111.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_233111, &ext_mem_231619,
                                    "ext_mem_231619") != 0)
                return 1;
            ctx_param_ext_229617 = ctx_param_ext_tmp_233108;
            ctx_param_ext_229619 = ctx_param_ext_tmp_233109;
            if (memblock_set_device(ctx, &mem_param_229615,
                                    &mem_param_tmp_233110,
                                    "mem_param_tmp_233110") != 0)
                return 1;
            if (memblock_set_device(ctx, &mem_param_229623,
                                    &mem_param_tmp_233111,
                                    "mem_param_tmp_233111") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_233111,
                                      "mem_param_tmp_233111") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_233110,
                                      "mem_param_tmp_233110") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231619, "ext_mem_231619") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231612, "ext_mem_231612") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231613, "ext_mem_231613") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_231028, "mem_231028") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231022, "ext_mem_231022") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231015, "ext_mem_231015") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231016, "ext_mem_231016") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230654, "ext_mem_230654") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230637, "ext_mem_230637") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230620, "ext_mem_230620") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230602, "ext_mem_230602") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230594, "ext_mem_230594") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230595, "ext_mem_230595") !=
                0)
                return 1;
        }
        ext_231632 = ctx_param_ext_229617;
        ext_231630 = ctx_param_ext_229619;
        if (memblock_set_device(ctx, &ext_mem_231626, &mem_param_229615,
                                "mem_param_229615") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_231625, &mem_param_229623,
                                "mem_param_229623") != 0)
            return 1;
        
        bool cond_206729 = slt64(i_outer_204282, y_204199);
        int64_t ext_231967;
        
        if (cond_206729) {
            ext_231967 = partition_sizze_203667;
        } else {
            ext_231967 = ctx_param_ext_229598;
        }
        
        int64_t ext_231966;
        
        if (cond_206729) {
            ext_231966 = n_203572;
        } else {
            ext_231966 = ctx_param_ext_229600;
        }
        
        int64_t ext_231965;
        
        if (cond_206729) {
            ext_231965 = partition_sizze_203667;
        } else {
            ext_231965 = ctx_param_ext_229594;
        }
        
        int64_t ext_231964;
        
        if (cond_206729) {
            ext_231964 = n_203572;
        } else {
            ext_231964 = ctx_param_ext_229595;
        }
        
        int64_t ext_231963;
        
        if (cond_206729) {
            ext_231963 = n_203572;
        } else {
            ext_231963 = ctx_param_ext_229597;
        }
        
        int64_t ext_231962;
        
        if (cond_206729) {
            ext_231962 = (int64_t) 1;
        } else {
            ext_231962 = ctx_param_ext_229599;
        }
        
        int64_t ext_231961;
        
        if (cond_206729) {
            ext_231961 = (int64_t) 0;
        } else {
            ext_231961 = ctx_param_ext_229596;
        }
        
        struct memblock_device ext_mem_231960;
        
        ext_mem_231960.references = NULL;
        if (cond_206729) {
            bool suff_intra_par_227067;
            
            suff_intra_par_227067 =
                *ctx->tuning_params.mainzisuff_intra_par_34 <= n_203572;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_34", (long) n_203572,
                        suff_intra_par_227067 ? "true" : "false");
            
            bool intra_suff_and_fits_227070 = fits_206978 &&
                 suff_intra_par_227067;
            int64_t segmap_group_sizze_227196;
            
            segmap_group_sizze_227196 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227160;
            
            int64_t segmap_group_sizze_227217;
            
            segmap_group_sizze_227217 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227117;
            
            struct memblock_device ext_mem_231669;
            
            ext_mem_231669.references = NULL;
            
            struct memblock_device ext_mem_231668;
            
            ext_mem_231668.references = NULL;
            
            int32_t local_memory_capacity_236678;
            
            local_memory_capacity_236678 = ctx->cuda.max_shared_memory;
            if (sle64(bytes_229277 + srem64((int64_t) 8 - srem64(bytes_229277,
                                                                 (int64_t) 8),
                                            (int64_t) 8) + (bytes_229277 +
                                                            srem64((int64_t) 8 -
                                                                   srem64(bytes_229277,
                                                                          (int64_t) 8),
                                                                   (int64_t) 8)),
                      sext_i32_i64(local_memory_capacity_236678)) &&
                intra_suff_and_fits_227070) {
                struct memblock_device mem_231653;
                
                mem_231653.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231653, bytes_229285,
                                          "mem_231653")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231657;
                
                mem_231657.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231657, bytes_229285,
                                          "mem_231657")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                unsigned int shared_sizze_239141 = bytes_229277;
                unsigned int shared_sizze_239143 = bytes_229277;
                CUdeviceptr kernel_arg_239145 = mem_229269.mem;
                CUdeviceptr kernel_arg_239146 = ext_mem_229305.mem;
                CUdeviceptr kernel_arg_239147 = ext_mem_231625.mem;
                CUdeviceptr kernel_arg_239148 = ext_mem_231626.mem;
                CUdeviceptr kernel_arg_239149 = mem_231653.mem;
                CUdeviceptr kernel_arg_239150 = mem_231657.mem;
                unsigned int shared_offset_239142 = 0;
                unsigned int shared_offset_239144 = 0 + (shared_sizze_239141 +
                                                         (8 -
                                                          shared_sizze_239141 %
                                                          8) % 8);
                
                if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) && 1 !=
                       0) && n_203572 != 0) && 1 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = partition_sizze_203667;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239138[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &shared_offset_239142,
                                                  &shared_offset_239144,
                                                  &n_203572,
                                                  &partition_sizze_203667,
                                                  &ext_231630,
                                                  &kernel_arg_239145,
                                                  &kernel_arg_239146,
                                                  &kernel_arg_239147,
                                                  &kernel_arg_239148,
                                                  &kernel_arg_239149,
                                                  &kernel_arg_239150};
                    int64_t time_start_239139 = 0, time_end_239140 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_intragroup_227074",
                                (long) partition_sizze_203667, (long) 1,
                                (long) 1, (long) n_203572, (long) 1, (long) 1,
                                (int) (0 + (shared_sizze_239141 + (8 -
                                                                   shared_sizze_239141 %
                                                                   8) % 8) +
                                       (shared_sizze_239143 + (8 -
                                                               shared_sizze_239143 %
                                                               8) % 8)));
                        time_start_239139 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_intragroup_227074_runs,
                                                  &ctx->mainzisegmap_intragroup_227074_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_227074,
                                                          grid[0], grid[1],
                                                          grid[2], n_203572, 1,
                                                          1, 0 +
                                                          (shared_sizze_239141 +
                                                           (8 -
                                                            shared_sizze_239141 %
                                                            8) % 8) +
                                                          (shared_sizze_239143 +
                                                           (8 -
                                                            shared_sizze_239143 %
                                                            8) % 8), NULL,
                                                          kernel_args_239138,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239140 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_227074",
                                time_end_239140 - time_start_239139);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231669, &mem_231653,
                                        "mem_231653") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231668, &mem_231657,
                                        "mem_231657") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231657, "mem_231657") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231653, "mem_231653") != 0)
                    return 1;
            } else {
                int64_t segmap_usable_groups_227197 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_227196);
                struct memblock_device mem_231662;
                
                mem_231662.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231662, bytes_229285,
                                          "mem_231662")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239154 = mem_229269.mem;
                CUdeviceptr kernel_arg_239155 = ext_mem_231625.mem;
                CUdeviceptr kernel_arg_239156 = ext_mem_231626.mem;
                CUdeviceptr kernel_arg_239157 = mem_231662.mem;
                
                if ((((((1 && segmap_usable_groups_227197 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_227196 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_227197;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239151[] = {&ctx->global_failure,
                                                  &n_203572,
                                                  &partition_sizze_203667,
                                                  &ext_231630,
                                                  &kernel_arg_239154,
                                                  &kernel_arg_239155,
                                                  &kernel_arg_239156,
                                                  &kernel_arg_239157};
                    int64_t time_start_239152 = 0, time_end_239153 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_227201",
                                (long) segmap_usable_groups_227197, (long) 1,
                                (long) 1, (long) segmap_group_sizze_227196,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239152 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_227201_runs,
                                                  &ctx->mainzisegmap_227201_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227201,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_227196,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239151,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239153 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_227201", time_end_239153 -
                                time_start_239152);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_227218 =
                        sdiv_up64(nest_sizze_207090, segmap_group_sizze_227217);
                struct memblock_device mem_231667;
                
                mem_231667.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231667, bytes_229285,
                                          "mem_231667")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239161 = ext_mem_229305.mem;
                CUdeviceptr kernel_arg_239162 = mem_231662.mem;
                CUdeviceptr kernel_arg_239163 = mem_231667.mem;
                
                if ((((((1 && segmap_usable_groups_227218 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_227217 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_227218;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239158[] = {&ctx->global_failure,
                                                  &ctx->failure_is_an_option,
                                                  &ctx->global_failure_args,
                                                  &n_203572,
                                                  &partition_sizze_203667,
                                                  &kernel_arg_239161,
                                                  &kernel_arg_239162,
                                                  &kernel_arg_239163};
                    int64_t time_start_239159 = 0, time_end_239160 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_227222",
                                (long) segmap_usable_groups_227218, (long) 1,
                                (long) 1, (long) segmap_group_sizze_227217,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239159 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_227222_runs,
                                                  &ctx->mainzisegmap_227222_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227222,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_227217,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239158,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239160 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_227222", time_end_239160 -
                                time_start_239159);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231669, &mem_231667,
                                        "mem_231667") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231668, &mem_231662,
                                        "mem_231662") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231667, "mem_231667") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231662, "mem_231662") != 0)
                    return 1;
            }
            
            int32_t iters_206755;
            
            if (empty_slice_204209) {
                iters_206755 = 0;
            } else {
                iters_206755 = 32;
            }
            
            bool loop_nonempty_206756 = slt32(0, iters_206755);
            bool loop_not_taken_206757 = !loop_nonempty_206756;
            bool protect_assert_disj_206758 = bounds_check_203763 ||
                 loop_not_taken_206757;
            bool index_certs_206759;
            
            if (!protect_assert_disj_206758) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) i_203760,
                              "] out of bounds for array of shape [",
                              (long long) n_203572, "].",
                              "-> #0  /prelude/array.fut:26:29-34\n   #1  lib/github.com/diku-dk/sorts/radix_sort.fut:25:24-35\n   #2  lib/github.com/diku-dk/sorts/radix_sort.fut:53:31-62\n   #3  lib/github.com/diku-dk/sorts/radix_sort.fut:104:6-36\n   #4  stl.fut:338:35-77\n   #5  stl.fut:337:28-339:40\n   #6  stl.fut:415:61-429:75\n   #7  stl.fut:455:3-469:34\n   #8  stl.fut:439:1-469:34\n");
                if (memblock_unref_device(ctx, &ext_mem_231668,
                                          "ext_mem_231668") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231669,
                                          "ext_mem_231669") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231960,
                                          "ext_mem_231960") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229623,
                                          "mem_param_229623") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229615,
                                          "mem_param_229615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231625,
                                          "ext_mem_231625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231626,
                                          "ext_mem_231626") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229601,
                                          "mem_param_229601") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229593,
                                          "mem_param_229593") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229585,
                                          "mem_param_229585") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231968,
                                          "ext_mem_231968") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231969,
                                          "ext_mem_231969") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231970,
                                          "ext_mem_231970") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229568,
                                          "ext_mem_229568") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229569,
                                          "ext_mem_229569") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229519,
                                          "ext_mem_229519") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229520,
                                          "ext_mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229470,
                                          "ext_mem_229470") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229471,
                                          "ext_mem_229471") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229372,
                                          "ext_mem_229372") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229373,
                                          "ext_mem_229373") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_227244;
            
            suff_outer_par_227244 =
                *ctx->tuning_params.mainzisuff_outer_par_35 <=
                partition_sizze_203667;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_35", (long) partition_sizze_203667,
                        suff_outer_par_227244 ? "true" : "false");
            
            bool suff_intra_par_227443;
            
            suff_intra_par_227443 =
                *ctx->tuning_params.mainzisuff_intra_par_36 <= n_203572;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_36", (long) n_203572,
                        suff_intra_par_227443 ? "true" : "false");
            
            bool intra_suff_and_fits_227446 = fits_206978 &&
                 suff_intra_par_227443;
            int64_t segmap_group_sizze_227346;
            
            segmap_group_sizze_227346 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227248;
            
            int64_t num_groups_227347;
            int32_t max_num_groups_236679;
            
            max_num_groups_236679 =
                *ctx->tuning_params.mainzisegmap_num_groups_227250;
            num_groups_227347 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(partition_sizze_203667,
                                                                     segmap_group_sizze_227346),
                                                           sext_i32_i64(max_num_groups_236679))));
            
            bool suff_intra_par_227900;
            
            suff_intra_par_227900 =
                *ctx->tuning_params.mainzisuff_intra_par_37 <= n_203572;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_37", (long) n_203572,
                        suff_intra_par_227900 ? "true" : "false");
            
            bool intra_suff_and_fits_227901 = fits_206978 &&
                 suff_intra_par_227900;
            int64_t segscan_group_sizze_227995;
            
            segscan_group_sizze_227995 =
                *ctx->tuning_params.mainzisegscan_group_sizze_227715;
            
            int64_t num_groups_227996;
            int32_t max_num_groups_236680;
            
            max_num_groups_236680 =
                *ctx->tuning_params.mainzisegscan_num_groups_227717;
            num_groups_227996 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_207090,
                                                                     segscan_group_sizze_227995),
                                                           sext_i32_i64(max_num_groups_236680))));
            
            int64_t segmap_group_sizze_228071;
            
            segmap_group_sizze_228071 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227667;
            
            int64_t segmap_usable_groups_228072 =
                    sdiv_up_safe64(nest_sizze_207090,
                                   segmap_group_sizze_228071);
            int64_t binop_y_231697 = (int64_t) 4 * n_203572;
            int64_t bytes_231698 = smax64((int64_t) 0, binop_y_231697);
            int64_t binop_y_231891 = (int64_t) 4 * nest_sizze_207090;
            int64_t bytes_231892 = smax64((int64_t) 0, binop_y_231891);
            int64_t num_bytes_232064 = (int64_t) 8 * n_203572;
            int64_t num_bytes_232069 = (int64_t) 8 * n_203572;
            int64_t num_threads_232339 = segmap_group_sizze_227346 *
                    num_groups_227347;
            int64_t total_sizze_232340 = num_bytes_232064 * num_threads_232339;
            int64_t total_sizze_232341 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232342 = bytes_231698 * num_threads_232339;
            int64_t total_sizze_232343 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232344 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232345 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232346 = bytes_229277 * num_threads_232339;
            int64_t total_sizze_232348 = partition_sizze_203667 *
                    num_bytes_232069;
            int64_t total_sizze_232349 = partition_sizze_203667 * bytes_229277;
            struct memblock_device ext_mem_231924;
            
            ext_mem_231924.references = NULL;
            
            int32_t local_memory_capacity_237068;
            
            local_memory_capacity_237068 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_237068)) &&
                suff_outer_par_227244) {
                struct memblock_device mem_231672;
                
                mem_231672.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231672, binop_y_229284,
                                          "mem_231672")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231672,
                                                          (int64_t) 0,
                                                          ext_mem_231669,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203572,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231672, "mem_231672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231924,
                                              "ext_mem_231924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231668,
                                              "ext_mem_231668") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231669,
                                              "ext_mem_231669") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231960,
                                              "ext_mem_231960") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231782;
                
                mem_231782.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231782, binop_y_229284,
                                          "mem_231782")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232173;
                
                color_232173.references = NULL;
                if (memblock_alloc_device(ctx, &color_232173,
                                          total_sizze_232340, "color_232173")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232174;
                
                color_232174.references = NULL;
                if (memblock_alloc_device(ctx, &color_232174,
                                          total_sizze_232341, "color_232174")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232175;
                
                color_232175.references = NULL;
                if (memblock_alloc_device(ctx, &color_232175,
                                          total_sizze_232342, "color_232175")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232176;
                
                color_232176.references = NULL;
                if (memblock_alloc_device(ctx, &color_232176,
                                          total_sizze_232343, "color_232176")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232177;
                
                color_232177.references = NULL;
                if (memblock_alloc_device(ctx, &color_232177,
                                          total_sizze_232344, "color_232177")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232178;
                
                color_232178.references = NULL;
                if (memblock_alloc_device(ctx, &color_232178,
                                          total_sizze_232345, "color_232178")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232179;
                
                color_232179.references = NULL;
                if (memblock_alloc_device(ctx, &color_232179,
                                          total_sizze_232346, "color_232179")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239167 = mem_231672.mem;
                CUdeviceptr kernel_arg_239168 = mem_231782.mem;
                CUdeviceptr kernel_arg_239169 = color_232173.mem;
                CUdeviceptr kernel_arg_239170 = color_232174.mem;
                CUdeviceptr kernel_arg_239171 = color_232175.mem;
                CUdeviceptr kernel_arg_239172 = color_232176.mem;
                CUdeviceptr kernel_arg_239173 = color_232177.mem;
                CUdeviceptr kernel_arg_239174 = color_232178.mem;
                CUdeviceptr kernel_arg_239175 = color_232179.mem;
                
                if ((((((1 && num_groups_227347 != 0) && 1 != 0) && 1 != 0) &&
                      segmap_group_sizze_227346 != 0) && 1 != 0) && 1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = num_groups_227347;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239164[] = {&ctx->global_failure,
                                                  &n_203572,
                                                  &partition_sizze_203667,
                                                  &i_203760, &iters_206755,
                                                  &num_groups_227347,
                                                  &num_threads_232339,
                                                  &kernel_arg_239167,
                                                  &kernel_arg_239168,
                                                  &kernel_arg_239169,
                                                  &kernel_arg_239170,
                                                  &kernel_arg_239171,
                                                  &kernel_arg_239172,
                                                  &kernel_arg_239173,
                                                  &kernel_arg_239174,
                                                  &kernel_arg_239175};
                    int64_t time_start_239165 = 0, time_end_239166 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_227351", (long) num_groups_227347,
                                (long) 1, (long) 1,
                                (long) segmap_group_sizze_227346, (long) 1,
                                (long) 1, (int) 0);
                        time_start_239165 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_227351_runs,
                                                  &ctx->mainzisegmap_227351_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_227351,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_227346,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239164,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239166 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_227351", time_end_239166 -
                                time_start_239165);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231672, "mem_231672") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232173, "color_232173") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232174, "color_232174") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232175, "color_232175") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232176, "color_232176") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232177, "color_232177") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232178, "color_232178") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232179, "color_232179") !=
                    0)
                    return 1;
                
                struct memblock_device mem_231917;
                
                mem_231917.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231917, bytes_229285,
                                          "mem_231917")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231917,
                                                          (int64_t) 0,
                                                          mem_231782,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          partition_sizze_203667,
                                                          n_203572) != 0) {
                    if (memblock_unref_device(ctx, &mem_231917, "mem_231917") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232179,
                                              "color_232179") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232178,
                                              "color_232178") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232177,
                                              "color_232177") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232176,
                                              "color_232176") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232175,
                                              "color_232175") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232174,
                                              "color_232174") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232173,
                                              "color_232173") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231782, "mem_231782") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231672, "mem_231672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231924,
                                              "ext_mem_231924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231668,
                                              "ext_mem_231668") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231669,
                                              "ext_mem_231669") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231960,
                                              "ext_mem_231960") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_231782, "mem_231782") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231924, &mem_231917,
                                        "mem_231917") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231917, "mem_231917") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232179, "color_232179") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232178, "color_232178") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232177, "color_232177") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232176, "color_232176") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232175, "color_232175") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232174, "color_232174") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232173, "color_232173") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231782, "mem_231782") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231672, "mem_231672") != 0)
                    return 1;
            } else {
                struct memblock_device ext_mem_231906;
                
                ext_mem_231906.references = NULL;
                
                int32_t local_memory_capacity_237067;
                
                local_memory_capacity_237067 = ctx->cuda.max_shared_memory;
                if (sle64(bytes_229277 + srem64((int64_t) 8 -
                                                srem64(bytes_229277,
                                                       (int64_t) 8),
                                                (int64_t) 8) + (bytes_231698 +
                                                                srem64((int64_t) 8 -
                                                                       srem64(bytes_231698,
                                                                              (int64_t) 8),
                                                                       (int64_t) 8)) +
                          (bytes_229277 + srem64((int64_t) 8 -
                                                 srem64(bytes_229277,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229277 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229277,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)) +
                          (bytes_229277 + srem64((int64_t) 8 -
                                                 srem64(bytes_229277,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229277 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229277,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)),
                          sext_i32_i64(local_memory_capacity_237067)) &&
                    intra_suff_and_fits_227446) {
                    struct memblock_device mem_231829;
                    
                    mem_231829.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231829, bytes_229285,
                                              "mem_231829")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232180;
                    
                    color_232180.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232180,
                                              total_sizze_232348,
                                              "color_232180")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232181;
                    
                    color_232181.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232181,
                                              total_sizze_232349,
                                              "color_232181")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    
                    unsigned int shared_sizze_239179 = bytes_229277;
                    unsigned int shared_sizze_239181 = bytes_229277;
                    unsigned int shared_sizze_239183 = bytes_229277;
                    unsigned int shared_sizze_239185 = bytes_229277;
                    unsigned int shared_sizze_239187 = bytes_231698;
                    unsigned int shared_sizze_239189 = bytes_229277;
                    CUdeviceptr kernel_arg_239191 = ext_mem_231669.mem;
                    CUdeviceptr kernel_arg_239192 = mem_231829.mem;
                    CUdeviceptr kernel_arg_239193 = color_232180.mem;
                    CUdeviceptr kernel_arg_239194 = color_232181.mem;
                    unsigned int shared_offset_239180 = 0;
                    unsigned int shared_offset_239182 = 0 +
                                 (shared_sizze_239179 + (8 -
                                                         shared_sizze_239179 %
                                                         8) % 8);
                    unsigned int shared_offset_239184 = 0 +
                                 (shared_sizze_239179 + (8 -
                                                         shared_sizze_239179 %
                                                         8) % 8) +
                                 (shared_sizze_239181 + (8 -
                                                         shared_sizze_239181 %
                                                         8) % 8);
                    unsigned int shared_offset_239186 = 0 +
                                 (shared_sizze_239179 + (8 -
                                                         shared_sizze_239179 %
                                                         8) % 8) +
                                 (shared_sizze_239181 + (8 -
                                                         shared_sizze_239181 %
                                                         8) % 8) +
                                 (shared_sizze_239183 + (8 -
                                                         shared_sizze_239183 %
                                                         8) % 8);
                    unsigned int shared_offset_239188 = 0 +
                                 (shared_sizze_239179 + (8 -
                                                         shared_sizze_239179 %
                                                         8) % 8) +
                                 (shared_sizze_239181 + (8 -
                                                         shared_sizze_239181 %
                                                         8) % 8) +
                                 (shared_sizze_239183 + (8 -
                                                         shared_sizze_239183 %
                                                         8) % 8) +
                                 (shared_sizze_239185 + (8 -
                                                         shared_sizze_239185 %
                                                         8) % 8);
                    unsigned int shared_offset_239190 = 0 +
                                 (shared_sizze_239179 + (8 -
                                                         shared_sizze_239179 %
                                                         8) % 8) +
                                 (shared_sizze_239181 + (8 -
                                                         shared_sizze_239181 %
                                                         8) % 8) +
                                 (shared_sizze_239183 + (8 -
                                                         shared_sizze_239183 %
                                                         8) % 8) +
                                 (shared_sizze_239185 + (8 -
                                                         shared_sizze_239185 %
                                                         8) % 8) +
                                 (shared_sizze_239187 + (8 -
                                                         shared_sizze_239187 %
                                                         8) % 8);
                    
                    if ((((((1 && partition_sizze_203667 != 0) && 1 != 0) &&
                           1 != 0) && n_203572 != 0) && 1 != 0) && 1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = partition_sizze_203667;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239176[] = {&ctx->global_failure,
                                                      &shared_offset_239180,
                                                      &shared_offset_239182,
                                                      &shared_offset_239184,
                                                      &shared_offset_239186,
                                                      &shared_offset_239188,
                                                      &shared_offset_239190,
                                                      &n_203572,
                                                      &partition_sizze_203667,
                                                      &i_203760, &iters_206755,
                                                      &kernel_arg_239191,
                                                      &kernel_arg_239192,
                                                      &kernel_arg_239193,
                                                      &kernel_arg_239194};
                        int64_t time_start_239177 = 0, time_end_239178 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segmap_intragroup_227449",
                                    (long) partition_sizze_203667, (long) 1,
                                    (long) 1, (long) n_203572, (long) 1,
                                    (long) 1, (int) (0 + (shared_sizze_239179 +
                                                          (8 -
                                                           shared_sizze_239179 %
                                                           8) % 8) +
                                                     (shared_sizze_239181 + (8 -
                                                                             shared_sizze_239181 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_239183 + (8 -
                                                                             shared_sizze_239183 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_239185 + (8 -
                                                                             shared_sizze_239185 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_239187 + (8 -
                                                                             shared_sizze_239187 %
                                                                             8) %
                                                      8) +
                                                     (shared_sizze_239189 + (8 -
                                                                             shared_sizze_239189 %
                                                                             8) %
                                                      8)));
                            time_start_239177 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegmap_intragroup_227449_runs,
                                                      &ctx->mainzisegmap_intragroup_227449_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_227449,
                                                              grid[0], grid[1],
                                                              grid[2], n_203572,
                                                              1, 1, 0 +
                                                              (shared_sizze_239179 +
                                                               (8 -
                                                                shared_sizze_239179 %
                                                                8) % 8) +
                                                              (shared_sizze_239181 +
                                                               (8 -
                                                                shared_sizze_239181 %
                                                                8) % 8) +
                                                              (shared_sizze_239183 +
                                                               (8 -
                                                                shared_sizze_239183 %
                                                                8) % 8) +
                                                              (shared_sizze_239185 +
                                                               (8 -
                                                                shared_sizze_239185 %
                                                                8) % 8) +
                                                              (shared_sizze_239187 +
                                                               (8 -
                                                                shared_sizze_239187 %
                                                                8) % 8) +
                                                              (shared_sizze_239189 +
                                                               (8 -
                                                                shared_sizze_239189 %
                                                                8) % 8), NULL,
                                                              kernel_args_239176,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239178 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_227449",
                                    time_end_239178 - time_start_239177);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &color_232180,
                                              "color_232180") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232181,
                                              "color_232181") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231906, &mem_231829,
                                            "mem_231829") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232181,
                                              "color_232181") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232180,
                                              "color_232180") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231829, "mem_231829") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_231833;
                    
                    mem_231833.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231833, bytes_229285,
                                              "mem_231833")) {
                        err = 1;
                        goto cleanup;
                    }
                    {
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->copy_dev_to_dev_runs,
                                                      &ctx->copy_dev_to_dev_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuMemcpy(mem_231833.mem +
                                                        (int64_t) 0,
                                                        ext_mem_231669.mem +
                                                        (int64_t) 0,
                                                        partition_sizze_203667 *
                                                        n_203572 *
                                                        (int64_t) 8));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    }
                    
                    struct memblock_device ext_mem_231898;
                    
                    ext_mem_231898.references = NULL;
                    
                    struct memblock_device mem_param_231841;
                    
                    mem_param_231841.references = NULL;
                    if (memblock_set_device(ctx, &mem_param_231841, &mem_231833,
                                            "mem_231833") != 0)
                        return 1;
                    for (int32_t i_227886 = 0; i_227886 < iters_206755;
                         i_227886++) {
                        struct memblock_device mem_231847;
                        
                        mem_231847.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231847,
                                                  bytes_229285, "mem_231847")) {
                            err = 1;
                            goto cleanup;
                        }
                        {
                            cudaEvent_t *pevents = NULL;
                            
                            if (ctx->profiling && !ctx->profiling_paused) {
                                pevents = cuda_get_events(&ctx->cuda,
                                                          &ctx->copy_dev_to_dev_runs,
                                                          &ctx->copy_dev_to_dev_total_runtime);
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                   0));
                            }
                            CUDA_SUCCEED_OR_RETURN(cuMemcpy(mem_231847.mem +
                                                            (int64_t) 0,
                                                            mem_param_231841.mem +
                                                            (int64_t) 0,
                                                            partition_sizze_203667 *
                                                            n_203572 *
                                                            (int64_t) 8));
                            if (pevents != NULL)
                                CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                   0));
                        }
                        
                        int32_t defunc_2_radix_sort_step_arg_227889 = mul32(2,
                                                                            i_227886);
                        int32_t defunc_0_get_bit_arg_227890 = add32(1,
                                                                    defunc_2_radix_sort_step_arg_227889);
                        bool cond_f_res_227891 = defunc_0_get_bit_arg_227890 ==
                             63;
                        bool cond_f_res_227892 =
                             defunc_2_radix_sort_step_arg_227889 == 63;
                        int64_t unsign_arg_227893 =
                                zext_i32_i64(defunc_0_get_bit_arg_227890);
                        int64_t unsign_arg_227894 =
                                zext_i32_i64(defunc_2_radix_sort_step_arg_227889);
                        struct memblock_device ext_mem_231895;
                        
                        ext_mem_231895.references = NULL;
                        
                        int32_t local_memory_capacity_237066;
                        
                        local_memory_capacity_237066 =
                            ctx->cuda.max_shared_memory;
                        if (sle64(bytes_231698 + srem64((int64_t) 8 -
                                                        srem64(bytes_231698,
                                                               (int64_t) 8),
                                                        (int64_t) 8) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229277 + srem64((int64_t) 8 -
                                                         srem64(bytes_229277,
                                                                (int64_t) 8),
                                                         (int64_t) 8)),
                                  sext_i32_i64(local_memory_capacity_237066)) &&
                            intra_suff_and_fits_227901) {
                            struct memblock_device mem_231872;
                            
                            mem_231872.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231872,
                                                      bytes_229285,
                                                      "mem_231872")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            unsigned int shared_sizze_239198 = bytes_229277;
                            unsigned int shared_sizze_239200 = bytes_229277;
                            unsigned int shared_sizze_239202 = bytes_229277;
                            unsigned int shared_sizze_239204 = bytes_229277;
                            unsigned int shared_sizze_239206 = bytes_229277;
                            unsigned int shared_sizze_239208 = bytes_231698;
                            CUdeviceptr kernel_arg_239210 =
                                        mem_param_231841.mem;
                            CUdeviceptr kernel_arg_239211 = mem_231872.mem;
                            unsigned int shared_offset_239199 = 0;
                            unsigned int shared_offset_239201 = 0 +
                                         (shared_sizze_239198 + (8 -
                                                                 shared_sizze_239198 %
                                                                 8) % 8);
                            unsigned int shared_offset_239203 = 0 +
                                         (shared_sizze_239198 + (8 -
                                                                 shared_sizze_239198 %
                                                                 8) % 8) +
                                         (shared_sizze_239200 + (8 -
                                                                 shared_sizze_239200 %
                                                                 8) % 8);
                            unsigned int shared_offset_239205 = 0 +
                                         (shared_sizze_239198 + (8 -
                                                                 shared_sizze_239198 %
                                                                 8) % 8) +
                                         (shared_sizze_239200 + (8 -
                                                                 shared_sizze_239200 %
                                                                 8) % 8) +
                                         (shared_sizze_239202 + (8 -
                                                                 shared_sizze_239202 %
                                                                 8) % 8);
                            unsigned int shared_offset_239207 = 0 +
                                         (shared_sizze_239198 + (8 -
                                                                 shared_sizze_239198 %
                                                                 8) % 8) +
                                         (shared_sizze_239200 + (8 -
                                                                 shared_sizze_239200 %
                                                                 8) % 8) +
                                         (shared_sizze_239202 + (8 -
                                                                 shared_sizze_239202 %
                                                                 8) % 8) +
                                         (shared_sizze_239204 + (8 -
                                                                 shared_sizze_239204 %
                                                                 8) % 8);
                            unsigned int shared_offset_239209 = 0 +
                                         (shared_sizze_239198 + (8 -
                                                                 shared_sizze_239198 %
                                                                 8) % 8) +
                                         (shared_sizze_239200 + (8 -
                                                                 shared_sizze_239200 %
                                                                 8) % 8) +
                                         (shared_sizze_239202 + (8 -
                                                                 shared_sizze_239202 %
                                                                 8) % 8) +
                                         (shared_sizze_239204 + (8 -
                                                                 shared_sizze_239204 %
                                                                 8) % 8) +
                                         (shared_sizze_239206 + (8 -
                                                                 shared_sizze_239206 %
                                                                 8) % 8);
                            
                            if ((((((1 && partition_sizze_203667 != 0) && 1 !=
                                    0) && 1 != 0) && n_203572 != 0) && 1 !=
                                 0) && 1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = partition_sizze_203667;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_239195[] =
                                     {&ctx->global_failure,
                                      &shared_offset_239199,
                                      &shared_offset_239201,
                                      &shared_offset_239203,
                                      &shared_offset_239205,
                                      &shared_offset_239207,
                                      &shared_offset_239209, &n_203572,
                                      &partition_sizze_203667, &i_203760,
                                      &cond_f_res_227891, &cond_f_res_227892,
                                      &unsign_arg_227893, &unsign_arg_227894,
                                      &kernel_arg_239210, &kernel_arg_239211};
                                int64_t time_start_239196 = 0, time_end_239197 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_intragroup_227905",
                                            (long) partition_sizze_203667,
                                            (long) 1, (long) 1, (long) n_203572,
                                            (long) 1, (long) 1, (int) (0 +
                                                                       (shared_sizze_239198 +
                                                                        (8 -
                                                                         shared_sizze_239198 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239200 +
                                                                        (8 -
                                                                         shared_sizze_239200 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239202 +
                                                                        (8 -
                                                                         shared_sizze_239202 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239204 +
                                                                        (8 -
                                                                         shared_sizze_239204 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239206 +
                                                                        (8 -
                                                                         shared_sizze_239206 %
                                                                         8) %
                                                                        8) +
                                                                       (shared_sizze_239208 +
                                                                        (8 -
                                                                         shared_sizze_239208 %
                                                                         8) %
                                                                        8)));
                                    time_start_239196 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_intragroup_227905_runs,
                                                              &ctx->mainzisegmap_intragroup_227905_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_intragroup_227905,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      n_203572,
                                                                      1, 1, 0 +
                                                                      (shared_sizze_239198 +
                                                                       (8 -
                                                                        shared_sizze_239198 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239200 +
                                                                       (8 -
                                                                        shared_sizze_239200 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239202 +
                                                                       (8 -
                                                                        shared_sizze_239202 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239204 +
                                                                       (8 -
                                                                        shared_sizze_239204 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239206 +
                                                                       (8 -
                                                                        shared_sizze_239206 %
                                                                        8) %
                                                                       8) +
                                                                      (shared_sizze_239208 +
                                                                       (8 -
                                                                        shared_sizze_239208 %
                                                                        8) % 8),
                                                                      NULL,
                                                                      kernel_args_239195,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_239197 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_intragroup_227905",
                                            time_end_239197 -
                                            time_start_239196);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231895,
                                                    &mem_231872,
                                                    "mem_231872") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231872,
                                                      "mem_231872") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231877;
                            
                            mem_231877.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231877,
                                                      bytes_229285,
                                                      "mem_231877")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231881;
                            
                            mem_231881.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231881,
                                                      bytes_229285,
                                                      "mem_231881")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231885;
                            
                            mem_231885.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231885,
                                                      bytes_229285,
                                                      "mem_231885")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231889;
                            
                            mem_231889.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231889,
                                                      bytes_229285,
                                                      "mem_231889")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231893;
                            
                            mem_231893.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231893,
                                                      bytes_231892,
                                                      "mem_231893")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64((int64_t) 0, partition_sizze_203667 *
                                      n_203572)) {
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "SegScan: number of elements processed sequentially per thread is m:",
                                            (long long) 3, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "SegScan: memory constraints is: ",
                                            (long long) 11, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "SegScan: register constraints is: ",
                                            (long long) 3, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "SegScan: sumT' is: ",
                                            (long long) 8, '\n');
                                
                                int64_t numThreads_236797 =
                                        sdiv_up64(partition_sizze_203667 *
                                                  n_203572,
                                                  segscan_group_sizze_227995 *
                                                  (int64_t) 3) *
                                        segscan_group_sizze_227995;
                                int64_t numGroups_236798 =
                                        sdiv_up64(partition_sizze_203667 *
                                                  n_203572,
                                                  segscan_group_sizze_227995 *
                                                  (int64_t) 3);
                                struct memblock_device
                                mainziid_counter_mem_236799 =
                                ctx->mainziid_counter_mem_236799;
                                struct memblock_device status_flags_mem_236801;
                                
                                status_flags_mem_236801.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &status_flags_mem_236801,
                                                          numGroups_236798,
                                                          "status_flags_mem_236801")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236803;
                                
                                aggregates_mem_236803.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236803,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "aggregates_mem_236803")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236805;
                                
                                incprefixes_mem_236805.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236805,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "incprefixes_mem_236805")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236807;
                                
                                aggregates_mem_236807.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236807,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "aggregates_mem_236807")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236809;
                                
                                incprefixes_mem_236809.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236809,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "incprefixes_mem_236809")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236811;
                                
                                aggregates_mem_236811.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236811,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "aggregates_mem_236811")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236813;
                                
                                incprefixes_mem_236813.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236813,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "incprefixes_mem_236813")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device aggregates_mem_236815;
                                
                                aggregates_mem_236815.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &aggregates_mem_236815,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "aggregates_mem_236815")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device incprefixes_mem_236817;
                                
                                incprefixes_mem_236817.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &incprefixes_mem_236817,
                                                          (int64_t) 8 *
                                                          numGroups_236798,
                                                          "incprefixes_mem_236817")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhreplicate_i8(ctx,
                                                                 status_flags_mem_236801,
                                                                 numGroups_236798,
                                                                 (int8_t) 0) !=
                                    0) {
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236817,
                                                              "incprefixes_mem_236817") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236815,
                                                              "aggregates_mem_236815") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236813,
                                                              "incprefixes_mem_236813") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236811,
                                                              "aggregates_mem_236811") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236809,
                                                              "incprefixes_mem_236809") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236807,
                                                              "aggregates_mem_236807") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &incprefixes_mem_236805,
                                                              "incprefixes_mem_236805") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &aggregates_mem_236803,
                                                              "aggregates_mem_236803") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &status_flags_mem_236801,
                                                              "status_flags_mem_236801") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231893,
                                                              "mem_231893") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231889,
                                                              "mem_231889") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231885,
                                                              "mem_231885") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231881,
                                                              "mem_231881") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231877,
                                                              "mem_231877") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231895,
                                                              "ext_mem_231895") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231847,
                                                              "mem_231847") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_231841,
                                                              "mem_param_231841") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231898,
                                                              "ext_mem_231898") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_231833,
                                                              "mem_231833") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231906,
                                                              "ext_mem_231906") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231924,
                                                              "ext_mem_231924") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231668,
                                                              "ext_mem_231668") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231669,
                                                              "ext_mem_231669") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231960,
                                                              "ext_mem_231960") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229623,
                                                              "mem_param_229623") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229615,
                                                              "mem_param_229615") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231625,
                                                              "ext_mem_231625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231626,
                                                              "ext_mem_231626") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229601,
                                                              "mem_param_229601") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229593,
                                                              "mem_param_229593") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229585,
                                                              "mem_param_229585") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231968,
                                                              "ext_mem_231968") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231969,
                                                              "ext_mem_231969") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231970,
                                                              "ext_mem_231970") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230659,
                                                              "mem_230659") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230642,
                                                              "mem_230642") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230625,
                                                              "mem_230625") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230608,
                                                              "mem_230608") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229639,
                                                              "mem_229639") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229634,
                                                              "mem_229634") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229628,
                                                              "mem_229628") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229577,
                                                              "mem_229577") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229573,
                                                              "mem_229573") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229568,
                                                              "ext_mem_229568") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229569,
                                                              "ext_mem_229569") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229519,
                                                              "ext_mem_229519") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229520,
                                                              "ext_mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229470,
                                                              "ext_mem_229470") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229471,
                                                              "ext_mem_229471") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229372,
                                                              "ext_mem_229372") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229373,
                                                              "ext_mem_229373") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229314,
                                                              "mem_229314") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229308,
                                                              "mem_229308") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229304,
                                                              "ext_mem_229304") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229305,
                                                              "ext_mem_229305") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229272,
                                                              "mem_229272") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229269,
                                                              "mem_229269") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232074,
                                                              "color_232074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229265,
                                                              "mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229263,
                                                              "mem_229263") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229260,
                                                              "mem_229260") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229242,
                                                              "mem_229242") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232361,
                                                              "mem_out_232361") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232360,
                                                              "mem_out_232360") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232359,
                                                              "mem_out_232359") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                unsigned int shared_sizze_239216 =
                                             smax64(smax64((int64_t) 1056,
                                                           sdiv_up64(sdiv_up64(sdiv_up64((int64_t) 8 *
                                                                                         segscan_group_sizze_227995,
                                                                                         (int64_t) 8) *
                                                                               (int64_t) 8 +
                                                                               (int64_t) 8 *
                                                                               segscan_group_sizze_227995,
                                                                               (int64_t) 8) *
                                                                     (int64_t) 8 +
                                                                     (int64_t) 8 *
                                                                     segscan_group_sizze_227995,
                                                                     (int64_t) 8) *
                                                           (int64_t) 8 +
                                                           (int64_t) 8 *
                                                           segscan_group_sizze_227995),
                                                    smax64(smax64(smax64((int64_t) 3 *
                                                                         segscan_group_sizze_227995 *
                                                                         (int64_t) 8,
                                                                         (int64_t) 3 *
                                                                         segscan_group_sizze_227995 *
                                                                         (int64_t) 8),
                                                                  (int64_t) 3 *
                                                                  segscan_group_sizze_227995 *
                                                                  (int64_t) 8),
                                                           (int64_t) 3 *
                                                           segscan_group_sizze_227995 *
                                                           (int64_t) 8));
                                CUdeviceptr kernel_arg_239218 =
                                            mem_param_231841.mem;
                                CUdeviceptr kernel_arg_239219 = mem_231877.mem;
                                CUdeviceptr kernel_arg_239220 = mem_231881.mem;
                                CUdeviceptr kernel_arg_239221 = mem_231885.mem;
                                CUdeviceptr kernel_arg_239222 = mem_231889.mem;
                                CUdeviceptr kernel_arg_239223 = mem_231893.mem;
                                CUdeviceptr kernel_arg_239224 =
                                            mainziid_counter_mem_236799.mem;
                                CUdeviceptr kernel_arg_239225 =
                                            status_flags_mem_236801.mem;
                                CUdeviceptr kernel_arg_239226 =
                                            aggregates_mem_236803.mem;
                                CUdeviceptr kernel_arg_239227 =
                                            incprefixes_mem_236805.mem;
                                CUdeviceptr kernel_arg_239228 =
                                            aggregates_mem_236807.mem;
                                CUdeviceptr kernel_arg_239229 =
                                            incprefixes_mem_236809.mem;
                                CUdeviceptr kernel_arg_239230 =
                                            aggregates_mem_236811.mem;
                                CUdeviceptr kernel_arg_239231 =
                                            incprefixes_mem_236813.mem;
                                CUdeviceptr kernel_arg_239232 =
                                            aggregates_mem_236815.mem;
                                CUdeviceptr kernel_arg_239233 =
                                            incprefixes_mem_236817.mem;
                                unsigned int shared_offset_239217 = 0;
                                
                                if ((((((1 && sdiv_up64(partition_sizze_203667 *
                                                        n_203572,
                                                        segscan_group_sizze_227995 *
                                                        (int64_t) 3) != 0) &&
                                        1 != 0) && 1 != 0) &&
                                      segscan_group_sizze_227995 != 0) && 1 !=
                                     0) && 1 != 0) {
                                    int perm[3] = {0, 1, 2};
                                    
                                    if (1 >= 1 << 16) {
                                        perm[1] = perm[0];
                                        perm[0] = 1;
                                    }
                                    if (1 >= 1 << 16) {
                                        perm[2] = perm[0];
                                        perm[0] = 2;
                                    }
                                    
                                    size_t grid[3];
                                    
                                    grid[perm[0]] =
                                        sdiv_up64(partition_sizze_203667 *
                                                  n_203572,
                                                  segscan_group_sizze_227995 *
                                                  (int64_t) 3);
                                    grid[perm[1]] = 1;
                                    grid[perm[2]] = 1;
                                    
                                    void *kernel_args_239213[] =
                                         {&ctx->global_failure,
                                          &shared_offset_239217, &n_203572,
                                          &partition_sizze_203667,
                                          &cond_f_res_227891,
                                          &cond_f_res_227892,
                                          &unsign_arg_227893,
                                          &unsign_arg_227894,
                                          &kernel_arg_239218,
                                          &kernel_arg_239219,
                                          &kernel_arg_239220,
                                          &kernel_arg_239221,
                                          &kernel_arg_239222,
                                          &kernel_arg_239223,
                                          &kernel_arg_239224,
                                          &kernel_arg_239225,
                                          &kernel_arg_239226,
                                          &kernel_arg_239227,
                                          &kernel_arg_239228,
                                          &kernel_arg_239229,
                                          &kernel_arg_239230,
                                          &kernel_arg_239231,
                                          &kernel_arg_239232,
                                          &kernel_arg_239233};
                                    int64_t time_start_239214 = 0,
                                            time_end_239215 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                                "main.segscan_228005",
                                                (long) sdiv_up64(partition_sizze_203667 *
                                                                 n_203572,
                                                                 segscan_group_sizze_227995 *
                                                                 (int64_t) 3),
                                                (long) 1, (long) 1,
                                                (long) segscan_group_sizze_227995,
                                                (long) 1, (long) 1, (int) (0 +
                                                                           (shared_sizze_239216 +
                                                                            (8 -
                                                                             shared_sizze_239216 %
                                                                             8) %
                                                                            8)));
                                        time_start_239214 = get_wall_time();
                                    }
                                    
                                    cudaEvent_t *pevents = NULL;
                                    
                                    if (ctx->profiling &&
                                        !ctx->profiling_paused) {
                                        pevents = cuda_get_events(&ctx->cuda,
                                                                  &ctx->mainzisegscan_228005_runs,
                                                                  &ctx->mainzisegscan_228005_total_runtime);
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                           0));
                                    }
                                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegscan_228005,
                                                                          grid[0],
                                                                          grid[1],
                                                                          grid[2],
                                                                          segscan_group_sizze_227995,
                                                                          1, 1,
                                                                          0 +
                                                                          (shared_sizze_239216 +
                                                                           (8 -
                                                                            shared_sizze_239216 %
                                                                            8) %
                                                                           8),
                                                                          NULL,
                                                                          kernel_args_239213,
                                                                          NULL));
                                    if (pevents != NULL)
                                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                           0));
                                    if (ctx->debugging) {
                                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                        time_end_239215 = get_wall_time();
                                        fprintf(ctx->log,
                                                "Kernel %s runtime: %ldus\n",
                                                "main.segscan_228005",
                                                time_end_239215 -
                                                time_start_239214);
                                    }
                                }
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236817,
                                                          "incprefixes_mem_236817") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236815,
                                                          "aggregates_mem_236815") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236813,
                                                          "incprefixes_mem_236813") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236811,
                                                          "aggregates_mem_236811") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236809,
                                                          "incprefixes_mem_236809") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236807,
                                                          "aggregates_mem_236807") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &incprefixes_mem_236805,
                                                          "incprefixes_mem_236805") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &aggregates_mem_236803,
                                                          "aggregates_mem_236803") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &status_flags_mem_236801,
                                                          "status_flags_mem_236801") !=
                                    0)
                                    return 1;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            
                            CUdeviceptr kernel_arg_239237 =
                                        mem_param_231841.mem;
                            CUdeviceptr kernel_arg_239238 = mem_231847.mem;
                            CUdeviceptr kernel_arg_239239 = mem_231877.mem;
                            CUdeviceptr kernel_arg_239240 = mem_231881.mem;
                            CUdeviceptr kernel_arg_239241 = mem_231885.mem;
                            CUdeviceptr kernel_arg_239242 = mem_231889.mem;
                            CUdeviceptr kernel_arg_239243 = mem_231893.mem;
                            
                            if ((((((1 && segmap_usable_groups_228072 != 0) &&
                                    1 != 0) && 1 != 0) &&
                                  segmap_group_sizze_228071 != 0) && 1 != 0) &&
                                1 != 0) {
                                int perm[3] = {0, 1, 2};
                                
                                if (1 >= 1 << 16) {
                                    perm[1] = perm[0];
                                    perm[0] = 1;
                                }
                                if (1 >= 1 << 16) {
                                    perm[2] = perm[0];
                                    perm[0] = 2;
                                }
                                
                                size_t grid[3];
                                
                                grid[perm[0]] = segmap_usable_groups_228072;
                                grid[perm[1]] = 1;
                                grid[perm[2]] = 1;
                                
                                void *kernel_args_239234[] =
                                     {&ctx->global_failure, &n_203572,
                                      &partition_sizze_203667, &i_203760,
                                      &kernel_arg_239237, &kernel_arg_239238,
                                      &kernel_arg_239239, &kernel_arg_239240,
                                      &kernel_arg_239241, &kernel_arg_239242,
                                      &kernel_arg_239243};
                                int64_t time_start_239235 = 0, time_end_239236 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                            "main.segmap_228076",
                                            (long) segmap_usable_groups_228072,
                                            (long) 1, (long) 1,
                                            (long) segmap_group_sizze_228071,
                                            (long) 1, (long) 1, (int) 0);
                                    time_start_239235 = get_wall_time();
                                }
                                
                                cudaEvent_t *pevents = NULL;
                                
                                if (ctx->profiling && !ctx->profiling_paused) {
                                    pevents = cuda_get_events(&ctx->cuda,
                                                              &ctx->mainzisegmap_228076_runs,
                                                              &ctx->mainzisegmap_228076_total_runtime);
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0],
                                                                       0));
                                }
                                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228076,
                                                                      grid[0],
                                                                      grid[1],
                                                                      grid[2],
                                                                      segmap_group_sizze_228071,
                                                                      1, 1, 0,
                                                                      NULL,
                                                                      kernel_args_239234,
                                                                      NULL));
                                if (pevents != NULL)
                                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1],
                                                                       0));
                                if (ctx->debugging) {
                                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                                    time_end_239236 = get_wall_time();
                                    fprintf(ctx->log,
                                            "Kernel %s runtime: %ldus\n",
                                            "main.segmap_228076",
                                            time_end_239236 -
                                            time_start_239235);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231877,
                                                      "mem_231877") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231881,
                                                      "mem_231881") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231885,
                                                      "mem_231885") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231889,
                                                      "mem_231889") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231893,
                                                      "mem_231893") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231895,
                                                    &mem_231847,
                                                    "mem_231847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231893,
                                                      "mem_231893") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231889,
                                                      "mem_231889") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231885,
                                                      "mem_231885") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231881,
                                                      "mem_231881") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231877,
                                                      "mem_231877") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231847,
                                                  "mem_231847") != 0)
                            return 1;
                        
                        struct memblock_device mem_param_tmp_236757;
                        
                        mem_param_tmp_236757.references = NULL;
                        if (memblock_set_device(ctx, &mem_param_tmp_236757,
                                                &ext_mem_231895,
                                                "ext_mem_231895") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &mem_param_231841,
                                                &mem_param_tmp_236757,
                                                "mem_param_tmp_236757") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_tmp_236757,
                                                  "mem_param_tmp_236757") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231895,
                                                  "ext_mem_231895") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231847,
                                                  "mem_231847") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231898,
                                            &mem_param_231841,
                                            "mem_param_231841") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231833, "mem_231833") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231906,
                                            &ext_mem_231898,
                                            "ext_mem_231898") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_231841,
                                              "mem_param_231841") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231898,
                                              "ext_mem_231898") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231833, "mem_231833") !=
                        0)
                        return 1;
                }
                
                struct memblock_device mem_231922;
                
                mem_231922.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231922, bytes_229285,
                                          "mem_231922")) {
                    err = 1;
                    goto cleanup;
                }
                {
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->copy_dev_to_dev_runs,
                                                  &ctx->copy_dev_to_dev_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuMemcpy(mem_231922.mem +
                                                    (int64_t) 0,
                                                    ext_mem_231906.mem +
                                                    (int64_t) 0,
                                                    partition_sizze_203667 *
                                                    n_203572 * (int64_t) 8));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                }
                if (memblock_unref_device(ctx, &ext_mem_231906,
                                          "ext_mem_231906") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231924, &mem_231922,
                                        "mem_231922") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231922, "mem_231922") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231906,
                                          "ext_mem_231906") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231669, "ext_mem_231669") !=
                0)
                return 1;
            
            bool empty_slice_206881 = j_m_i_204223 == (int64_t) 0;
            int64_t m_206882 = sub64(j_m_i_204223, (int64_t) 1);
            int64_t i_p_m_t_s_206883 = add64(stl_res_203754, m_206882);
            bool zzero_leq_i_p_m_t_s_206884 = sle64((int64_t) 0,
                                                    i_p_m_t_s_206883);
            bool i_p_m_t_s_leq_w_206885 = slt64(i_p_m_t_s_206883, n_203572);
            bool zzero_lte_i_206886 = sle64((int64_t) 0, stl_res_203754);
            bool i_lte_j_206887 = sle64(stl_res_203754, stl_res_203755);
            bool y_206888 = i_p_m_t_s_leq_w_206885 && zzero_lte_i_206886;
            bool y_206889 = zzero_leq_i_p_m_t_s_206884 && y_206888;
            bool y_206890 = i_lte_j_206887 && y_206889;
            bool forwards_ok_206891 = zzero_lte_i_206886 && y_206890;
            bool ok_or_empty_206892 = empty_slice_206881 || forwards_ok_206891;
            bool index_certs_206893;
            
            if (!ok_or_empty_206892) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) stl_res_203754, ":",
                              (long long) stl_res_203755,
                              "] out of bounds for array of shape [",
                              (long long) n_203572, "].",
                              "-> #0  stl.fut:344:33-51\n   #1  stl.fut:342:13-349:28\n   #2  stl.fut:415:61-429:75\n   #3  stl.fut:455:3-469:34\n   #4  stl.fut:439:1-469:34\n");
                if (memblock_unref_device(ctx, &ext_mem_231924,
                                          "ext_mem_231924") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231668,
                                          "ext_mem_231668") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231669,
                                          "ext_mem_231669") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231960,
                                          "ext_mem_231960") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229623,
                                          "mem_param_229623") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229615,
                                          "mem_param_229615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231625,
                                          "ext_mem_231625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231626,
                                          "ext_mem_231626") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229601,
                                          "mem_param_229601") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229593,
                                          "mem_param_229593") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229585,
                                          "mem_param_229585") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231968,
                                          "ext_mem_231968") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231969,
                                          "ext_mem_231969") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231970,
                                          "ext_mem_231970") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229568,
                                          "ext_mem_229568") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229569,
                                          "ext_mem_229569") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229519,
                                          "ext_mem_229519") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229520,
                                          "ext_mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229470,
                                          "ext_mem_229470") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229471,
                                          "ext_mem_229471") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229372,
                                          "ext_mem_229372") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229373,
                                          "ext_mem_229373") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229304,
                                          "ext_mem_229304") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229305,
                                          "ext_mem_229305") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232074, "color_232074") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232361,
                                          "mem_out_232361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232360,
                                          "mem_out_232360") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232359,
                                          "mem_out_232359") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_228106;
            
            suff_outer_par_228106 =
                *ctx->tuning_params.mainzisuff_outer_par_38 <=
                partition_sizze_203667;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_38", (long) partition_sizze_203667,
                        suff_outer_par_228106 ? "true" : "false");
            
            int64_t segmap_group_sizze_228125;
            
            segmap_group_sizze_228125 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228110;
            
            int64_t nest_sizze_228173 = partition_sizze_203667 * j_m_i_204223;
            int64_t segred_group_sizze_228174;
            
            segred_group_sizze_228174 =
                *ctx->tuning_params.mainzisegred_group_sizze_228157;
            
            int64_t num_groups_228175;
            int32_t max_num_groups_237069;
            
            max_num_groups_237069 =
                *ctx->tuning_params.mainzisegred_num_groups_228159;
            num_groups_228175 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_228173,
                                                                     segred_group_sizze_228174),
                                                           sext_i32_i64(max_num_groups_237069))));
            
            int64_t segmap_group_sizze_228187;
            
            segmap_group_sizze_228187 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228145;
            
            struct memblock_device ext_mem_231954;
            
            ext_mem_231954.references = NULL;
            
            struct memblock_device ext_mem_231953;
            
            ext_mem_231953.references = NULL;
            
            struct memblock_device ext_mem_231952;
            
            ext_mem_231952.references = NULL;
            
            int32_t local_memory_capacity_237155;
            
            local_memory_capacity_237155 = ctx->cuda.max_shared_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_237155)) &&
                suff_outer_par_228106) {
                int64_t segmap_usable_groups_228126 =
                        sdiv_up64(partition_sizze_203667,
                                  segmap_group_sizze_228125);
                struct memblock_device mem_231927;
                
                mem_231927.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231927, binop_y_229284,
                                          "mem_231927")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231927,
                                                          (int64_t) 0,
                                                          ext_mem_231924,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203572,
                                                          partition_sizze_203667) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231927, "mem_231927") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231952,
                                              "ext_mem_231952") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231953,
                                              "ext_mem_231953") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231954,
                                              "ext_mem_231954") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231924,
                                              "ext_mem_231924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231668,
                                              "ext_mem_231668") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231669,
                                              "ext_mem_231669") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231960,
                                              "ext_mem_231960") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229623,
                                              "mem_param_229623") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229615,
                                              "mem_param_229615") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231625,
                                              "ext_mem_231625") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231626,
                                              "ext_mem_231626") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229601,
                                              "mem_param_229601") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229593,
                                              "mem_param_229593") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229585,
                                              "mem_param_229585") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231968,
                                              "ext_mem_231968") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231969,
                                              "ext_mem_231969") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231970,
                                              "ext_mem_231970") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229568,
                                              "ext_mem_229568") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229569,
                                              "ext_mem_229569") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229519,
                                              "ext_mem_229519") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229520,
                                              "ext_mem_229520") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229470,
                                              "ext_mem_229470") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229471,
                                              "ext_mem_229471") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229372,
                                              "ext_mem_229372") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229373,
                                              "ext_mem_229373") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229304,
                                              "ext_mem_229304") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229305,
                                              "ext_mem_229305") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232074,
                                              "color_232074") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232361,
                                              "mem_out_232361") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232360,
                                              "mem_out_232360") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232359,
                                              "mem_out_232359") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231931;
                
                mem_231931.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231931, bytes_229288,
                                          "mem_231931")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231934;
                
                mem_231934.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231934, bytes_229288,
                                          "mem_231934")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231937;
                
                mem_231937.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231937, bytes_229288,
                                          "mem_231937")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239247 = mem_231927.mem;
                CUdeviceptr kernel_arg_239248 = mem_231931.mem;
                CUdeviceptr kernel_arg_239249 = mem_231934.mem;
                CUdeviceptr kernel_arg_239250 = mem_231937.mem;
                
                if ((((((1 && segmap_usable_groups_228126 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_228125 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_228126;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239244[] = {&ctx->global_failure,
                                                  &partition_sizze_203667,
                                                  &stl_res_203754,
                                                  &j_m_i_204223,
                                                  &kernel_arg_239247,
                                                  &kernel_arg_239248,
                                                  &kernel_arg_239249,
                                                  &kernel_arg_239250};
                    int64_t time_start_239245 = 0, time_end_239246 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_228131",
                                (long) segmap_usable_groups_228126, (long) 1,
                                (long) 1, (long) segmap_group_sizze_228125,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239245 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_228131_runs,
                                                  &ctx->mainzisegmap_228131_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228131,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_228125,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239244,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239246 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_228131", time_end_239246 -
                                time_start_239245);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231927, "mem_231927") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231954, &mem_231931,
                                        "mem_231931") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231953, &mem_231934,
                                        "mem_231934") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231952, &mem_231937,
                                        "mem_231937") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231937, "mem_231937") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231934, "mem_231934") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231931, "mem_231931") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231927, "mem_231927") != 0)
                    return 1;
            } else {
                struct memblock_device mem_231941;
                
                mem_231941.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231941, bytes_229288,
                                          "mem_231941")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(j_m_i_204223 * (int64_t) 2,
                          segred_group_sizze_228174)) {
                    int64_t segment_sizze_nonzzero_237079 = smax64((int64_t) 1,
                                                                   j_m_i_204223);
                    int64_t num_threads_237080 = num_groups_228175 *
                            segred_group_sizze_228174;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204223, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_228174,
                                                    segment_sizze_nonzzero_237079),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203667,
                                                                   squot64(segred_group_sizze_228174,
                                                                           segment_sizze_nonzzero_237079))),
                                '\n');
                    
                    unsigned int shared_sizze_239254 = (int64_t) 8 *
                                 segred_group_sizze_228174;
                    CUdeviceptr kernel_arg_239256 = ext_mem_231924.mem;
                    CUdeviceptr kernel_arg_239257 = mem_231941.mem;
                    unsigned int shared_offset_239255 = 0;
                    
                    if ((((((1 && num_groups_228175 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_228174 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_228175;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239251[] = {&ctx->global_failure,
                                                      &shared_offset_239255,
                                                      &n_203572,
                                                      &partition_sizze_203667,
                                                      &stl_res_203754,
                                                      &j_m_i_204223,
                                                      &num_groups_228175,
                                                      &segment_sizze_nonzzero_237079,
                                                      &kernel_arg_239256,
                                                      &kernel_arg_239257};
                        int64_t time_start_239252 = 0, time_end_239253 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_small_228180",
                                    (long) num_groups_228175, (long) 1,
                                    (long) 1, (long) segred_group_sizze_228174,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_239254 +
                                                                (8 -
                                                                 shared_sizze_239254 %
                                                                 8) % 8)));
                            time_start_239252 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_small_228180_runs,
                                                      &ctx->mainzisegred_small_228180_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_small_228180,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_228174,
                                                              1, 1, 0 +
                                                              (shared_sizze_239254 +
                                                               (8 -
                                                                shared_sizze_239254 %
                                                                8) % 8), NULL,
                                                              kernel_args_239251,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239253 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_small_228180",
                                    time_end_239253 - time_start_239252);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_237106 =
                            sdiv_up64(num_groups_228175, smax64((int64_t) 1,
                                                                partition_sizze_203667));
                    int64_t elements_per_thread_237107 = sdiv_up64(j_m_i_204223,
                                                                   segred_group_sizze_228174 *
                                                                   groups_per_segment_237106);
                    int64_t virt_num_groups_237108 = groups_per_segment_237106 *
                            partition_sizze_203667;
                    int64_t num_threads_237109 = num_groups_228175 *
                            segred_group_sizze_228174;
                    int64_t threads_per_segment_237110 =
                            groups_per_segment_237106 *
                            segred_group_sizze_228174;
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                (long long) partition_sizze_203667, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204223, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_237108, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_228175, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_228174, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_237107, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_237106, '\n');
                    
                    struct memblock_device segred_tmp_mem_237111;
                    
                    segred_tmp_mem_237111.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_237111,
                                              (int64_t) 8 *
                                              virt_num_groups_237108,
                                              "segred_tmp_mem_237111")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_237113 =
                                           ctx->mainzicounter_mem_237113;
                    unsigned int shared_sizze_239262 = 1;
                    unsigned int shared_sizze_239264 = (int64_t) 8 *
                                 segred_group_sizze_228174;
                    CUdeviceptr kernel_arg_239266 = ext_mem_231924.mem;
                    CUdeviceptr kernel_arg_239267 = mem_231941.mem;
                    CUdeviceptr kernel_arg_239268 = segred_tmp_mem_237111.mem;
                    CUdeviceptr kernel_arg_239269 =
                                mainzicounter_mem_237113.mem;
                    unsigned int shared_offset_239263 = 0;
                    unsigned int shared_offset_239265 = 0 +
                                 (shared_sizze_239262 + (8 -
                                                         shared_sizze_239262 %
                                                         8) % 8);
                    
                    if ((((((1 && num_groups_228175 != 0) && 1 != 0) && 1 !=
                           0) && segred_group_sizze_228174 != 0) && 1 != 0) &&
                        1 != 0) {
                        int perm[3] = {0, 1, 2};
                        
                        if (1 >= 1 << 16) {
                            perm[1] = perm[0];
                            perm[0] = 1;
                        }
                        if (1 >= 1 << 16) {
                            perm[2] = perm[0];
                            perm[0] = 2;
                        }
                        
                        size_t grid[3];
                        
                        grid[perm[0]] = num_groups_228175;
                        grid[perm[1]] = 1;
                        grid[perm[2]] = 1;
                        
                        void *kernel_args_239259[] = {&ctx->global_failure,
                                                      &shared_offset_239263,
                                                      &shared_offset_239265,
                                                      &n_203572,
                                                      &partition_sizze_203667,
                                                      &stl_res_203754,
                                                      &j_m_i_204223,
                                                      &num_groups_228175,
                                                      &groups_per_segment_237106,
                                                      &elements_per_thread_237107,
                                                      &virt_num_groups_237108,
                                                      &threads_per_segment_237110,
                                                      &kernel_arg_239266,
                                                      &kernel_arg_239267,
                                                      &kernel_arg_239268,
                                                      &kernel_arg_239269};
                        int64_t time_start_239260 = 0, time_end_239261 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                    "main.segred_large_228180",
                                    (long) num_groups_228175, (long) 1,
                                    (long) 1, (long) segred_group_sizze_228174,
                                    (long) 1, (long) 1, (int) (0 +
                                                               (shared_sizze_239262 +
                                                                (8 -
                                                                 shared_sizze_239262 %
                                                                 8) % 8) +
                                                               (shared_sizze_239264 +
                                                                (8 -
                                                                 shared_sizze_239264 %
                                                                 8) % 8)));
                            time_start_239260 = get_wall_time();
                        }
                        
                        cudaEvent_t *pevents = NULL;
                        
                        if (ctx->profiling && !ctx->profiling_paused) {
                            pevents = cuda_get_events(&ctx->cuda,
                                                      &ctx->mainzisegred_large_228180_runs,
                                                      &ctx->mainzisegred_large_228180_total_runtime);
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                        }
                        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegred_large_228180,
                                                              grid[0], grid[1],
                                                              grid[2],
                                                              segred_group_sizze_228174,
                                                              1, 1, 0 +
                                                              (shared_sizze_239262 +
                                                               (8 -
                                                                shared_sizze_239262 %
                                                                8) % 8) +
                                                              (shared_sizze_239264 +
                                                               (8 -
                                                                shared_sizze_239264 %
                                                                8) % 8), NULL,
                                                              kernel_args_239259,
                                                              NULL));
                        if (pevents != NULL)
                            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                        if (ctx->debugging) {
                            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                            time_end_239261 = get_wall_time();
                            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                    "main.segred_large_228180",
                                    time_end_239261 - time_start_239260);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_237111,
                                              "segred_tmp_mem_237111") != 0)
                        return 1;
                }
                
                int64_t segmap_usable_groups_228188 =
                        sdiv_up64(partition_sizze_203667,
                                  segmap_group_sizze_228187);
                struct memblock_device mem_231945;
                
                mem_231945.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231945, bytes_229288,
                                          "mem_231945")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231948;
                
                mem_231948.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231948, bytes_229288,
                                          "mem_231948")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231951;
                
                mem_231951.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231951, bytes_229288,
                                          "mem_231951")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                
                CUdeviceptr kernel_arg_239273 = mem_231941.mem;
                CUdeviceptr kernel_arg_239274 = mem_231945.mem;
                CUdeviceptr kernel_arg_239275 = mem_231948.mem;
                CUdeviceptr kernel_arg_239276 = mem_231951.mem;
                
                if ((((((1 && segmap_usable_groups_228188 != 0) && 1 != 0) &&
                       1 != 0) && segmap_group_sizze_228187 != 0) && 1 != 0) &&
                    1 != 0) {
                    int perm[3] = {0, 1, 2};
                    
                    if (1 >= 1 << 16) {
                        perm[1] = perm[0];
                        perm[0] = 1;
                    }
                    if (1 >= 1 << 16) {
                        perm[2] = perm[0];
                        perm[0] = 2;
                    }
                    
                    size_t grid[3];
                    
                    grid[perm[0]] = segmap_usable_groups_228188;
                    grid[perm[1]] = 1;
                    grid[perm[2]] = 1;
                    
                    void *kernel_args_239270[] = {&ctx->global_failure,
                                                  &partition_sizze_203667,
                                                  &kernel_arg_239273,
                                                  &kernel_arg_239274,
                                                  &kernel_arg_239275,
                                                  &kernel_arg_239276};
                    int64_t time_start_239271 = 0, time_end_239272 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                                "main.segmap_228193",
                                (long) segmap_usable_groups_228188, (long) 1,
                                (long) 1, (long) segmap_group_sizze_228187,
                                (long) 1, (long) 1, (int) 0);
                        time_start_239271 = get_wall_time();
                    }
                    
                    cudaEvent_t *pevents = NULL;
                    
                    if (ctx->profiling && !ctx->profiling_paused) {
                        pevents = cuda_get_events(&ctx->cuda,
                                                  &ctx->mainzisegmap_228193_runs,
                                                  &ctx->mainzisegmap_228193_total_runtime);
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                    }
                    CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228193,
                                                          grid[0], grid[1],
                                                          grid[2],
                                                          segmap_group_sizze_228187,
                                                          1, 1, 0, NULL,
                                                          kernel_args_239270,
                                                          NULL));
                    if (pevents != NULL)
                        CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                    if (ctx->debugging) {
                        CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                        time_end_239272 = get_wall_time();
                        fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                                "main.segmap_228193", time_end_239272 -
                                time_start_239271);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231941, "mem_231941") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231954, &mem_231945,
                                        "mem_231945") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231953, &mem_231948,
                                        "mem_231948") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231952, &mem_231951,
                                        "mem_231951") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231951, "mem_231951") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231948, "mem_231948") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231945, "mem_231945") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231941, "mem_231941") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231924, "ext_mem_231924") !=
                0)
                return 1;
            
            int64_t segmap_group_sizze_228274;
            
            segmap_group_sizze_228274 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228214;
            
            int64_t segmap_usable_groups_228275 = sdiv_up64(nest_sizze_207090,
                                                            segmap_group_sizze_228274);
            struct memblock_device mem_231959;
            
            mem_231959.references = NULL;
            if (memblock_alloc_device(ctx, &mem_231959, bytes_229285,
                                      "mem_231959")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            
            CUdeviceptr kernel_arg_239280 = ext_mem_231668.mem;
            CUdeviceptr kernel_arg_239281 = ext_mem_231952.mem;
            CUdeviceptr kernel_arg_239282 = ext_mem_231953.mem;
            CUdeviceptr kernel_arg_239283 = ext_mem_231954.mem;
            CUdeviceptr kernel_arg_239284 = mem_231959.mem;
            
            if ((((((1 && segmap_usable_groups_228275 != 0) && 1 != 0) && 1 !=
                   0) && segmap_group_sizze_228274 != 0) && 1 != 0) && 1 != 0) {
                int perm[3] = {0, 1, 2};
                
                if (1 >= 1 << 16) {
                    perm[1] = perm[0];
                    perm[0] = 1;
                }
                if (1 >= 1 << 16) {
                    perm[2] = perm[0];
                    perm[0] = 2;
                }
                
                size_t grid[3];
                
                grid[perm[0]] = segmap_usable_groups_228275;
                grid[perm[1]] = 1;
                grid[perm[2]] = 1;
                
                void *kernel_args_239277[] = {&ctx->global_failure, &n_203572,
                                              &partition_sizze_203667,
                                              &kernel_arg_239280,
                                              &kernel_arg_239281,
                                              &kernel_arg_239282,
                                              &kernel_arg_239283,
                                              &kernel_arg_239284};
                int64_t time_start_239278 = 0, time_end_239279 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                            "main.segmap_228279",
                            (long) segmap_usable_groups_228275, (long) 1,
                            (long) 1, (long) segmap_group_sizze_228274,
                            (long) 1, (long) 1, (int) 0);
                    time_start_239278 = get_wall_time();
                }
                
                cudaEvent_t *pevents = NULL;
                
                if (ctx->profiling && !ctx->profiling_paused) {
                    pevents = cuda_get_events(&ctx->cuda,
                                              &ctx->mainzisegmap_228279_runs,
                                              &ctx->mainzisegmap_228279_total_runtime);
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
                }
                CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228279,
                                                      grid[0], grid[1], grid[2],
                                                      segmap_group_sizze_228274,
                                                      1, 1, 0, NULL,
                                                      kernel_args_239277,
                                                      NULL));
                if (pevents != NULL)
                    CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
                if (ctx->debugging) {
                    CUDA_SUCCEED_FATAL(cuCtxSynchronize());
                    time_end_239279 = get_wall_time();
                    fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                            "main.segmap_228279", time_end_239279 -
                            time_start_239278);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_231668, "ext_mem_231668") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231952, "ext_mem_231952") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231953, "ext_mem_231953") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231954, "ext_mem_231954") !=
                0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_231960, &mem_231959,
                                    "mem_231959") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_231959, "mem_231959") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231952, "ext_mem_231952") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231953, "ext_mem_231953") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231954, "ext_mem_231954") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231924, "ext_mem_231924") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231668, "ext_mem_231668") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231669, "ext_mem_231669") !=
                0)
                return 1;
        } else {
            if (memblock_set_device(ctx, &ext_mem_231960, &mem_param_229601,
                                    "mem_param_229601") != 0)
                return 1;
        }
        
        int64_t ctx_param_ext_tmp_233093 = ext_231632;
        int64_t ctx_param_ext_tmp_233094 = ext_231630;
        int64_t ctx_param_ext_tmp_233095 = ext_231965;
        int64_t ctx_param_ext_tmp_233096 = ext_231964;
        int64_t ctx_param_ext_tmp_233097 = ext_231961;
        int64_t ctx_param_ext_tmp_233098 = ext_231963;
        int64_t ctx_param_ext_tmp_233099 = ext_231967;
        int64_t ctx_param_ext_tmp_233100 = ext_231962;
        int64_t ctx_param_ext_tmp_233101 = ext_231966;
        struct memblock_device mem_param_tmp_233102;
        
        mem_param_tmp_233102.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_233102, &ext_mem_231626,
                                "ext_mem_231626") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_233103;
        
        mem_param_tmp_233103.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_233103, &ext_mem_231625,
                                "ext_mem_231625") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_233104;
        
        mem_param_tmp_233104.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_233104, &ext_mem_231960,
                                "ext_mem_231960") != 0)
            return 1;
        ctx_param_ext_229587 = ctx_param_ext_tmp_233093;
        ctx_param_ext_229589 = ctx_param_ext_tmp_233094;
        ctx_param_ext_229594 = ctx_param_ext_tmp_233095;
        ctx_param_ext_229595 = ctx_param_ext_tmp_233096;
        ctx_param_ext_229596 = ctx_param_ext_tmp_233097;
        ctx_param_ext_229597 = ctx_param_ext_tmp_233098;
        ctx_param_ext_229598 = ctx_param_ext_tmp_233099;
        ctx_param_ext_229599 = ctx_param_ext_tmp_233100;
        ctx_param_ext_229600 = ctx_param_ext_tmp_233101;
        if (memblock_set_device(ctx, &mem_param_229585, &mem_param_tmp_233102,
                                "mem_param_tmp_233102") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229593, &mem_param_tmp_233103,
                                "mem_param_tmp_233103") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229601, &mem_param_tmp_233104,
                                "mem_param_tmp_233104") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_233104,
                                  "mem_param_tmp_233104") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_233103,
                                  "mem_param_tmp_233103") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_233102,
                                  "mem_param_tmp_233102") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231960, "ext_mem_231960") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229623, "mem_param_229623") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229615, "mem_param_229615") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231625, "ext_mem_231625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231626, "ext_mem_231626") != 0)
            return 1;
    }
    ext_231983 = ctx_param_ext_229587;
    ext_231981 = ctx_param_ext_229589;
    ext_231977 = ctx_param_ext_229594;
    ext_231976 = ctx_param_ext_229595;
    ext_231975 = ctx_param_ext_229596;
    ext_231974 = ctx_param_ext_229597;
    ext_231973 = ctx_param_ext_229598;
    ext_231972 = ctx_param_ext_229599;
    ext_231971 = ctx_param_ext_229600;
    if (memblock_set_device(ctx, &ext_mem_231970, &mem_param_229585,
                            "mem_param_229585") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231969, &mem_param_229593,
                            "mem_param_229593") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231968, &mem_param_229601,
                            "mem_param_229601") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
        return 1;
    
    struct memblock_device mem_231995;
    
    mem_231995.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231995, bytes_229268, "mem_231995")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231995, m_203571 * n_203572,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_231999;
    
    mem_231999.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231999, bytes_229268, "mem_231999")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231999, m_203571 * n_203572,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_232003;
    
    mem_232003.references = NULL;
    if (memblock_alloc_device(ctx, &mem_232003, bytes_229268, "mem_232003")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_232003, m_203571 * n_203572,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_228305;
    
    segmap_group_sizze_228305 =
        *ctx->tuning_params.mainzisegmap_group_sizze_228304;
    
    int64_t num_groups_228307;
    int32_t max_num_groups_237166;
    
    max_num_groups_237166 = *ctx->tuning_params.mainzisegmap_num_groups_228306;
    num_groups_228307 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(partition_sizze_203667,
                                                             segmap_group_sizze_228305),
                                                   sext_i32_i64(max_num_groups_237166))));
    
    struct memblock_device mem_232006;
    
    mem_232006.references = NULL;
    if (memblock_alloc_device(ctx, &mem_232006, binop_y_229284, "mem_232006")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_232006, (int64_t) 0,
                                              ext_mem_231970, (int64_t) 0,
                                              (int64_t) 1, n_203572,
                                              partition_sizze_203667) != 0) {
        if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
        return 1;
    
    struct memblock_device mem_232009;
    
    mem_232009.references = NULL;
    if (memblock_alloc_device(ctx, &mem_232009, binop_y_229284, "mem_232009")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_232009, (int64_t) 0,
                                              ext_mem_231969, (int64_t) 0,
                                              (int64_t) 1, n_203572,
                                              partition_sizze_203667) != 0) {
        if (memblock_unref_device(ctx, &mem_232009, "mem_232009") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
        return 1;
    
    int64_t num_threads_232357 = segmap_group_sizze_228305 * num_groups_228307;
    int64_t total_sizze_232358 = bytes_229277 * num_threads_232357;
    struct memblock_device color_232194;
    
    color_232194.references = NULL;
    if (memblock_alloc_device(ctx, &color_232194, total_sizze_232358,
                              "color_232194")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    
    CUdeviceptr kernel_arg_239288 = mem_229269.mem;
    CUdeviceptr kernel_arg_239289 = mem_229272.mem;
    CUdeviceptr kernel_arg_239290 = mem_231995.mem;
    CUdeviceptr kernel_arg_239291 = mem_231999.mem;
    CUdeviceptr kernel_arg_239292 = mem_232003.mem;
    CUdeviceptr kernel_arg_239293 = mem_232006.mem;
    CUdeviceptr kernel_arg_239294 = mem_232009.mem;
    CUdeviceptr kernel_arg_239295 = color_232194.mem;
    
    if ((((((1 && num_groups_228307 != 0) && 1 != 0) && 1 != 0) &&
          segmap_group_sizze_228305 != 0) && 1 != 0) && 1 != 0) {
        int perm[3] = {0, 1, 2};
        
        if (1 >= 1 << 16) {
            perm[1] = perm[0];
            perm[0] = 1;
        }
        if (1 >= 1 << 16) {
            perm[2] = perm[0];
            perm[0] = 2;
        }
        
        size_t grid[3];
        
        grid[perm[0]] = num_groups_228307;
        grid[perm[1]] = 1;
        grid[perm[2]] = 1;
        
        void *kernel_args_239285[] = {&ctx->global_failure, &m_203571,
                                      &n_203572, &partition_sizze_203667,
                                      &num_groups_228307, &num_threads_232357,
                                      &kernel_arg_239288, &kernel_arg_239289,
                                      &kernel_arg_239290, &kernel_arg_239291,
                                      &kernel_arg_239292, &kernel_arg_239293,
                                      &kernel_arg_239294, &kernel_arg_239295};
        int64_t time_start_239286 = 0, time_end_239287 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with grid size [%ld, %ld, %ld] and block size [%ld, %ld, %ld]; shared memory: %d bytes.\n",
                    "main.segmap_228302", (long) num_groups_228307, (long) 1,
                    (long) 1, (long) segmap_group_sizze_228305, (long) 1,
                    (long) 1, (int) 0);
            time_start_239286 = get_wall_time();
        }
        
        cudaEvent_t *pevents = NULL;
        
        if (ctx->profiling && !ctx->profiling_paused) {
            pevents = cuda_get_events(&ctx->cuda,
                                      &ctx->mainzisegmap_228302_runs,
                                      &ctx->mainzisegmap_228302_total_runtime);
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[0], 0));
        }
        CUDA_SUCCEED_OR_RETURN(cuLaunchKernel(ctx->mainzisegmap_228302, grid[0],
                                              grid[1], grid[2],
                                              segmap_group_sizze_228305, 1, 1,
                                              0, NULL, kernel_args_239285,
                                              NULL));
        if (pevents != NULL)
            CUDA_SUCCEED_FATAL(cudaEventRecord(pevents[1], 0));
        if (ctx->debugging) {
            CUDA_SUCCEED_FATAL(cuCtxSynchronize());
            time_end_239287 = get_wall_time();
            fprintf(ctx->log, "Kernel %s runtime: %ldus\n",
                    "main.segmap_228302", time_end_239287 - time_start_239286);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232009, "mem_232009") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232194, "color_232194") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232359, &mem_231995, "mem_231995") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232360, &mem_231999, "mem_231999") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232361, &mem_232003, "mem_232003") !=
        0)
        return 1;
    (*mem_out_p_237253).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_237253, &mem_out_232359,
                            "mem_out_232359") != 0)
        return 1;
    (*mem_out_p_237254).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_237254, &mem_out_232360,
                            "mem_out_232360") != 0)
        return 1;
    (*mem_out_p_237255).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_237255, &mem_out_232361,
                            "mem_out_232361") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232194, "color_232194") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232009, "mem_232009") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232006, "mem_232006") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_232003, "mem_232003") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231999, "mem_231999") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231995, "mem_231995") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229601, "mem_param_229601") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229593, "mem_param_229593") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229585, "mem_param_229585") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231968, "ext_mem_231968") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231969, "ext_mem_231969") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231970, "ext_mem_231970") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230659, "mem_230659") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230642, "mem_230642") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230625, "mem_230625") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230608, "mem_230608") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229639, "mem_229639") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229634, "mem_229634") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229628, "mem_229628") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229577, "mem_229577") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229573, "mem_229573") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229568, "ext_mem_229568") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229569, "ext_mem_229569") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229519, "ext_mem_229519") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229520, "ext_mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229470, "ext_mem_229470") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229471, "ext_mem_229471") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229372, "ext_mem_229372") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229373, "ext_mem_229373") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229314, "mem_229314") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229308, "mem_229308") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229304, "ext_mem_229304") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229305, "ext_mem_229305") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229272, "mem_229272") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229269, "mem_229269") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232074, "color_232074") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229265, "mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229263, "mem_229263") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229242, "mem_229242") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232361, "mem_out_232361") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232360, "mem_out_232360") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232359, "mem_out_232359") != 0)
        return 1;
    
  cleanup:
    { }
    return err;
}

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